diff --git a/roles/backup/tasks/main.yml b/roles/backup/tasks/main.yml index 4111ff6..cb54730 100644 --- a/roles/backup/tasks/main.yml +++ b/roles/backup/tasks/main.yml @@ -81,4 +81,14 @@ when: lsi_controllers | default([]) | length > 0 tags: backup +- name: Excludes for proxmox backup client + copy: + dest: /.pxarexclude + content: | + var/log/lastlog + when: + - ansible_virtualization_role == 'guest' + - ansible_virtualization_type == 'lxc' or ansible_virtualization_type == 'systemd-nspawn' + tags: backup + ... diff --git a/roles/common/meta/main.yml b/roles/common/meta/main.yml index 42c19e5..34dcd11 100644 --- a/roles/common/meta/main.yml +++ b/roles/common/meta/main.yml @@ -15,7 +15,7 @@ dependencies: - role: sssd_ad_auth when: ad_auth | default(False) - role: ntp_client - when: ansible_virtualization_role == 'host' or ansible_virtualization_type != 'lxc' + when: ansible_virtualization_role == 'host' or (ansible_virtualization_type != 'lxc' and ansible_virtualization_type != 'systemd-nspawn') - role: sudo - role: ssh - role: patrix diff --git a/roles/common/tasks/system.yml b/roles/common/tasks/system.yml index bfdf47b..fa6ed69 100644 --- a/roles/common/tasks/system.yml +++ b/roles/common/tasks/system.yml @@ -48,7 +48,7 @@ value: "{{ system_swappiness }}" sysctl_file: /etc/sysctl.d/ansible.conf state: present - when: ansible_virtualization_role == 'host' or ansible_virtualization_type != 'lxc' + when: ansible_virtualization_role == 'host' or (ansible_virtualization_type != 'lxc' and ansible_virtualization_type != 'systemd-nspawn') - name: Set sysctl values sysctl: diff --git a/roles/network/tasks/main.yml b/roles/network/tasks/main.yml index 2151a0a..be9020e 100644 --- a/roles/network/tasks/main.yml +++ b/roles/network/tasks/main.yml @@ -2,6 +2,7 @@ - name: Configure IPv4 Forwarding sysctl: name="net.ipv4.ip_forward" value={{ net_ipv4_forward | ternary('1', '0') }} sysctl_file=/etc/sysctl.d/network.conf sysctl_set=yes state=present reload=yes + when: ansible_virtualization_type != 'systemd-nspawn' - name: Deploy /etc/hosts template: src=hosts.j2 dest=/etc/hosts