From e45c72de4dc326f679b13359a64c91df9a3608f1 Mon Sep 17 00:00:00 2001 From: Emiliano Vavassori Date: Mon, 18 Nov 2019 22:49:41 +0100 Subject: [PATCH 1/4] Updating roles for recent versions of Ansible. --- roles/base/tasks/desktop-environment.yml | 2 +- roles/client/tasks/epoptes.yml | 10 +++++----- roles/domain/tasks/domain_join.yml | 2 +- roles/domain/tasks/glib2.yml | 2 +- roles/domain/tasks/ntp.yml | 2 +- roles/domain/tasks/pkgs.yml | 2 +- roles/domain/tasks/smb_config.yml | 4 ++-- roles/domain/tasks/sslproxy.yml | 2 +- roles/prereq/tasks/repos.yml | 8 ++++---- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/roles/base/tasks/desktop-environment.yml b/roles/base/tasks/desktop-environment.yml index 878ee60..a7abda1 100644 --- a/roles/base/tasks/desktop-environment.yml +++ b/roles/base/tasks/desktop-environment.yml @@ -10,7 +10,7 @@ - name: Installation of the desktop environment shell: "DEBIAN_FRONTEND=noninteractive /usr/bin/apt-get -y install edubuntu-desktop-gnome^" - when: check_edubuntu_pkg|changed + when: check_edubuntu_pkg is changed tags: edu-install - name: Change default desktop environment diff --git a/roles/client/tasks/epoptes.yml b/roles/client/tasks/epoptes.yml index f015e07..1560505 100644 --- a/roles/client/tasks/epoptes.yml +++ b/roles/client/tasks/epoptes.yml @@ -10,27 +10,27 @@ - name: Checking for a correct name shell: cat /tmp/epoptes-srv register: epo_srv_name - when: get_epo_srv_name|changed + when: get_epo_srv_name is changed changed_when: "'none' not in epo_srv_name.stdout" - name: Cleanup file: path: /tmp/epoptes-srv state: absent - when: get_epo_srv_name|changed + when: get_epo_srv_name is changed - name: Ensuring epoptes-client is installed apt: name: epoptes-client state: present - when: get_epo_srv_name|changed + when: get_epo_srv_name is changed - name: Configuring the client replace: dest: /etc/default/epoptes-client regexp: "^#SERVER=server" replace: "SERVER={{ epo_srv_name.stdout }}" - when: epo_srv_name|changed + when: epo_srv_name is changed - name: Checking for an already existent certificate file: @@ -41,7 +41,7 @@ - name: Getting the epoptes server certificate shell: /usr/sbin/epoptes-client -c - when: crt_epo_exists|failed + when: crt_epo_exists is failed # I don't notify anymore, hoping that this would be done on first run after # preseed and it should restart because of domain join. #notify: diff --git a/roles/domain/tasks/domain_join.yml b/roles/domain/tasks/domain_join.yml index 82fa057..87314c9 100644 --- a/roles/domain/tasks/domain_join.yml +++ b/roles/domain/tasks/domain_join.yml @@ -9,7 +9,7 @@ - name: Joining domain shell: 'net rpc join -U admin%{{ domainadminpasswd }}' - when: check_domain|changed + when: check_domain is changed register: domainjoin notify: - reboot diff --git a/roles/domain/tasks/glib2.yml b/roles/domain/tasks/glib2.yml index a6f018a..f3dae0d 100644 --- a/roles/domain/tasks/glib2.yml +++ b/roles/domain/tasks/glib2.yml @@ -24,4 +24,4 @@ - name: Recompiling glib2 schemas shell: glib-compile-schemas --strict /usr/share/glib-2.0/schemas/ - when: cfg_glib_users|changed or cfg_glib_mounted|changed or cfg_keyb_layout|changed + when: cfg_glib_users is changed or cfg_glib_mounted is changed or cfg_keyb_layout is changed diff --git a/roles/domain/tasks/ntp.yml b/roles/domain/tasks/ntp.yml index bb69ae0..4a76160 100644 --- a/roles/domain/tasks/ntp.yml +++ b/roles/domain/tasks/ntp.yml @@ -26,4 +26,4 @@ - name: Restarting NTP service shell: service ntp restart - when: cfg_ntp|changed + when: cfg_ntp is changed diff --git a/roles/domain/tasks/pkgs.yml b/roles/domain/tasks/pkgs.yml index 62abc9e..62898ed 100644 --- a/roles/domain/tasks/pkgs.yml +++ b/roles/domain/tasks/pkgs.yml @@ -20,7 +20,7 @@ #- name: Downgrading SAMBA if not the right version # shell: "/var/lib/{{ ansible_local.domain.domainfull }}/bin/downgrade_samba.sh" -# when: check_samba_version|changed +# when: check_samba_version is changed # #- name: Checking again for the correct SAMBA version # shell: dpkg -l | grep libsmbclient diff --git a/roles/domain/tasks/smb_config.yml b/roles/domain/tasks/smb_config.yml index b13b693..6bbe316 100644 --- a/roles/domain/tasks/smb_config.yml +++ b/roles/domain/tasks/smb_config.yml @@ -17,11 +17,11 @@ - name: SAMBA restart shell: /sbin/restart smbd - when: cfg_samba|changed + when: cfg_samba is changed - name: Winbind restart shell: /sbin/restart winbind - when: cfg_samba|changed + when: cfg_samba is changed - name: Creating home base file: diff --git a/roles/domain/tasks/sslproxy.yml b/roles/domain/tasks/sslproxy.yml index 7cb6372..16a4ec7 100644 --- a/roles/domain/tasks/sslproxy.yml +++ b/roles/domain/tasks/sslproxy.yml @@ -18,7 +18,7 @@ - name: Adding certificates to the ones used by the system shell: update-ca-certificates - when: proxycrt_dwnl|changed + when: proxycrt_dwnl is changed - name: Firefox settings to include certificate get_url: diff --git a/roles/prereq/tasks/repos.yml b/roles/prereq/tasks/repos.yml index 1a97a5e..453de83 100644 --- a/roles/prereq/tasks/repos.yml +++ b/roles/prereq/tasks/repos.yml @@ -15,7 +15,7 @@ - name: Installing libreoffice PPA GPG key shell: apt-key adv --keyserver keyserver.ubuntu.com --recv 1378B444 - when: check_gpg_libreoffice|failed + when: check_gpg_libreoffice is failed - name: Checking for ansible PPA GPG key shell: apt-key list | grep -q 7BB9C367 @@ -24,7 +24,7 @@ - name: Installing ansible PPA GPG key shell: apt-key adv --keyserver keyserver.ubuntu.com --recv 7BB9C367 - when: check_gpg_ansible|failed + when: check_gpg_ansible is failed - name: Checking for epoptes PPA GPG key shell: apt-key list | grep -q 0350B375 @@ -33,7 +33,7 @@ - name: Installing epoptes PPA GPG key shell: apt-key adv --keyserver keyserver.ubuntu.com --recv 0350B375 - when: check_gpg_epoptes|failed + when: check_gpg_epoptes is failed - name: Checking for geogebra GPG key shell: apt-key list | grep -q 83A736CF @@ -42,7 +42,7 @@ - name: Installing geogebra GPG key shell: apt-key adv --keyserver keyserver.ubuntu.com --recv 83A736CF - when: check_gpg_geogebra|failed + when: check_gpg_geogebra is failed - name: Removing old repositories (if present) file: -- 2.47.2 From 099af709256bfb5c5c90240e52fefe6743f663e1 Mon Sep 17 00:00:00 2001 From: Emiliano Vavassori Date: Mon, 18 Nov 2019 23:47:10 +0100 Subject: [PATCH 2/4] Update roles for warnings in newer version of Ansible. --- roles/base/tasks/packages.yml | 20 +++++++------------- roles/custom/tasks/unattended-upgrades.yml | 7 +++---- roles/networkpackagemanager/tasks/npm.yml | 8 ++++---- roles/prereq/tasks/fixes.yml | 2 ++ 4 files changed, 16 insertions(+), 21 deletions(-) diff --git a/roles/base/tasks/packages.yml b/roles/base/tasks/packages.yml index a20926b..1824849 100644 --- a/roles/base/tasks/packages.yml +++ b/roles/base/tasks/packages.yml @@ -15,25 +15,22 @@ - name: Removing packages commonly not required apt: - pkg: '{{ item }}' + pkg: "{{ base_common_delpkg }}" state: absent purge: yes - with_items: "{{ base_common_delpkg }}" - name: Removing packages from client machines apt: - pkg: '{{ item }}' + pkg: "{{ base_client_delpkg }}" state: absent purge: yes - with_items: "{{ base_client_delpkg }}" when: ansible_local.noderole.role == 'client' and base_client_delpkg|length > 0 - name: Removing packages from docenti machines apt: - pkg: '{{ item }}' + pkg: "{{ base_docenti_delpkg }}" state: absent purge: yes - with_items: "{{ base_docenti_delpkg }}" when: ansible_local.noderole.role == 'docenti' and base_docenti_delpkg|length > 0 - name: Cleanup of unneeded packages @@ -43,21 +40,18 @@ - name: Installing additional common packages apt: - pkg: '{{ item }}' - state: installed - with_items: "{{ base_common_addpkg }}" + pkg: "{{ base_common_addpkg }}" + state: present tags: edu-install - name: Installing additional packages for client role apt: - pkg: '{{ item }}' + pkg: "{{ base_client_addpkg }}" state: present - with_items: "{{ base_client_addpkg }}" when: ansible_local.noderole.role == 'client' and base_client_addpkg|length > 0 - name: Installing additional packages for docenti role apt: - pkg: '{{ item }}' + pkg: "{{ base_docenti_addpkg }}" state: present - with_items: "{{ base_docenti_addpkg }}" when: ansible_local.noderole.role == 'docenti' and base_docenti_addpkg|length > 0 diff --git a/roles/custom/tasks/unattended-upgrades.yml b/roles/custom/tasks/unattended-upgrades.yml index bc31daa..7724b01 100644 --- a/roles/custom/tasks/unattended-upgrades.yml +++ b/roles/custom/tasks/unattended-upgrades.yml @@ -2,11 +2,10 @@ - name: Ensure needed packages are installed apt: - name: "{{ item }}" + name: + - unattended-upgrades + - update-notifier-common state: present - with_items: - - unattended-upgrades - - update-notifier-common - name: Configuring unattended upgrades from file copy: diff --git a/roles/networkpackagemanager/tasks/npm.yml b/roles/networkpackagemanager/tasks/npm.yml index 1316a33..053ea51 100644 --- a/roles/networkpackagemanager/tasks/npm.yml +++ b/roles/networkpackagemanager/tasks/npm.yml @@ -7,18 +7,18 @@ - name: Installing packages for specific role from NetworkPackageManager apt: - name: '{{ item }}' + name: "{{ ansible_local.noderole.addpkg }}" state: present - with_items: "{{ ansible_local.noderole.addpkg }}" when: ansible_local.noderole.addpkg is defined and ansible_local.noderole.addpkg|join(' ')|trim != '' - name: Removing packages for specific role from NetworkPackageManager apt: - name: '{{ item }}' + name: "{{ ansible_local.noderole.delpkg }}" state: absent purge: yes - with_items: "{{ ansible_local.noderole.delpkg }}" when: ansible_local.noderole.delpkg is defined and ansible_local.noderole.delpkg|join(' ')|trim != '' - name: Updating local hash for packages shell: 'rm -f {{ ansible_local.checksum.pkgver_file }} && echo "{{ ansible_local.checksum.pkgver }}" > {{ ansible_local.checksum.pkgver_file }}' + args: + warn: false diff --git a/roles/prereq/tasks/fixes.yml b/roles/prereq/tasks/fixes.yml index 815be1b..61c322b 100644 --- a/roles/prereq/tasks/fixes.yml +++ b/roles/prereq/tasks/fixes.yml @@ -15,4 +15,6 @@ - name: Applying local signed fixes shell: "/usr/bin/curl -sSL http://{{ ansible_local.domain.serverfqdn }}/ks/fixes/{{ item }} | /usr/bin/gpg --passphrase {{ domainadminpasswd }} --decrypt | sudo /bin/bash" + args: + warn: false with_items: "{{ ansible_local.domain.apply_fixes|default([]) }}" -- 2.47.2 From b40ddd873b35255bcd6cc391d9798ae36774652f Mon Sep 17 00:00:00 2001 From: Emiliano Vavassori Date: Tue, 19 Nov 2019 00:10:53 +0100 Subject: [PATCH 3/4] Other updates to role to cope with warnings in newer Ansible versions. --- roles/base/tasks/packages.yml | 2 ++ roles/domain/tasks/audio.yml | 2 ++ roles/domain/tasks/cleanup.yml | 2 ++ roles/domain/tasks/pkgs.yml | 7 +++---- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/roles/base/tasks/packages.yml b/roles/base/tasks/packages.yml index 1824849..b0fb28b 100644 --- a/roles/base/tasks/packages.yml +++ b/roles/base/tasks/packages.yml @@ -35,6 +35,8 @@ - name: Cleanup of unneeded packages shell: apt-get -y autoremove + args: + warn: false register: autoremove changed_when: "'Rimozione' in autoremove.stdout" diff --git a/roles/domain/tasks/audio.yml b/roles/domain/tasks/audio.yml index 25a6082..fa9cf98 100644 --- a/roles/domain/tasks/audio.yml +++ b/roles/domain/tasks/audio.yml @@ -28,6 +28,8 @@ - name: Disabling pulseaudio startup on lightdm shell: chmod -x /usr/bin/start-pulseaudio-x11 + args: + warn: false - name: Removing old (and not-working) approach file: diff --git a/roles/domain/tasks/cleanup.yml b/roles/domain/tasks/cleanup.yml index 582d696..c2b0e88 100644 --- a/roles/domain/tasks/cleanup.yml +++ b/roles/domain/tasks/cleanup.yml @@ -7,3 +7,5 @@ # Correctly managing ansible-pull runs. - name: Updating local version for repo shell: 'rm -f {{ ansible_local.checksum.repover_file }} && echo "{{ ansible_local.checksum.repover }}" > {{ ansible_local.checksum.repover_file }}' + args: + warn: false diff --git a/roles/domain/tasks/pkgs.yml b/roles/domain/tasks/pkgs.yml index 62898ed..502b0e5 100644 --- a/roles/domain/tasks/pkgs.yml +++ b/roles/domain/tasks/pkgs.yml @@ -29,8 +29,7 @@ - name: Installing domain packages apt: - pkg: '{{ item }}' + pkg: + - winbind + - samba state: present - with_items: - - winbind - - samba -- 2.47.2 From 0627995279e15ad42b36d054f5458fec3a795f6f Mon Sep 17 00:00:00 2001 From: Emiliano Vavassori Date: Wed, 22 Feb 2017 01:13:29 +0100 Subject: [PATCH 4/4] Correcting domainpwd.vault. --- domainpwd.vault | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/domainpwd.vault b/domainpwd.vault index c2663ea..eeab21e 100644 --- a/domainpwd.vault +++ b/domainpwd.vault @@ -1,7 +1,7 @@ $ANSIBLE_VAULT;1.1;AES256 -34656463636239626332366464373337386539643933653433653362613238666330636334323465 -6666373739386430643330666238366237646365623634370a363530303762373036616332313966 -31343339373532346538393164373037396135633631653133663862316161373566633938386234 -6366613030386432320a313262383838663262373037643138616131343337626234306436323462 -64333262663662353836303365316433353463326664623838353339376164313235363339313238 -3865613230306436346365623338366564346633343565623964 +61346634373262366638356239623132393734353135376535653433636137363331646432323438 +3666376430616632613366653463303431313336346166330a616166366330333038666164626663 +62623562333864613537313436323136666336656533346264323730386130316566633432383531 +3338333862626664380a366638656363363663303031646366303964333361646336666134333134 +37383035613166663838373632343061656537326163303831323335333464613964656531383933 +3833343663333130636631643865393933656332616636366263 -- 2.47.2