apt module: update_cache=yes does nothing #1497
Comments
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>
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>
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>
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>
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>
Bump, this issue looks like it effects all current v1.9.x versions including v1.9.2-0.1.rc1:
|
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
Hey there, Thanks for the fix :) 👍 Could be nice to also add the default value for |
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>
@Bengrunt I updated the PR to now document that the |
Awesome :) |
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)
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>
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:
It always fails on the first try with saying:
When I start that playbook the second time from that task it succeeds. If I run:
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:
|
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>
Same issue with 1.9.4, running on Mac, with Ubuntu 14.04 instances |
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>
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
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
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
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
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
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
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
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)
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)
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)
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
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
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
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
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
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
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
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)
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)
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)
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)
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)
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
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
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
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
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
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)
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)
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)
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)
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)
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)
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
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
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
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)
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:
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.
The text was updated successfully, but these errors were encountered: