That will work with task includes, not play includes.
--
Brian Coca
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to ansible-project+unsubscr...@goog
I've done includes for playbooks based on facts typically OS
- name: include OS specific tasks
include: "{{ ansible_os_family|lower }}.yml"
if there was a specifc fact you could use such OS, RAM, CPU, write a custom
module to make that fact. I guess at that point why not target machines
base
Is there an alternative solution to get the behavior I'd like?
-Tristan
On Wednesday, September 21, 2016 at 5:08:35 PM UTC-7, Brian Coca wrote:
>
> playbooks cannot be included conditionally.
>
>
> --
> Brian Coca
>
--
You received this message because you are subscribed to the Google
playbooks cannot be included conditionally.
--
Brian Coca
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to ansible-project+unsubscr...@googlegroups.c
I tried this and it isn't working as expected:
test.yml
---
- include: 1.yml
when: type == '1'
- include: 2.yml
when: type == '2'
1.yml
---
- name: "1"
hosts: localhost
tasks:
- debug: msg="1"
2.yml
---
- name: "2"
hosts: localhost
tasks:
- debug: msg="2"
Command:
ansible-