If `apt_repository` fails when attempting to update the apt cache after adding the repository, and the task is set to retry on failure, the second attempt finds the repository has already been added and so no change is made resulting in no attempt to update the cache. This means the second attempt always succeeds without updating the cache. This can result in the failure to install libmariadbclient-dev.
The following example failures where seen on the stable/pike version of galera_client and galera_server but there may be similar examples in other roles.
If `apt_repository` fails when attempting to update the apt cache after adding the repository, and the task is set to retry on failure, the second attempt finds the repository has already been added and so no change is made resulting in no attempt to update the cache. This means the second attempt always succeeds without updating the cache. This can result in the failure to install libmariadbclien t-dev.
The following example failures where seen on the stable/pike version of galera_client and galera_server but there may be similar examples in other roles.
``` ******* ******* ******* ******* ****** repo_container- 55057f82]
TASK [galera_client : Add galera repo] *******
Friday 16 February 2018 14:42:14 -0600 (0:00:00.713) 0:36:52.759 *******
FAILED - RETRYING: Add galera repo (5 retries left).
ok: [infra1_
TASK [galera_client : Install galera distro packages] ******* ******* ******* ***** repo_container- 55057f82] : FAILED! => {"attempts": 5, "changed": false, "failed": true, "msg": "No package matching 'libmariadbclie nt-dev' is available"}
Friday 16 February 2018 14:42:21 -0600 (0:00:06.969) 0:36:59.729 *******
FAILED - RETRYING: Install galera distro packages (5 retries left).
FAILED - RETRYING: Install galera distro packages (4 retries left).
FAILED - RETRYING: Install galera distro packages (3 retries left).
FAILED - RETRYING: Install galera distro packages (2 retries left).
FAILED - RETRYING: Install galera distro packages (1 retries left).
fatal: [infra1_
```
``` ******* ******* ******* ******* ****** galera_ container- 01038d4c]
TASK [galera_server : Add galera repo] *******
Friday 16 February 2018 14:37:20 -0600 (0:00:00.921) 1:01:47.812 *******
FAILED - RETRYING: Add galera repo (5 retries left).
ok: [infra3_
TASK [galera_server : Add percona repo] ******* ******* ******* ******* ******* ***** galera_ container- 01038d4c]
Friday 16 February 2018 14:37:27 -0600 (0:00:07.075) 1:01:54.888 *******
ok: [infra3_
TASK [galera_server : Preseed galera password(s)] ******* ******* ******* ******* ** galera_ container- 01038d4c] => (item={u'vtype': u'string', u'question': u'mysql- server/ root_password' , u'name': u'mariadb- server- 10.1', u'value': u'***'}) galera_ container- 01038d4c] => (item={u'vtype': u'string', u'question': u'mysql- server/ root_password_ again', u'name': u'mariadb- server- 10.1', u'value': u'***'})
Friday 16 February 2018 14:37:28 -0600 (0:00:00.844) 1:01:55.732 *******
changed: [infra3_
changed: [infra3_
TASK [galera_server : Prevent galera from starting on install] ***************** galera_ container- 01038d4c]
Friday 16 February 2018 14:37:29 -0600 (0:00:01.332) 1:01:57.064 *******
changed: [infra3_
TASK [galera_server : Install galera_server role remote packages (apt)] ******** galera_ container- 01038d4c] : FAILED! => {"changed": false, "failed": true, "msg": "No package matching 'libmariadbclie nt-dev' is available"}
Friday 16 February 2018 14:37:30 -0600 (0:00:01.271) 1:01:58.335 *******
fatal: [infra3_
```