Skip to content

Commit e950083

Browse files
committed
feat(baseline): Host name is set to invemtory_hostname
1 parent 9cfd738 commit e950083

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

playbooks/baseline/config.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@
66
- polaris.layer.baseline.config
77
tasks:
88

9+
- name: The host name is correct
10+
ansible.builtin.hostname:
11+
name: '{{ inventory_hostname }}'
12+
13+
- name: The host name is present in /etc/hosts
14+
ansible.builtin.lineinfile:
15+
dest: /etc/hosts
16+
regexp: '^127\.0\.0\.1[ \t]+localhost'
17+
line: '127.0.0.1 localhost {{ inventory_hostname }}'
18+
state: present
19+
920
- name: Python packages needed by Ansible are installed by Pip
1021
ansible.builtin.import_role:
1122
name: geerlingguy.pip

0 commit comments

Comments
 (0)