Do not run reset_connection meta with buildah

reset_connection is not needed when running container
build with buildah.

reset_conneciton doesn't work[1] with when condition and has
different behavior with different ansible versions:-
- With ansible-2.5.15:- Fatal error
- With ansible-2.7:- Warning

Since the ansible version in RDO zuul is still 2.5 we
need to workaround by moving the meta task to different
play and include it in the main playbook.

[1] https://github.com/ansible/ansible/issues/46275

Change-Id: Id6bbf0da1c504dcf1bb09c9435c92e0f18c7c06b
This commit is contained in:
yatinkarel 2019-05-07 10:49:26 +05:30
parent ba014200bf
commit 2d17ead4a6
2 changed files with 5 additions and 2 deletions

View File

@ -35,8 +35,8 @@
shell: |
ansible-playbook docker-playbook.yaml --extra-vars "container_registry_deployment_user={{ ansible_user }}"
- name: Reset connection because of group changes for current user
meta: reset_connection
- include_tasks: reset_connection.yaml
when: not use_buildah | default(false) | bool
- name: Prepare Buildah
become: true

View File

@ -0,0 +1,3 @@
---
- name: Reset connection because of group changes for current user
meta: reset_connection