Update roles for warnings in newer version of Ansible.

This commit is contained in:
Emiliano Vavassori 2019-11-18 23:47:10 +01:00
parent e45c72de4d
commit 099af70925
4 changed files with 16 additions and 21 deletions

View File

@ -15,25 +15,22 @@
- name: Removing packages commonly not required - name: Removing packages commonly not required
apt: apt:
pkg: '{{ item }}' pkg: "{{ base_common_delpkg }}"
state: absent state: absent
purge: yes purge: yes
with_items: "{{ base_common_delpkg }}"
- name: Removing packages from client machines - name: Removing packages from client machines
apt: apt:
pkg: '{{ item }}' pkg: "{{ base_client_delpkg }}"
state: absent state: absent
purge: yes purge: yes
with_items: "{{ base_client_delpkg }}"
when: ansible_local.noderole.role == 'client' and base_client_delpkg|length > 0 when: ansible_local.noderole.role == 'client' and base_client_delpkg|length > 0
- name: Removing packages from docenti machines - name: Removing packages from docenti machines
apt: apt:
pkg: '{{ item }}' pkg: "{{ base_docenti_delpkg }}"
state: absent state: absent
purge: yes purge: yes
with_items: "{{ base_docenti_delpkg }}"
when: ansible_local.noderole.role == 'docenti' and base_docenti_delpkg|length > 0 when: ansible_local.noderole.role == 'docenti' and base_docenti_delpkg|length > 0
- name: Cleanup of unneeded packages - name: Cleanup of unneeded packages
@ -43,21 +40,18 @@
- name: Installing additional common packages - name: Installing additional common packages
apt: apt:
pkg: '{{ item }}' pkg: "{{ base_common_addpkg }}"
state: installed state: present
with_items: "{{ base_common_addpkg }}"
tags: edu-install tags: edu-install
- name: Installing additional packages for client role - name: Installing additional packages for client role
apt: apt:
pkg: '{{ item }}' pkg: "{{ base_client_addpkg }}"
state: present state: present
with_items: "{{ base_client_addpkg }}"
when: ansible_local.noderole.role == 'client' and base_client_addpkg|length > 0 when: ansible_local.noderole.role == 'client' and base_client_addpkg|length > 0
- name: Installing additional packages for docenti role - name: Installing additional packages for docenti role
apt: apt:
pkg: '{{ item }}' pkg: "{{ base_docenti_addpkg }}"
state: present state: present
with_items: "{{ base_docenti_addpkg }}"
when: ansible_local.noderole.role == 'docenti' and base_docenti_addpkg|length > 0 when: ansible_local.noderole.role == 'docenti' and base_docenti_addpkg|length > 0

View File

@ -2,11 +2,10 @@
- name: Ensure needed packages are installed - name: Ensure needed packages are installed
apt: apt:
name: "{{ item }}" name:
state: present
with_items:
- unattended-upgrades - unattended-upgrades
- update-notifier-common - update-notifier-common
state: present
- name: Configuring unattended upgrades from file - name: Configuring unattended upgrades from file
copy: copy:

View File

@ -7,18 +7,18 @@
- name: Installing packages for specific role from NetworkPackageManager - name: Installing packages for specific role from NetworkPackageManager
apt: apt:
name: '{{ item }}' name: "{{ ansible_local.noderole.addpkg }}"
state: present state: present
with_items: "{{ ansible_local.noderole.addpkg }}"
when: ansible_local.noderole.addpkg is defined and ansible_local.noderole.addpkg|join(' ')|trim != '' when: ansible_local.noderole.addpkg is defined and ansible_local.noderole.addpkg|join(' ')|trim != ''
- name: Removing packages for specific role from NetworkPackageManager - name: Removing packages for specific role from NetworkPackageManager
apt: apt:
name: '{{ item }}' name: "{{ ansible_local.noderole.delpkg }}"
state: absent state: absent
purge: yes purge: yes
with_items: "{{ ansible_local.noderole.delpkg }}"
when: ansible_local.noderole.delpkg is defined and ansible_local.noderole.delpkg|join(' ')|trim != '' when: ansible_local.noderole.delpkg is defined and ansible_local.noderole.delpkg|join(' ')|trim != ''
- name: Updating local hash for packages - name: Updating local hash for packages
shell: 'rm -f {{ ansible_local.checksum.pkgver_file }} && echo "{{ ansible_local.checksum.pkgver }}" > {{ ansible_local.checksum.pkgver_file }}' shell: 'rm -f {{ ansible_local.checksum.pkgver_file }} && echo "{{ ansible_local.checksum.pkgver }}" > {{ ansible_local.checksum.pkgver_file }}'
args:
warn: false

View File

@ -15,4 +15,6 @@
- name: Applying local signed fixes - 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" 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([]) }}" with_items: "{{ ansible_local.domain.apply_fixes|default([]) }}"