Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Use package module to install distro packages
Browse files Browse the repository at this point in the history
Consolidate distro package install tasks into a
single task using the package module and pass
the package list into the name instead of using
a with_items loop.

The minimum Ansible version is raised to 2.2 due to a
known bug [1] in Ansible's apt module which does not
update the cache properly if the cache update and the
install are combined in a single task.

[1] ansible/ansible-modules-core#1497

Change-Id: I5d87e5e5d11bd1dcffb6a6187733f6d8e4e72fbf
  • Loading branch information
Jesse Pretorius committed May 17, 2017
1 parent 20b74b2 commit edd2093
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 30 deletions.
2 changes: 1 addition & 1 deletion meta/main.yml
Expand Up @@ -23,7 +23,7 @@ galaxy_info:
description: "Openstack Monasca"
company: "Internet Solutions"
license: "license (Apache)"
min_ansible_install: 1.9
min_ansible_install: 2.2
platforms:
- name: Ubuntu
versions:
Expand Down
13 changes: 10 additions & 3 deletions tasks/install.yml
Expand Up @@ -16,9 +16,16 @@
# (c) 2016 Donovan Francesco <donovan.francesco@is.co.za>
# (c) 2016 Paul Stevens <paul.stevens@is.co.za>

- include: monasca_install_apt.yml
static: no
when: ansible_pkg_mgr == 'apt'
- name: Install distro packages
package:
name: "{{ monasca_distro_packages }}"
state: "{{ monasca_package_state }}"
update_cache: "{{ (ansible_pkg_mgr == 'apt') | ternary('yes', omit) }}"
cache_valid_time: "{{ (ansible_pkg_mgr == 'apt') | ternary(cache_timeout, omit) }}"
register: install_packages
until: install_packages | success
retries: 5
delay: 2

- name: Create developer mode constraint file
copy:
Expand Down
26 changes: 0 additions & 26 deletions tasks/monasca_install_apt.yml

This file was deleted.

0 comments on commit edd2093

Please sign in to comment.