I have the following playbook:
- import_playbook: "infrastructure/infrastructure.yml"
- import_playbook: "application/application.yml"
Inside these playbooks there are other playbooks being invoked, what happens is that in a specific moment one playbook will be executed in the application.yml
pointed to cicd_servers
group, and it will be skipped unintentionally.
See my inventory below:
[cicd_servers]
sig-cicd-01 ansible_connection=local
This playbook in specific is that one below:
---
- hosts: cicd_servers
gather_facts: false
remote_user: ansible
connection: local
roles:
- application/os_setup
- application/jdk_install
- infrastructure/jenkins_install
- infrastructure/maven_install
- infrastructure/scm_install
- infrastructure/soapui_install
- database/sqlplus-install
################### cicd server applications ############
- hosts: cicd_servers
become: true
remote_user: ansible
connection: local
roles:
- application/fmw_cicd_conf
- application/fmw_performance_conf
I don't know why it's skipping only this host, I tried also to remove the parameters ansible_connection=local
from the inventory and connection: local
from the playbook to the DNS Name of the machine, and it doesn't work as well.
Note: If I just play again the same playbook it won't skip these tasks, that is, it only does not work at first attempt.
Note2: If I comment a few playbooks before it, it executes successfully at first attempt, but I need to get it as it should be.
Note3: I'm using ansible 2.9.10 version.
Below I registered 2 outputs with verbose (-vvvv
) to try to identify something, but the output in the part being skipped doesn't say nothing.
output_1 (success)
PLAY [cicd_servers] **********************************************************************************************************************************************************************************
META: ran handlers
Thursday 21 January 2021 13:34:33 +0000 (0:00:21.729) 0:01:55.599 ******
included: /home/ansible/workspace_VFPT/roles/application/os_setup/tasks/infra.yml for sig-cicd-01.mgm.mw.sat.stp.vodafone.pt
Thursday 21 January 2021 13:34:33 +0000 (0:00:00.063) 0:01:55.663 ******
<sig-cicd-01.mgm.mw.sat.stp.vodafone.pt> ESTABLISH SSH CONNECTION FOR USER: ansible
output_2 (failed)
PLAY [cicd_servers] **********************************************************************************************************************************************************************************
PLAY [cicd_servers] **********************************************************************************************************************************************************************************
If you guys have any idea what is causing it, please let me know.
question from:
https://stackoverflow.com/questions/65830294/ansible-skipping-playbook-at-first-attempt-on-multiple-play-playbook-file