You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
519 B
22 lines
519 B
2 years ago
|
- hosts: containers
|
||
|
gather_facts: no
|
||
|
serial: 1
|
||
|
strategy: linear
|
||
|
tasks:
|
||
|
- name: include common container role
|
||
|
include_role:
|
||
|
name: container
|
||
|
|
||
|
|
||
|
- name: check if host role exists
|
||
|
stat:
|
||
|
path: "{{ (playbook_dir, 'roles', host_role | d(inventory_hostname), 'tasks/main.yml') | path_join }}"
|
||
|
register: result
|
||
|
delegate_to: localhost
|
||
|
|
||
|
|
||
|
- name: include host role
|
||
|
include_role:
|
||
|
name: "{{ host_role | d(inventory_hostname) }}"
|
||
|
when: result.stat.exists
|