24 lines
646 B
YAML
24 lines
646 B
YAML
---
|
|
# Sistemiamo un po' di impostazioni legate al dominio
|
|
|
|
- name: Impostazione del dominio
|
|
ansible.builtin.lineinfile:
|
|
path: /etc/domainname
|
|
state: present
|
|
create: true
|
|
line: |-
|
|
{{ 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|trim != ansible_hostname + '.' + domain
|