Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

apt module: update_cache=yes does nothing #1497

Closed
Bengrunt opened this issue Jun 10, 2015 · 9 comments · Fixed by #1517
Closed

apt module: update_cache=yes does nothing #1497

Bengrunt opened this issue Jun 10, 2015 · 9 comments · Fixed by #1517

Comments

@Bengrunt
Copy link

Hello,
I was trying to use the update_cache feature of the apt module to run apt-get update without installing a package. So I've got this basic task:

- name: Updating APT cache
   apt: update_cache=yes

When the task runs, it says 'ok' but the cache isn't updated at all.
There seem to be the same behavior if update_cache=yes is added with an actual package installation.

I'm using ansible v1.9.1 on CentOS 7 to manage hosts running Ubuntu 14.04LTS.

cloudnull added a commit to cloudnull/ansible-modules-core that referenced this issue Jun 14, 2015
This change is in response to issue ansible#1497 where the apt module
would not properly update the apt cache in some situations and
never returned a state change on cache update when the module
was used without an item to be installed or updated.

The change greatly simply updates the cache when `update_cache`
is used without a `cache_valid_time` or when the cache mtime is
> the provided `cache_valid_time`. Additionally if no package,
upgrade, or deb is provided and the apt cache is updated the
module will now return a change state as *True* which will help
users in knwoning that the module functioned as expected.

Signed-off By: Kevin Carter <kevin.carter@rackspace.com>
cloudnull added a commit to cloudnull/ansible-modules-core that referenced this issue Jun 14, 2015
This change is in response to issue ansible#1497 where the apt module
would not properly update the apt cache in some situations and
never returned a state change on cache update when the module
was used without an item to be installed or updated.

The change greatly simply updates the cache when `update_cache`
is used without a `cache_valid_time` or when the cache mtime is
> the provided `cache_valid_time`. Additionally if no package,
upgrade, or deb is provided and the apt cache is updated the
module will now return a change state as *True* which will help
users in knwoning that the module functioned as expected.

Signed-off By: Kevin Carter <kevin.carter@rackspace.com>
cloudnull added a commit to cloudnull/ansible-modules-core that referenced this issue Jun 14, 2015
would not properly update the apt cache in some situations and
never returned a state change on cache update when the module
was used without an item to be installed or updated.

The change simply updates the cache when `update_cache`
is used without a `cache_valid_time` or when the cache mtime is
> the provided `cache_valid_time`. Additionally if no package,
upgrade, or deb is provided and the apt cache is updated the
module will now return a change state as *True* which will help
users in knwoning that the module functioned as expected.

Signed-off By: Kevin Carter <kevin.carter@rackspace.com>
cloudnull added a commit to cloudnull/ansible-modules-core that referenced this issue Jun 14, 2015
would not properly update the apt cache in some situations and
never returned a state change on cache update when the module
was used without an item to be installed or updated.

The change simply updates the cache when `update_cache`
is used without a `cache_valid_time` or when the cache mtime is
> the provided `cache_valid_time` which now has a default of 0.
Additionally if no package, upgrade, or deb is provided and the
apt cache is updated the module will now return a change state
as *True* which will help users in knwoning that the module
functioned as expected.

Signed-off By: Kevin Carter <kevin.carter@rackspace.com>
cloudnull added a commit to cloudnull/ansible-modules-core that referenced this issue Jun 15, 2015
would not properly update the apt cache in some situations and
never returned a state change on cache update when the module
was used without an item to be installed or updated.

The change simply updates the cache when `update_cache`
is used without a `cache_valid_time` or when the cache mtime is
> the provided `cache_valid_time` which now has a default of 0.
Additionally if no package, upgrade, or deb is provided and the
apt cache is updated the module will now return a change state
as *True* which will help users in knwoning that the module
functioned as expected.

Signed-off By: Kevin Carter <kevin.carter@rackspace.com>
@cloudnull
Copy link
Contributor

Bump, this issue looks like it effects all current v1.9.x versions including v1.9.2-0.1.rc1:

  • if p['update_cache']:
    # Default is: always update the cache
    cache_valid = False
    if p['cache_valid_time']:
    tdelta = datetime.timedelta(seconds=p['cache_valid_time'])
    try:
    mtime = os.stat(APT_UPDATE_SUCCESS_STAMP_PATH).st_mtime
    except:
    mtime = False
    if mtime is False:
    # Looks like the update-success-stamp is not available
    # Fallback: Checking the mtime of the lists
    try:
    mtime = os.stat(APT_LISTS_PATH).st_mtime
    except:
    mtime = False
    if mtime is False:
    # No mtime could be read - looks like lists are not there
    # We update the cache to be safe
    cache_valid = False
    else:
    mtimestamp = datetime.datetime.fromtimestamp(mtime)
    if mtimestamp + tdelta >= datetime.datetime.now():
    # dont update the cache
    # the old cache is less than cache_valid_time seconds old - so still valid
    cache_valid = True
    if cache_valid is not True:
    cache.update()
    cache.open(progress=None)
    if not p['package'] and not p['upgrade'] and not p['deb']:
    module.exit_json(changed=False)
  • if p['update_cache']:
    # Default is: always update the cache
    cache_valid = False
    if p['cache_valid_time']:
    tdelta = datetime.timedelta(seconds=p['cache_valid_time'])
    try:
    mtime = os.stat(APT_UPDATE_SUCCESS_STAMP_PATH).st_mtime
    except:
    mtime = False
    if mtime is False:
    # Looks like the update-success-stamp is not available
    # Fallback: Checking the mtime of the lists
    try:
    mtime = os.stat(APT_LISTS_PATH).st_mtime
    except:
    mtime = False
    if mtime is False:
    # No mtime could be read - looks like lists are not there
    # We update the cache to be safe
    cache_valid = False
    else:
    mtimestamp = datetime.datetime.fromtimestamp(mtime)
    if mtimestamp + tdelta >= datetime.datetime.now():
    # dont update the cache
    # the old cache is less than cache_valid_time seconds old - so still valid
    cache_valid = True
    if cache_valid is not True:
    cache.update()
    cache.open(progress=None)
    if not p['package'] and not p['upgrade'] and not p['deb']:
    module.exit_json(changed=False)

openstack-gerrit pushed a commit to openstack/openstack-ansible that referenced this issue Jun 16, 2015
This change adds a specific update task to all tasks that all the
apt ansible module. This change was done to ensure that the cache
is updated as expected when instructed to do so. The reason that
the cache update is being removed from the grouping is because
there is an upstream bug that is effecting the process by which
the apt cache is updated when there is a package list to process
within the same task. The work around to make this function as
expected is to move the update into its own task without a package
list.

Upstream Ansible bug:
  - ansible/ansible-modules-core#1497

Change-Id: Ic06d89a76d772c12888b4bc4bbf147be58b0c150
Related-Bug: 1464771
@Bengrunt
Copy link
Author

Hey there,

Thanks for the fix :) 👍

Could be nice to also add the default value for cache_valid_time in the docs. Was wondering what it was when trying to use it earlier.

cloudnull added a commit to cloudnull/ansible-modules-core that referenced this issue Jun 17, 2015
This change is in response to issue ansible#1497 where the apt module would not
properly updating the apt cache in some situations and never returned a state
change on cache update when the module was used without or without an item to
be installed or upgraded.

The change simply allows the apt module to update the cache when
`update_cache` option is used without or without a set `cache_valid_time`. If
`cache_valid_time` is set and the on disk mtime for apt cache is ">" the
provided amount of seconds, which now has a default of 0, the apt cache will
be updated. Additionally if no upgrade, package, or deb is installed or
changed but the apt cache is updated the module will return a changed state
which will help users to know that the state of the environment has changed
due to a task operation, even if it was only an apt cahce update.

Signed-off By: Kevin Carter <kevin.carter@rackspace.com>
@cloudnull
Copy link
Contributor

@Bengrunt I updated the PR to now document that the cache_valid_time is 0 by default.

@Bengrunt
Copy link
Author

Awesome :)
I think it's gonna help a lot of people.

openstack-gerrit pushed a commit to openstack/openstack-ansible that referenced this issue Jun 17, 2015
This change adds a specific update task to all tasks that all the
apt ansible module. This change was done to ensure that the cache
is updated as expected when instructed to do so. The reason that
the cache update is being removed from the grouping is because
there is an upstream bug that is effecting the process by which
the apt cache is updated when there is a package list to process
within the same task. The work around to make this function as
expected is to move the update into its own task without a package
list.

Upstream Ansible bug:
  - ansible/ansible-modules-core#1497

Change-Id: Ic06d89a76d772c12888b4bc4bbf147be58b0c150
Related-Bug: 1464771
(cherry picked from commit 59381b5)
cloudnull added a commit to cloudnull/ansible-modules-core that referenced this issue Jul 5, 2015
This change is in response to issue ansible#1497 where the apt module would not
properly updating the apt cache in some situations and never returned a state
change on cache update when the module was used without or without an item to
be installed or upgraded.

The change simply allows the apt module to update the cache when
`update_cache` option is used without or without a set `cache_valid_time`. If
`cache_valid_time` is set and the on disk mtime for apt cache is ">" the
provided amount of seconds, which now has a default of 0, the apt cache will
be updated. Additionally if no upgrade, package, or deb is installed or
changed but the apt cache is updated the module will return a changed state
which will help users to know that the state of the environment has changed
due to a task operation, even if it was only an apt cahce update.

Signed-off By: Kevin Carter <kevin.carter@rackspace.com>
@wysekm
Copy link

wysekm commented Sep 24, 2015

Hi,

I have a similar problem in Ansible 1.9.3. When I start a fresh instance in AWS EC2 and try to install packages (Ubuntu 14.04) using:

- name: Install packages
    apt: pkg={{item}} state=present update_cache=True
    with_items:
    - python-virtualenv
    ...

It always fails on the first try with saying:

msg: No package matching 'python-virtualenv' is available

When I start that playbook the second time from that task it succeeds. If I run:

- name: Manually update packages list
    apt: update_caches=True

it does nothing and the package list is not refreshed. The only scenario when refreshing packages works on the first try is when I run it explicitly:

- name: Manually update packages list (problem with update_cache)
    command: apt-get update

@cloudnull
Copy link
Contributor

@wysekm if you don't mind pulling in a patch, this change fixed the issue for us #1517 -- it's currently a pending PR to core.

cloudnull added a commit to cloudnull/ansible-modules-core that referenced this issue Sep 29, 2015
This change is in response to issue ansible#1497 where the apt module would not
properly updating the apt cache in some situations and never returned a state
change on cache update when the module was used without or without an item to
be installed or upgraded.

The change simply allows the apt module to update the cache when
`update_cache` option is used without or without a set `cache_valid_time`. If
`cache_valid_time` is set and the on disk mtime for apt cache is ">" the
provided amount of seconds, which now has a default of 0, the apt cache will
be updated. Additionally if no upgrade, package, or deb is installed or
changed but the apt cache is updated the module will return a changed state
which will help users to know that the state of the environment has changed
due to a task operation, even if it was only an apt cahce update.

Signed-off By: Kevin Carter <kevin.carter@rackspace.com>
@FlorinAndrei
Copy link

Same issue with 1.9.4, running on Mac, with Ubuntu 14.04 instances

cloudnull added a commit to cloudnull/ansible-modules-core that referenced this issue Feb 8, 2016
This change is in response to issue ansible#1497 where the apt module would not
properly updating the apt cache in some situations and never returned a state
change on cache update when the module was used without or without an item to
be installed or upgraded.

The change simply allows the apt module to update the cache when
`update_cache` option is used without or without a set `cache_valid_time`. If
`cache_valid_time` is set and the on disk mtime for apt cache is ">" the
provided amount of seconds, which now has a default of 0, the apt cache will
be updated. Additionally if no upgrade, package, or deb is installed or
changed but the apt cache is updated the module will return a changed state
which will help users to know that the state of the environment has changed
due to a task operation, even if it was only an apt cahce update.

Signed-off By: Kevin Carter <kevin.carter@rackspace.com>
cloudnull added a commit to os-cloud/openstack-ansible-os_cinder that referenced this issue Feb 26, 2016
This change adds a specific update task to all tasks that all the
apt ansible module. This change was done to ensure that the cache
is updated as expected when instructed to do so. The reason that
the cache update is being removed from the grouping is because
there is an upstream bug that is effecting the process by which
the apt cache is updated when there is a package list to process
within the same task. The work around to make this function as
expected is to move the update into its own task without a package
list.

Upstream Ansible bug:
  - ansible/ansible-modules-core#1497

Change-Id: Ic06d89a76d772c12888b4bc4bbf147be58b0c150
Related-Bug: 1464771
cloudnull added a commit to os-cloud/openstack-ansible-os_glance that referenced this issue Feb 26, 2016
This change adds a specific update task to all tasks that all the
apt ansible module. This change was done to ensure that the cache
is updated as expected when instructed to do so. The reason that
the cache update is being removed from the grouping is because
there is an upstream bug that is effecting the process by which
the apt cache is updated when there is a package list to process
within the same task. The work around to make this function as
expected is to move the update into its own task without a package
list.

Upstream Ansible bug:
  - ansible/ansible-modules-core#1497

Change-Id: Ic06d89a76d772c12888b4bc4bbf147be58b0c150
Related-Bug: 1464771
cloudnull added a commit to os-cloud/openstack-ansible-os_heat that referenced this issue Feb 26, 2016
This change adds a specific update task to all tasks that all the
apt ansible module. This change was done to ensure that the cache
is updated as expected when instructed to do so. The reason that
the cache update is being removed from the grouping is because
there is an upstream bug that is effecting the process by which
the apt cache is updated when there is a package list to process
within the same task. The work around to make this function as
expected is to move the update into its own task without a package
list.

Upstream Ansible bug:
  - ansible/ansible-modules-core#1497

Change-Id: Ic06d89a76d772c12888b4bc4bbf147be58b0c150
Related-Bug: 1464771
cloudnull added a commit to os-cloud/openstack-ansible-os_horizon that referenced this issue Feb 26, 2016
This change adds a specific update task to all tasks that all the
apt ansible module. This change was done to ensure that the cache
is updated as expected when instructed to do so. The reason that
the cache update is being removed from the grouping is because
there is an upstream bug that is effecting the process by which
the apt cache is updated when there is a package list to process
within the same task. The work around to make this function as
expected is to move the update into its own task without a package
list.

Upstream Ansible bug:
  - ansible/ansible-modules-core#1497

Change-Id: Ic06d89a76d772c12888b4bc4bbf147be58b0c150
Related-Bug: 1464771
cloudnull added a commit to os-cloud/openstack-ansible-os_neutron that referenced this issue Feb 26, 2016
This change adds a specific update task to all tasks that all the
apt ansible module. This change was done to ensure that the cache
is updated as expected when instructed to do so. The reason that
the cache update is being removed from the grouping is because
there is an upstream bug that is effecting the process by which
the apt cache is updated when there is a package list to process
within the same task. The work around to make this function as
expected is to move the update into its own task without a package
list.

Upstream Ansible bug:
  - ansible/ansible-modules-core#1497

Change-Id: Ic06d89a76d772c12888b4bc4bbf147be58b0c150
Related-Bug: 1464771
cloudnull added a commit to os-cloud/openstack-ansible-os_nova that referenced this issue Feb 26, 2016
This change adds a specific update task to all tasks that all the
apt ansible module. This change was done to ensure that the cache
is updated as expected when instructed to do so. The reason that
the cache update is being removed from the grouping is because
there is an upstream bug that is effecting the process by which
the apt cache is updated when there is a package list to process
within the same task. The work around to make this function as
expected is to move the update into its own task without a package
list.

Upstream Ansible bug:
  - ansible/ansible-modules-core#1497

Change-Id: Ic06d89a76d772c12888b4bc4bbf147be58b0c150
Related-Bug: 1464771
cloudnull added a commit to os-cloud/openstack-ansible-os_swift that referenced this issue Feb 26, 2016
This change adds a specific update task to all tasks that all the
apt ansible module. This change was done to ensure that the cache
is updated as expected when instructed to do so. The reason that
the cache update is being removed from the grouping is because
there is an upstream bug that is effecting the process by which
the apt cache is updated when there is a package list to process
within the same task. The work around to make this function as
expected is to move the update into its own task without a package
list.

Upstream Ansible bug:
  - ansible/ansible-modules-core#1497

Change-Id: Ic06d89a76d772c12888b4bc4bbf147be58b0c150
Related-Bug: 1464771
openstack-gerrit pushed a commit to openstack/openstack-ansible-os_neutron that referenced this issue Apr 26, 2017
The update of the apt cache and the package installation
can all be handled in a single task by providing the
package action plugin with the right parameters. This
removes an extra task to optimise execution.

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: I69970a3a76e6ac56095d0077c31f811d717d9216
(cherry picked from commit 9d43b6f)
openstack-gerrit pushed a commit to openstack/openstack-ansible-os_keystone that referenced this issue Apr 26, 2017
The update of the apt cache and the package installation
can all be handled in a single task by providing the
package action plugin with the right parameters. This
removes an extra task to optimise execution.

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: If6b3261bba643759f12a811d849ce9cb1040497f
(cherry picked from commit 0b11c78)
openstack-gerrit pushed a commit to openstack/openstack-ansible-os_swift that referenced this issue Apr 26, 2017
The update of the apt cache and the package installation
can all be handled in a single task by providing the
package action plugin with the right parameters. This
removes an extra task to optimise execution.

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: I532d866286d4cb885e1f3696819455cbdc8c0c39
(cherry picked from commit 49c3e0b)
openstack-gerrit pushed a commit to openstack/openstack-ansible-ceph_client that referenced this issue May 3, 2017
Consolidate distro package install tasks into a
single task using the package module.

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: I8f4ed2a836b118080bf4698786caab7847f6e799
openstack-gerrit pushed a commit to openstack/openstack-ansible-os_heat that referenced this issue May 3, 2017
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: I9aabf53e75dbe60bf634a8113bf11f3574b1285e
openstack-gerrit pushed a commit to openstack/openstack-ansible-os_cloudkitty that referenced this issue May 3, 2017
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: Id00e704fd89f5dc40a143a9567c859ba78b76668
openstack-gerrit pushed a commit to openstack/openstack-ansible-os_magnum that referenced this issue May 3, 2017
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

Also:
- add license boilerplate to meta file

Change-Id: I8ce52d62acc900d1c45e57ef42e5a2e11fd1db9b
openstack-gerrit pushed a commit to openstack/openstack-ansible-os_barbican that referenced this issue May 3, 2017
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

Also:
- remove unused travis configuration file
- move release note to the proper location
- add license boilerplate to meta file

Change-Id: Ibc2d96a48f156f19235df8b7a25d59d433c3aad5
openstack-gerrit pushed a commit to openstack/openstack-ansible-os_gnocchi that referenced this issue May 3, 2017
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

Also:
- add license boilerplate to meta file

Change-Id: I0d98c4b7bfbc8fe1bd7c8d1e2b83415f1842fd58
openstack-gerrit pushed a commit to openstack-archive/openstack-ansible-repo_build that referenced this issue May 3, 2017
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 lxc package is no longer a dependency of lxc-dev, so the task to
override lxc-net is no longer necessary and would not effect a systemd
service anyway.

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: I0b1b5e5413aa3d4496f15f64e3673f4229bbe237
openstack-gerrit pushed a commit to openstack/openstack-ansible-ceph_client that referenced this issue May 4, 2017
Consolidate distro package install tasks into a
single task using the package module.

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: I8f4ed2a836b118080bf4698786caab7847f6e799
(cherry picked from commit 8ce2ae1)
openstack-gerrit pushed a commit to openstack/openstack-ansible-os_cloudkitty that referenced this issue May 4, 2017
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: Id00e704fd89f5dc40a143a9567c859ba78b76668
(cherry picked from commit f97d970)
openstack-gerrit pushed a commit to openstack/openstack-ansible-os_barbican that referenced this issue May 4, 2017
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

Also:
- remove unused travis configuration file
- move release note to the proper location
- add license boilerplate to meta file

Change-Id: Ibc2d96a48f156f19235df8b7a25d59d433c3aad5
(cherry picked from commit 7f399d3)
openstack-gerrit pushed a commit to openstack/openstack-ansible-os_heat that referenced this issue May 4, 2017
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: I9aabf53e75dbe60bf634a8113bf11f3574b1285e
(cherry picked from commit b1721a7)
openstack-gerrit pushed a commit to openstack/openstack-ansible-os_magnum that referenced this issue May 4, 2017
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

Also:
- add license boilerplate to meta file

Change-Id: I8ce52d62acc900d1c45e57ef42e5a2e11fd1db9b
(cherry picked from commit 965e4c0)
openstack-gerrit pushed a commit to openstack/openstack-ansible-os_designate that referenced this issue May 4, 2017
The update of the apt cache and the package installation
can all be handled in a single task by providing the
package action plugin with the right parameters. This
removes an extra task to optimise execution.

Also, Ansible 2.x allows the package module to consume
the package list in the name parameter instead of using
a with_items loop which further optimises the execution.

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: I51d051e1bd10a98e868afba4e11bd01c9d09c7a3
openstack-gerrit pushed a commit to openstack/openstack-ansible-os_rally that referenced this issue May 5, 2017
Consolidate distro package install tasks into a
single task using the package module. Tidy up
some other tasks to reduce task file sprawl and
consolidate some task actions.

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: I95e02c2786b3a21b6188a5930fb827b6ab04fadb
openstack-gerrit pushed a commit to openstack/openstack-ansible-os_horizon that referenced this issue May 5, 2017
The update of the apt cache and the package installation
can all be handled in a single task by providing the
package action plugin with the right parameters. This
removes an extra task to optimise execution.

Also, Ansible 2.x allows the package module to consume
the package list in the name parameter instead of using
a with_items loop which further optimises the execution.

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: Ia15e468a70f1ac90d8b7ce88f930f81e01afa3d4
openstack-gerrit pushed a commit to openstack/openstack-ansible-os_ironic that referenced this issue May 5, 2017
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: I4fb65f7a03364bac696e63f325c936e730deba7e
openstack-gerrit pushed a commit to openstack/openstack-ansible-haproxy_server that referenced this issue May 5, 2017
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. Tidy up some other tasks to
reduce task file sprawl and consolidate some
task actions.

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: I3717867208f1c379f0eda74e19c064a4b697cc53
openstack-gerrit pushed a commit to openstack/openstack-ansible-os_horizon that referenced this issue May 5, 2017
The update of the apt cache and the package installation
can all be handled in a single task by providing the
package action plugin with the right parameters. This
removes an extra task to optimise execution.

Also, Ansible 2.x allows the package module to consume
the package list in the name parameter instead of using
a with_items loop which further optimises the execution.

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: Ia15e468a70f1ac90d8b7ce88f930f81e01afa3d4
(cherry picked from commit c35cacb)
openstack-gerrit pushed a commit to openstack/openstack-ansible-os_rally that referenced this issue May 8, 2017
Consolidate distro package install tasks into a
single task using the package module. Tidy up
some other tasks to reduce task file sprawl and
consolidate some task actions.

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: I95e02c2786b3a21b6188a5930fb827b6ab04fadb
(cherry picked from commit fdc4458)
openstack-gerrit pushed a commit to openstack/openstack-ansible-os_ironic that referenced this issue May 8, 2017
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: I4fb65f7a03364bac696e63f325c936e730deba7e
(cherry picked from commit 3cd2cf5)
openstack-gerrit pushed a commit to openstack-archive/openstack-ansible-repo_build that referenced this issue May 15, 2017
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 lxc package is no longer a dependency of lxc-dev, so the task to
override lxc-net is no longer necessary and would not effect a systemd
service anyway.

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: I0b1b5e5413aa3d4496f15f64e3673f4229bbe237
(cherry picked from commit 9dfb01f)
openstack-gerrit pushed a commit to openstack/openstack-ansible-os_gnocchi that referenced this issue May 15, 2017
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

Also:
- add license boilerplate to meta file

Change-Id: I0d98c4b7bfbc8fe1bd7c8d1e2b83415f1842fd58
(cherry picked from commit 752a834)
openstack-gerrit pushed a commit to openstack/openstack-ansible-haproxy_server that referenced this issue May 16, 2017
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. Tidy up some other tasks to
reduce task file sprawl and consolidate some
task actions.

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: I3717867208f1c379f0eda74e19c064a4b697cc53
(cherry picked from commit ebae945)
openstack-gerrit pushed a commit to openstack-archive/openstack-ansible-os_monasca that referenced this issue May 18, 2017
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
openstack-gerrit pushed a commit to openstack/openstack-ansible-os_octavia that referenced this issue May 18, 2017
Consolidate distro package install tasks into a
single task using the package module. Tidy up
some other tasks to reduce task file sprawl and
consolidate some task actions.

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: I9752dffdb7302d2d76f2cf0c7023cc3535f3fc9f
openstack-gerrit pushed a commit to openstack-archive/openstack-ansible-os_molteniron that referenced this issue May 19, 2017
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

Also:
- split install tasks into pre-install, install and
  post-install tasks and tag them appropriately.

Change-Id: I0c5cc16ba1d82b7fd169156d1890c86614210cad
openstack-gerrit pushed a commit to openstack/openstack-ansible-os_designate that referenced this issue May 22, 2017
The update of the apt cache and the package installation
can all be handled in a single task by providing the
package action plugin with the right parameters. This
removes an extra task to optimise execution.

Also, Ansible 2.x allows the package module to consume
the package list in the name parameter instead of using
a with_items loop which further optimises the execution.

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: I51d051e1bd10a98e868afba4e11bd01c9d09c7a3
(cherry picked from commit c9817c1)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants