Skip to content

Instantly share code, notes, and snippets.

@andymotta
Last active August 18, 2022 14:34
Show Gist options
  • Save andymotta/1bfce92cea42594fe7abbbbec74a6605 to your computer and use it in GitHub Desktop.
Save andymotta/1bfce92cea42594fe7abbbbec74a6605 to your computer and use it in GitHub Desktop.
Trigger Jenkins job with Ansible
---
- 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
#!/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