From 289fa488c36bcca55b1781ebb4fe4d5849b91432 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Wed, 2 Mar 2016 15:54:10 +0100 Subject: [PATCH] library/roles: More ansible 2 cleanup. --- fail2ban/tasks/fail2ban.yml | 2 +- postgresql/defaults/main.yml | 1 - .../tasks/disable-unneeded-services.yml | 2 +- .../tasks/install_external_ca_cert.yml | 2 +- ubuntu-deb-general/tasks/packages.yml | 5 ++--- ubuntu-deb-general/tasks/pubkeys.yml | 4 ++-- .../tasks/remove-unneeded-pkgs.yml | 22 +++++++------------ 7 files changed, 15 insertions(+), 23 deletions(-) diff --git a/fail2ban/tasks/fail2ban.yml b/fail2ban/tasks/fail2ban.yml index 75266361..e68c3758 100644 --- a/fail2ban/tasks/fail2ban.yml +++ b/fail2ban/tasks/fail2ban.yml @@ -1,7 +1,7 @@ --- - name: Install fail2ban on ubuntu >= 14.04 and debian >= 8 apt: pkg={{ item }} state=installed - with_items: f2b_packages + with_items: '{{ f2b_packages }}' tags: fail2ban - name: Ensure that fail2ban is enabled and running diff --git a/postgresql/defaults/main.yml b/postgresql/defaults/main.yml index 14f324b6..8e2fe9db 100644 --- a/postgresql/defaults/main.yml +++ b/postgresql/defaults/main.yml @@ -56,7 +56,6 @@ postgres_gis_pkgs: pg_backup_enabled: True -pg_backup_logdir: /var/log/postgresql pg_backup_bin: /usr/local/sbin/postgresql-backup pg_backup_pgdump_bin: /usr/bin/pg_dump pg_backup_retain_copies: 15 diff --git a/ubuntu-deb-general/tasks/disable-unneeded-services.yml b/ubuntu-deb-general/tasks/disable-unneeded-services.yml index aef994c9..67f5ccc2 100644 --- a/ubuntu-deb-general/tasks/disable-unneeded-services.yml +++ b/ubuntu-deb-general/tasks/disable-unneeded-services.yml @@ -1,6 +1,6 @@ --- - name: Disable some unneeded services service: name={{ item }} state=stopped enabled=no - with_items: services_to_be_disabled + with_items: '{{ services_to_be_disabled }}' ignore_errors: True tags: [ 'bootstrap', 'disable_services' ] diff --git a/ubuntu-deb-general/tasks/install_external_ca_cert.yml b/ubuntu-deb-general/tasks/install_external_ca_cert.yml index 0be2a9e4..7a4ac2d1 100644 --- a/ubuntu-deb-general/tasks/install_external_ca_cert.yml +++ b/ubuntu-deb-general/tasks/install_external_ca_cert.yml @@ -1,7 +1,7 @@ --- - name: Install the additional CA certificates get_url: url={{ item.url }} dest={{ item.dest_file }} - with_items: x509_additional_ca_certs + with_items: '{{ x509_additional_ca_certs }}' when: install_additional_ca_certs notify: Update the CA bundle list tags: ca diff --git a/ubuntu-deb-general/tasks/packages.yml b/ubuntu-deb-general/tasks/packages.yml index f7ffc9cc..a850a52e 100644 --- a/ubuntu-deb-general/tasks/packages.yml +++ b/ubuntu-deb-general/tasks/packages.yml @@ -55,13 +55,12 @@ - name: install common packages apt: pkg={{ item }} state={{ pkg_state }} - when: has_apt - with_items: common_packages + with_items: '{{ common_packages }}' tags: [ 'packages', 'common_pkgs' ] - name: Install additional packages, if any apt: pkg={{ item }} state={{ pkg_state }} - with_items: additional_packages + with_items: '{{ additional_packages }}' when: additional_packages is defined tags: [ 'packages', 'common_pkgs', 'additional_packages' ] diff --git a/ubuntu-deb-general/tasks/pubkeys.yml b/ubuntu-deb-general/tasks/pubkeys.yml index 5189511d..5d02ff77 100644 --- a/ubuntu-deb-general/tasks/pubkeys.yml +++ b/ubuntu-deb-general/tasks/pubkeys.yml @@ -2,12 +2,12 @@ # TODO: fetch the keys from ldap - name: various pub ssh keys for users and apps authorized_key: user=root key="{{ item }}" state=present - with_items: root_ssh_keys + with_items: '{{ root_ssh_keys }}' when: manage_root_ssh_keys tags: root_pubkeys - name: Remove obsolete keys from the authorized ones authorized_key: user=root key="{{ item }}" state=absent - with_items: obsolete_root_ssh_keys + with_items: '{{ obsolete_root_ssh_keys }}' when: obsolete_root_ssh_keys is defined tags: root_pubkeys diff --git a/ubuntu-deb-general/tasks/remove-unneeded-pkgs.yml b/ubuntu-deb-general/tasks/remove-unneeded-pkgs.yml index d90e6f18..269b98f7 100644 --- a/ubuntu-deb-general/tasks/remove-unneeded-pkgs.yml +++ b/ubuntu-deb-general/tasks/remove-unneeded-pkgs.yml @@ -1,40 +1,34 @@ --- - name: Remove unneeded base packages apt: pkg={{ item }} state=removed - with_items: cleanup_base_packages + with_items: '{{ cleanup_base_packages }}' when: cleanup_base_packages - tags: - - packages - - pkg_cleanup + tags: [ 'packages', 'pkg_cleanup' ] - name: Remove unneeded X packages apt: pkg={{ item }} state=removed - with_items: x_base_packages_to_remove + with_items: '{{ x_base_packages_to_remove }}' when: cleanup_x_base_packages - tags: - - packages - - pkg_cleanup + tags: [ 'packages', 'pkg_cleanup' ] - name: Remove the nfs packages apt: pkg={{ item }} state=removed - with_items: nfs_packages + with_items: '{{ nfs_packages }}' when: - is_not_precise - cleanup_nfs_packages - tags: - - packages - - pkg_cleanup + tags: [ 'packages', 'pkg_cleanup' ] - name: Remove rpcbind packages apt: pkg={{ item }} state=removed - with_items: rpcbind_packages + with_items: '{{ rpcbind_packages }}' when: - cleanup_rpcbind_packages tags: [ 'packages', 'pkg_cleanup' ] - name: Remove the exim packages apt: name={{ item }} state=removed - with_items: exim_email_server_pkgs + with_items: '{{ exim_email_server_pkgs }}' when: cleanup_exim_email_server tags: [ 'packages', 'pkg_cleanup', 'exim' ]