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