Closed S0b1t closed 1 year ago
Greetings.
Semaphore is also just executing 'ansible-playbook' in the background. So 'Semaphore' can't skip Ansible-tasks. That's not possible.
You mentioned you have modified your playbook. Semaphore will always use the Playbook stored in the configured 'Repository'. ('pandora' in your case) Have you modified the playbook inside this repository? Else Semaphore will not pick-up on the changes. As far as I can tell there is no 'Playbook cache' in use. It will always be executed from the filesystem (as configured).
If you are unsure - the repository configuration would be nice to have.
- AnsibleGuy
Please look at the screenshot again. As you can see in the last picture, the jobs named "check if portainer agent network exists" and "check if portainer_agent container exists" are running (state changed). But on semaphore it skips, whether that causes a problem or not, I don't know. But the task called "Running Portainer agent in Docker container" was completed successfully (status changed) which means the Docker container should be running (but there is no container), correct me if I'm wrong.
This is my repo:
updated: tagging @ansibleguy
Thank you. Can it be that you have 'check_mode' enabled? Because the two tasks 'skipped' are 'ansible.builtin.shell' module-tasks that will be skipped in that mode!
Also just to mention it: Best-practice is that calls to docker should use the 'community.docker' modules instead of shell-commands. (those might support check-mode)
Can it be that you have 'check_mode' enabled? Because the two tasks 'skipped' are 'ansible.builtin.shell' module-tasks that will be skipped in that mode!
You were right, thanks @ansibleguy
What I did ?
I installed semaphore from docs and created a job to install the Portainer agent in a Docker container on my servers.
What did I expect to see?
I was expecting to see Portainer Agent running on Docker Container
What did I see instead?
Container does not run even if the job was completed successfully
This is my job:
Playbook:
portainer_agent_ansible_playbook/vars/main.yml
run_playbook.yml
If I run my playbook with
ansible-playbook run_playbook.yml -K
it works fineGuess
As you can see in the screenshot, the semaphore skips some steps and the sequence is sometimes displayed incorrectly. I changed my playbook many times but the semaphore didn't change the playbook, I mean are there any caches?! I think they are the problem.