Skip to content
This repository has been archived by the owner on May 31, 2023. It is now read-only.

Improve efficiency and resiliency for the installation #40

Merged
merged 6 commits into from
Mar 22, 2018

Conversation

odyssey4me
Copy link
Collaborator

@odyssey4me odyssey4me commented Mar 22, 2018

There are some minor tweaks to how things are done which can improve the efficiency and resiliency of the installation. This PR includes multiple topical patches to implement those.

Jesse Pretorius added 6 commits March 22, 2018 11:06
Given that the role's minimum Ansible version is set
to 2.2 we can assume that the package module is an
action module and the underlying modules are able to
take a package list for the 'name' argument'.

As such, we can pass the package list to the task
which makes the installation slightly more efficient.

Note: This does not work for Ansible 2.1 and earlier.
Given that updating the apt cache/keys is a network operation,
they are prone to transient failures and should therefore
include the use of retries on the task.

However, as noted in [1], if apt_repository fails to update
the apt cache after updating the configuration, retries do
not register there was a change and so no attempt is made
to update the cache by the module on the second attempt.
This failure can result in a failure to install packages.

This change adds an apt module task to update the cache if
the apt_repository tasks or the apt_key tasks register a
change. This means updating the cache will get retried on
failure and no longer fail silently.

The apt cache update is triggered on changes to the apt
repository configuration and to the keys to ensure that the
cache is always using the right config/key conbination.

[1] ansible/ansible#36605
Any task which has the host rely on internet resources
is prone to transient failures. All these tasks now
have retries added to them to reduce the chance of a
transient failure causing the playbook to fail.
It is not necessary to use two tasks with a conditional on
each to achieve the goal of installing using present/lastest
on the package task. Instead we use a ternary filter for the
state argument. This achieves the same goal and is slightly
more efficient in terms of both code and execution.
The Ansible versions tested include 2.2, so this
patch corrects the README to reflect that this
version is included.
Any task which has the host rely on internet resources
is prone to transient failures. The dashboard download
task now has retries implemented to reduce the chance
of a transient failure causing the playbook to fail.
@paulfantom paulfantom merged commit 37b7649 into cloudalchemy:master Mar 22, 2018
@odyssey4me odyssey4me deleted the efficiency-resiliancy branch March 22, 2018 12:31
@lock
Copy link

lock bot commented Mar 25, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants