Skip to content

Instantly share code, notes, and snippets.

@freephile
Created September 1, 2016 21:04
Show Gist options
  • Save freephile/25b8f5fc1ca413bc895d1734a6598cee to your computer and use it in GitHub Desktop.
Save freephile/25b8f5fc1ca413bc895d1734a6598cee to your computer and use it in GitHub Desktop.
include plays in ansible playbook
---
# You can't include plays in plays
# This will FAIL a syntax check / will not execute
- hosts: mw_hosts
name: Install sources, extensions and skins
tasks:
- name: Do Nothing At All
debug: msg="I'm a task"
- include: install_mediawiki.yml
- include: install_extensions.yml
- include: install_skins.yml
# instead, either call ansible-playbook install_wiki.yml install_mediawiki.yml install_extensions.yml ...
# OR, move the includes to the level of an independent play
# This WILL work
- hosts: mw_hosts
name: Install sources, extensions and skins
tasks:
- name: Do Nothing At All
debug: msg="I'm a task"
- include: install_mediawiki.yml
- include: install_extensions.yml
- include: install_skins.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment