ansible/roles/base/tasks/hostname.yml

12 lines
242 B
YAML
Raw Normal View History

2021-02-12 22:13:37 +01:00
---
- name: Set hostname
hostname:
name: "{{ hostname }}"
- name: Add myself to /etc/hosts
lineinfile:
dest: /etc/hosts
regexp: '^127\.0\.0\.1[ \t]+localhost'
line: '127.0.0.1 localhost {{ hostname }}'
state: present