Skip to content

Instantly share code, notes, and snippets.

@creisor
Created February 15, 2019 22:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save creisor/f9f2773b4b0839423107400dad860bf1 to your computer and use it in GitHub Desktop.
Save creisor/f9f2773b4b0839423107400dad860bf1 to your computer and use it in GitHub Desktop.
This is how you run a playbook within a playbook, and only register change when the "inner playbook" registers a change.
- name: Run AWX Installer
local_action: "command ansible-playbook -i awx_repo/installer/inventory awx_repo/installer/install.yml --limit \"{{ ansible_limit }}\""
become: no
tags:
- awx_deploy
- awx-deploy
- deploy
- install
register: awx_installer_output
changed_when: ((awx_installer_output.stdout_lines[-1] | regex_search('changed=(\\d+)', '\\1'))[0] | int) > 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment