Add a task that runs a dist-upgrade on request (need to pass 'dist_upgrade=True' to the playbook.

This commit is contained in:
Andrea Dell'Amico 2018-04-18 15:37:41 +02:00
parent d8b613a7f2
commit 5d1ece1c20
4 changed files with 13 additions and 4 deletions

View File

@ -3,6 +3,7 @@
# Use the apt proxy # Use the apt proxy
# #
use_apt_proxy: False use_apt_proxy: False
dist_upgrade: False
pkg_state: installed pkg_state: installed
common_packages: common_packages:

View File

@ -0,0 +1,6 @@
---
- name: Dist upgrade, if requested
apt: upgrade=dist update_cache=yes cache_valid_time=1800
when: dist_upgrade
tags: [ 'packages', 'upgrade', 'dist_upgrade' ]

View File

@ -2,6 +2,8 @@
- import_tasks: apt-proxy.yml - import_tasks: apt-proxy.yml
- import_tasks: resolvconf.yml - import_tasks: resolvconf.yml
when: install_resolvconf when: install_resolvconf
- import_tasks: dist-upgrade.yml
when: dist_upgrade
- import_tasks: packages.yml - import_tasks: packages.yml
- import_tasks: ntp.yml - import_tasks: ntp.yml
- import_tasks: remove-unneeded-pkgs.yml - import_tasks: remove-unneeded-pkgs.yml

View File

@ -1,11 +1,11 @@
--- ---
- name: Install the basic packages - name: Install the basic packages
apt: pkg={{ item }} state=installed apt: pkg={{ item }} state=installed update_cache=yes cache_valid_time=1800
with_items: '{{ default_python_packages }}' with_items: '{{ default_python_packages }}'
tags: packages tags: packages
- name: Install software-properties-common if needed - name: Install software-properties-common if needed
apt: pkg=software-properties-common state=installed apt: pkg=software-properties-common state=installed update_cache=yes cache_valid_time=1800
when: is_ubuntu when: is_ubuntu
tags: packages tags: packages
@ -88,12 +88,12 @@
tags: packages tags: packages
- name: install common packages - name: install common packages
apt: pkg={{ item }} state={{ pkg_state }} apt: pkg={{ item }} state={{ pkg_state }} update_cache=yes cache_valid_time=1800
with_items: '{{ common_packages }}' with_items: '{{ common_packages }}'
tags: [ 'packages', 'common_pkgs' ] tags: [ 'packages', 'common_pkgs' ]
- name: Install additional packages, if any - name: Install additional packages, if any
apt: pkg={{ item }} state={{ pkg_state }} apt: pkg={{ item }} state={{ pkg_state }} update_cache=yes cache_valid_time=1800
with_items: '{{ additional_packages | default([]) }}' with_items: '{{ additional_packages | default([]) }}'
tags: [ 'packages', 'common_pkgs', 'additional_packages' ] tags: [ 'packages', 'common_pkgs', 'additional_packages' ]