Rearange existing roles to make more sense
This commit is contained in:
parent
bec00118c0
commit
e06547e25c
11 changed files with 104 additions and 104 deletions
11
roles/hostname/tasks/main.yml
Normal file
11
roles/hostname/tasks/main.yml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
---
|
||||
- name: Configure hostname
|
||||
become: true
|
||||
ansible.builtin.hostname:
|
||||
name: "{{ hostname }}"
|
||||
- name: Remove existing /etc/hosts entry for hostname and add FQDN name
|
||||
become: true
|
||||
ansible.builtin.lineinfile:
|
||||
path: /etc/hosts
|
||||
regexp: "^127.0.1.1.*$"
|
||||
line: "{{ ansible_facts['default_ipv4']['address'] }} {{ hostname }}.kleinendorst.info {{ hostname }}"
|
||||
Loading…
Add table
Add a link
Reference in a new issue