Last active
August 18, 2022 14:34
-
-
Save andymotta/1bfce92cea42594fe7abbbbec74a6605 to your computer and use it in GitHub Desktop.
Trigger Jenkins job with Ansible
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: trigger jenkins job | |
shell: "{{ lookup('template', 'trigger-jenkins.j2') }}" | |
delegate_to: localhost | |
- name: wait for job to complete | |
wait_for: | |
path: {{ lockfile }} | |
timeout: 600 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
curl -k -X POST https://{{ jenkins_instance }}/buildByToken/buildWithParameters/build?job={{ jenkins_job }}\&token={{ jenkins_token }}\&AWS_ACCOUNT_NAME={{ aws_account }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment