Primi passaggi di correzione; playbook ancora da testare.
This commit is contained in:
commit
a8529d4f72
6 changed files with 88 additions and 0 deletions
22
roles/fqdn/tasks/main.yml
Normal file
22
roles/fqdn/tasks/main.yml
Normal file
|
@ -0,0 +1,22 @@
|
|||
---
|
||||
# Sistemiamo un po' di impostazioni legate al dominio
|
||||
|
||||
- name: Impostazione del dominio
|
||||
ansible.builtin.file:
|
||||
path: /etc/domainname
|
||||
content: |
|
||||
{{ domain }}
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0644'
|
||||
|
||||
- name: Sistemiamo il file hosts
|
||||
ansible.builtin.lineinfile:
|
||||
line: "127.0.1.1\t{{ ansible_hostname }}.{{ domain }}\t{{ ansible_hostname }}"
|
||||
regexp: "^127.0.1.1"
|
||||
path: /etc/hosts
|
||||
|
||||
- name: Verifichiamo che tutto sia in ordine
|
||||
ansible.builtin.command: hostname -f
|
||||
register: returned_fqdn
|
||||
failed_when: returned_fqdn.stdout != "{{ ansible_hostname }}.{{ domain }}"
|
Loading…
Add table
Add a link
Reference in a new issue