diff --git a/.gitignore b/.gitignore index 18cb88c..e274a3d 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,6 @@ .vault-pass .vault.yml .passbolt.yml +inventories/local venv context/_build diff --git a/inventories/group_vars/all.yml b/inventories/group_vars/all.yml index d14f1d3..4615399 100644 --- a/inventories/group_vars/all.yml +++ b/inventories/group_vars/all.yml @@ -11,7 +11,6 @@ main_dns_server: ns1.verdnatura.es ldap_uri: ldap://ldap.verdnatura.es ldap_base: dc=verdnatura,dc=es dc_net: "10.0.0.0/16" -resolv_domain: verdnatura.es resolvers: - '10.0.0.4' - '10.0.0.5' diff --git a/roles/debian-host/handlers/main.yml b/roles/debian-host/handlers/main.yml index 35f2de4..45b25b1 100644 --- a/roles/debian-host/handlers/main.yml +++ b/roles/debian-host/handlers/main.yml @@ -1,4 +1,4 @@ - name: restart-sysctl - service: + systemd: name: systemd-sysctl - state: restarted + state: restarted \ No newline at end of file diff --git a/roles/debian-host/tasks/apparmor.yml b/roles/debian-host/tasks/apparmor.yml index 38a2e8f..a239254 100644 --- a/roles/debian-host/tasks/apparmor.yml +++ b/roles/debian-host/tasks/apparmor.yml @@ -1,5 +1,12 @@ -- name: Disable AppArmor - service: +- name: Stop AppArmor + systemd: name: apparmor state: stopped +- name: Disable AppArmor service + systemd: + name: apparmor enabled: no +- name: Mask AppArmor service + systemd: + name: apparmor + masked: yes \ No newline at end of file diff --git a/roles/debian-host/tasks/hostname.yml b/roles/debian-host/tasks/hostname.yml index 799a81f..b17bd1f 100644 --- a/roles/debian-host/tasks/hostname.yml +++ b/roles/debian-host/tasks/hostname.yml @@ -2,11 +2,8 @@ hostname: name: "{{ inventory_hostname_short }}" use: debian -- name: Configure hosts file - blockinfile: +- name: Populating hosts file with hostname + lineinfile: path: /etc/hosts - marker_begin: '--- BEGIN VN ---' - marker_end: '--- END VN ---' - marker: "# {mark}" - block: | - {{ ansible_default_ipv4.address }} {{ ansible_host }} {{ inventory_hostname_short }} + regexp: '^127.0.1.1' + line: '127.0.1.1 {{ ansible_host }} {{ inventory_hostname_short }}' \ No newline at end of file diff --git a/roles/debian-host/tasks/sysctl.yml b/roles/debian-host/tasks/sysctl.yml index be8eaf7..aab1e57 100644 --- a/roles/debian-host/tasks/sysctl.yml +++ b/roles/debian-host/tasks/sysctl.yml @@ -1,4 +1,4 @@ -- name: Set systctl configuration +- name: Set systctl custom vn configuration copy: src: sysctl/ dest: /etc/sysctl.d/ diff --git a/roles/debian-host/templates/resolv.conf b/roles/debian-host/templates/resolv.conf index cce81b4..52a1891 100644 --- a/roles/debian-host/templates/resolv.conf +++ b/roles/debian-host/templates/resolv.conf @@ -1,5 +1,5 @@ -domain {{ resolv_domain }} -search {{ resolv_domain }} +domain {{ host_domain }} +search {{ host_domain }} {% if resolvers is defined %} {% for resolver in resolvers %} nameserver {{resolver}}