cat hosts
[web]
nycweb01.company.local
[web:vars]
role="super duper web server"
now get the "role" variable inside the playbook,
- hosts: web
gather_facts: true
tasks:
- name: print Role var
debug: msg={{ role }}
// super duper web server
No comments:
Post a Comment