diff options
author | Emil Renner Berthing <esmil@labitat.dk> | 2020-02-27 11:26:52 +0100 |
---|---|---|
committer | Emil Renner Berthing <esmil@labitat.dk> | 2020-02-27 13:21:19 +0100 |
commit | f1b1a9fd90056b2d42b2cb41e71af254e2c07268 (patch) | |
tree | 5fa28991c2e8f157a524e297fded3f233baa91f3 /roles/debian/tasks | |
parent | bfb961cfa1cd4ebbfd965df3b9511a9220b54845 (diff) | |
download | labitat-ansible-f1b1a9fd90056b2d42b2cb41e71af254e2c07268.tar.gz labitat-ansible-f1b1a9fd90056b2d42b2cb41e71af254e2c07268.tar.xz labitat-ansible-f1b1a9fd90056b2d42b2cb41e71af254e2c07268.zip |
debian: update for hash_behaviour = replace
Diffstat (limited to 'roles/debian/tasks')
-rw-r--r-- | roles/debian/tasks/apt.yml | 18 | ||||
-rw-r--r-- | roles/debian/tasks/locale.yml | 10 | ||||
-rw-r--r-- | roles/debian/tasks/networkd.yml | 4 | ||||
-rw-r--r-- | roles/debian/tasks/resolved.yml | 4 | ||||
-rw-r--r-- | roles/debian/tasks/sshd.yml | 7 | ||||
-rw-r--r-- | roles/debian/tasks/sudo.yml | 7 | ||||
-rw-r--r-- | roles/debian/tasks/systemd.yml | 6 | ||||
-rw-r--r-- | roles/debian/tasks/timesyncd.yml | 4 |
8 files changed, 36 insertions, 24 deletions
diff --git a/roles/debian/tasks/apt.yml b/roles/debian/tasks/apt.yml index b3d0851..82bbedd 100644 --- a/roles/debian/tasks/apt.yml +++ b/roles/debian/tasks/apt.yml @@ -16,6 +16,8 @@ mode: 0755 - name: Remove packages + vars: + apt_packages: '{{ apt_packages_default|combine(apt_packages_role) }}' apt: name: "{{ apt_packages|dictsort(true)|selectattr(1,'equalto','absent')|map(attribute=0)|list }}" state: absent @@ -25,6 +27,8 @@ - packages - name: Create /etc/apt/preferences.d + vars: + apt_preferences: '{{ apt_preferences_default|combine(apt_preferences_role) }}' template: dest: '/etc/apt/preferences.d/{{ item.key }}' src: apt-preferences.j2 @@ -35,6 +39,8 @@ when: item.value - name: Remove /etc/apt/preferences.d + vars: + apt_preferences: '{{ apt_preferences_default|combine(apt_preferences_role) }}' file: path: '/etc/apt/preferences.d/{{ item.key }}' state: absent @@ -42,21 +48,27 @@ when: not item.value - name: Configure /etc/apt/sources.list + vars: + apt_repos: '{{ apt_repos_default|combine(apt_repos_role) }}' + apt_sources: '{{ apt_sources_default|combine(apt_sources_role) }}' template: dest: '/etc/apt/sources.list' src: sources.list.j2 owner: root group: root mode: 0644 - when: apt_sources is defined + when: 'apt_sources|length > 0' - name: Download repository keys + vars: + apt_repos: '{{ apt_repos_default|combine(apt_repos_role) }}' + apt_sources: '{{ apt_sources_default|combine(apt_sources_role) }}' apt_key: url: "{{ apt_repos[item.key]['key_url'] }}" id: "{{ apt_repos[item.key]['key_id'] }}" state: present with_dict: '{{ apt_sources }}' - when: apt_sources is defined and 'key_url' in apt_repos[item.key] + when: "'key_url' in apt_repos[item.key]" - name: Update apt cache apt: @@ -66,6 +78,8 @@ - packages - name: Install packages + vars: + apt_packages: '{{ apt_packages_default | combine(apt_packages_role) }}' apt: name: "{{ apt_packages|dictsort(true)|selectattr(1,'equalto','present')|map(attribute=0)|list }}" state: present diff --git a/roles/debian/tasks/locale.yml b/roles/debian/tasks/locale.yml index 72a0b65..bea2472 100644 --- a/roles/debian/tasks/locale.yml +++ b/roles/debian/tasks/locale.yml @@ -3,9 +3,9 @@ debconf: name: locales question: locales/locales_to_be_generated - value: "{{ locale.generated|join(', ') }}" + value: "{{ locale_generated|join(', ') }}" vtype: multiselect - register: locale_generated + register: locale_generated_debconf - name: dpkg-reconfigure locales block: @@ -18,10 +18,10 @@ - debconf: name: locales question: locales/locales_to_be_generated - value: "{{ locale.generated|join(', ') }}" + value: "{{ locale_generated|join(', ') }}" vtype: multiselect - command: dpkg-reconfigure -fnoninteractive locales - when: locale_generated is changed + when: locale_generated_debconf is changed - name: Setting default locale template: @@ -35,7 +35,7 @@ debconf: name: locales question: locales/default_environment_locale - value: '{{ locale.default.LANG }}' + value: '{{ locale_default.LANG }}' vtype: select # vim: set ts=2 sw=2 et: diff --git a/roles/debian/tasks/networkd.yml b/roles/debian/tasks/networkd.yml index 50791b3..084a844 100644 --- a/roles/debian/tasks/networkd.yml +++ b/roles/debian/tasks/networkd.yml @@ -1,5 +1,7 @@ --- -- name: Configure systemd-networkd +- name: Configure networkd.conf + vars: + networkd_conf: '{{ networkd_conf_default|combine(networkd_conf_role) }}' ini_file: path: '/etc/systemd/networkd.conf' no_extra_spaces: yes diff --git a/roles/debian/tasks/resolved.yml b/roles/debian/tasks/resolved.yml index 9a6d4c1..4fcc34b 100644 --- a/roles/debian/tasks/resolved.yml +++ b/roles/debian/tasks/resolved.yml @@ -1,5 +1,7 @@ --- -- name: Configure systemd-resolved +- name: Configure resolved.conf + vars: + resolved_conf: '{{ resolved_conf_default|combine(resolved_conf_role) }}' ini_file: path: '/etc/systemd/resolved.conf' no_extra_spaces: yes diff --git a/roles/debian/tasks/sshd.yml b/roles/debian/tasks/sshd.yml index 62aa1cc..4c257fe 100644 --- a/roles/debian/tasks/sshd.yml +++ b/roles/debian/tasks/sshd.yml @@ -1,11 +1,4 @@ --- -- name: Install SSH server - apt: - name: openssh-server - state: present - tags: - - packages - - name: Create private host keys copy: dest: '/etc/ssh/{{ item.key }}' diff --git a/roles/debian/tasks/sudo.yml b/roles/debian/tasks/sudo.yml index e52e1f6..f1a0328 100644 --- a/roles/debian/tasks/sudo.yml +++ b/roles/debian/tasks/sudo.yml @@ -1,11 +1,4 @@ --- -- name: Install sudo - apt: - name: sudo - state: present - tags: - - packages - - name: Configure sudo copy: dest: '/etc/sudoers' diff --git a/roles/debian/tasks/systemd.yml b/roles/debian/tasks/systemd.yml index 56a5898..a2b9e4b 100644 --- a/roles/debian/tasks/systemd.yml +++ b/roles/debian/tasks/systemd.yml @@ -1,5 +1,7 @@ --- - name: Configure systemd system.conf + vars: + systemd_conf: '{{ systemd_conf_default|combine(systemd_conf_role) }}' ini_file: path: '/etc/systemd/system.conf' no_extra_spaces: yes @@ -10,6 +12,8 @@ with_dict: '{{ systemd_conf }}' - name: Configure journald.conf + vars: + journald_conf: '{{ journald_conf_default|combine(journald_conf_role) }}' ini_file: path: '/etc/systemd/journald.conf' no_extra_spaces: yes @@ -20,6 +24,8 @@ with_dict: '{{ journald_conf }}' - name: Configure logind.conf + vars: + logind_conf: '{{ logind_conf_default|combine(logind_conf_role) }}' ini_file: path: '/etc/systemd/logind.conf' no_extra_spaces: yes diff --git a/roles/debian/tasks/timesyncd.yml b/roles/debian/tasks/timesyncd.yml index 180d8c2..9895d0b 100644 --- a/roles/debian/tasks/timesyncd.yml +++ b/roles/debian/tasks/timesyncd.yml @@ -1,5 +1,7 @@ --- -- name: Configure systemd-timesyncd +- name: Configure timesyncd.conf + vars: + timesyncd_conf: '{{ timesyncd_conf_default|combine(timesyncd_conf_role) }}' ini_file: path: '/etc/systemd/timesyncd.conf' no_extra_spaces: yes |