Using become on apt-related tasks.

This commit is contained in:
Emiliano Vavassori 2016-02-19 21:32:25 +01:00
parent ae00635194
commit 71c587acf8
14 changed files with 26 additions and 5 deletions

View File

@ -4,6 +4,7 @@
apt:
name: ansible
state: present
become: yes
- name: Updating ansible-pull custom scripts
get_url:

View File

@ -18,3 +18,4 @@
- name: Updating package database
apt: update_cache=yes
become: yes

View File

@ -11,6 +11,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
become: yes
tags: edu-install
- name: Change default desktop environment

View File

@ -7,6 +7,7 @@
state: absent
purge: yes
with_items: "{{ base_common_delpkg }}"
become: yes
- name: Removing packages from client machines
apt:
@ -15,6 +16,7 @@
purge: yes
with_items: "{{ base_client_delpkg }}"
when: ansible_local.noderole.role == 'client' and base_client_delpkg|length > 0
become: yes
- name: Removing packages from docenti machines
apt:
@ -23,11 +25,13 @@
purge: yes
with_items: "{{ base_docenti_delpkg }}"
when: ansible_local.noderole.role == 'docenti' and base_docenti_delpkg|length > 0
become: yes
- name: Cleanup of unneeded packages
shell: apt-get -y autoremove
register: autoremove
changed_when: "'Rimozione' in autoremove.stdout"
become: yes
- name: Installing additional common packages
apt:
@ -35,6 +39,7 @@
state: installed
with_items: "{{ base_common_addpkg }}"
tags: edu-install
become: yes
- name: Installing additional packages for client role
apt:
@ -42,6 +47,7 @@
state: present
with_items: "{{ base_client_addpkg }}"
when: ansible_local.noderole.role == 'client' and base_client_addpkg|length > 0
become: yes
- name: Installing additional packages for docenti role
apt:
@ -49,6 +55,7 @@
state: present
with_items: "{{ base_docenti_addpkg }}"
when: ansible_local.noderole.role == 'docenti' and base_docenti_addpkg|length > 0
become: yes
- name: Correggo NetworkManager per gestire la rete
lineinfile:

View File

@ -2,10 +2,9 @@
# Manage system upgrade
- name: Updating available packages
apt:
update_cache: yes
cache_valid_time: 180
apt: update_cache=yes cache_valid_time=180
become: yes
- name: Upgrading system
apt:
upgrade: full
apt: upgrade=full
become: yes

View File

@ -6,3 +6,4 @@
pkg: virtualbox-guest-dkms
stat: present
when: ansible_product_name == "VirtualBox"
become: yes

View File

@ -5,9 +5,11 @@
name: plymouth-theme-edubuntu-bglug
state: present
force: yes
become: yes
- name: Installing lightdm wallpaper
apt:
name: bglug-artwork
state: present
force: yes
become: yes

View File

@ -7,6 +7,7 @@
with_items:
- unattended-upgrades
- update-notifier-common
become: yes
- name: Configuring unattended upgrades from file
copy:

View File

@ -5,6 +5,7 @@
apt:
name: ntp
state: present
become: yes
- name: Configuring NTP
template:

View File

@ -5,6 +5,7 @@
apt:
name: libpam-winbind
state: present
become: yes
# Leaving them here commented, as they may be needed in the future
# for improvements on login times.

View File

@ -5,6 +5,7 @@
apt:
name: libpam-mount
state: present
become: yes
- name: Configuring pam_mount
template:

View File

@ -8,3 +8,4 @@
with_items:
- winbind
- samba
become: yes

View File

@ -4,6 +4,7 @@
- name: Updating package cache.
apt: update_cache=yes cache_valid_time=180
become: yes
- name: Installing packages for specific role from NetworkPackageManager
apt:
@ -11,6 +12,7 @@
state: present
with_items: "{{ ansible_local.noderole.addpkg }}"
when: ansible_local.noderole.addpkg is defined and ansible_local.noderole.addpkg|join(' ')|trim != ''
become: yes
- name: Removing packages for specific role from NetworkPackageManager
apt:
@ -19,6 +21,7 @@
purge: yes
with_items: "{{ ansible_local.noderole.delpkg }}"
when: ansible_local.noderole.delpkg is defined and ansible_local.noderole.delpkg|join(' ')|trim != ''
become: yes
- name: Updating local hash for packages
shell: 'rm -f {{ ansible_local.checksum.pkgver_file }} && echo "{{ ansible_local.checksum.pkgver }}" > {{ ansible_local.checksum.pkgver_file }}'

View File

@ -19,6 +19,7 @@
apt:
name: python-yaml
state: present
become: yes
- name: Creating facts.d script for the domain settings
copy: