add task if host match
This commit is contained in:
parent
539224f533
commit
c39d7b14db
@ -11,6 +11,7 @@
|
|||||||
# loop_var: install_product
|
# loop_var: install_product
|
||||||
|
|
||||||
vars:
|
vars:
|
||||||
|
host_match: lab-dev-1
|
||||||
install_products:
|
install_products:
|
||||||
- inc1
|
- inc1
|
||||||
- inc2
|
- inc2
|
||||||
@ -20,10 +21,17 @@
|
|||||||
|
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- name: Debug upgrade
|
- name: Debug y0
|
||||||
ansible.builtin.debug:
|
ansible.builtin.debug:
|
||||||
msg: "y0"
|
msg: "y0"
|
||||||
|
|
||||||
|
|
||||||
|
- name: Loop vars if host match
|
||||||
|
when: host_match in inventory_hostname
|
||||||
|
ansible.builtin.debug:
|
||||||
|
msg: "{{ item }}"
|
||||||
|
loop: "{{ install_products }}"
|
||||||
|
|
||||||
# - name: Includes on loop
|
# - name: Includes on loop
|
||||||
# ansible.builtin.include_tasks: "includes/{{ item }}.yml"
|
# ansible.builtin.include_tasks: "includes/{{ item }}.yml"
|
||||||
# loop: "{{ install_products }}"
|
# loop: "{{ install_products }}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user