1
0
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_base.git synced 2024-08-16 14:29:50 +02:00

Optionally upgrade all packages

This commit is contained in:
Lilian Roller 2019-04-30 09:41:57 +02:00
parent ae55b6f7f9
commit 582702c29a
No known key found for this signature in database
GPG key ID: 5215C3441797AB2B
2 changed files with 20 additions and 6 deletions

View file

@ -34,3 +34,4 @@ fedora_packages:
- mtr - mtr
- libselinux-python - libselinux-python
upgrade_packages_to_latest_version: false

View file

@ -4,7 +4,7 @@
become: yes become: yes
apt: apt:
package: "{{ base_packages }}" package: "{{ base_packages }}"
state: latest state: present
update_cache: yes update_cache: yes
cache_valid_time: 43200 cache_valid_time: 43200
when: when:
@ -14,7 +14,7 @@
become: yes become: yes
apt: apt:
package: "{{ debian_packages }}" package: "{{ debian_packages }}"
state: latest state: present
update_cache: yes update_cache: yes
cache_valid_time: 43200 cache_valid_time: 43200
when: when:
@ -24,7 +24,7 @@
become: yes become: yes
package: package:
name: "{{ base_packages }}" name: "{{ base_packages }}"
state: latest state: present
when: when:
ansible_distribution != 'Debian' ansible_distribution != 'Debian'
@ -32,7 +32,7 @@
become: yes become: yes
package: package:
name: "{{ fedora_packages }}" name: "{{ fedora_packages }}"
state: latest state: present
when: when:
ansible_distribution == 'Fedora' ansible_distribution == 'Fedora'
@ -43,12 +43,11 @@
- debian-goodies - debian-goodies
- apt-dater-host - apt-dater-host
- apt-transport-https - apt-transport-https
state: latest state: present
update_cache: yes update_cache: yes
cache_valid_time: 43200 cache_valid_time: 43200
when: ansible_distribution == 'Debian' when: ansible_distribution == 'Debian'
- name: Remove rpcbind, nfs-common - name: Remove rpcbind, nfs-common
become: yes become: yes
package: package:
@ -57,4 +56,18 @@
- nfs-common - nfs-common
state: absent state: absent
- name: APTITUDE is required
become: yes
package:
name:
- aptitude
state: present
when: ansible_os_family == 'Debian'
- name: Upgrade all packages to latest
become: true
package:
name: "*"
state: latest
when:
- upgrade_packages_to_latest_version