vars demo completed
This commit is contained in:
13
playbooks/var_playbook.yml
Normal file
13
playbooks/var_playbook.yml
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
- hosts: labservers
|
||||
vars:
|
||||
inv_file: /home/cloud_user/vars/inv.txt
|
||||
tasks:
|
||||
- name: create file
|
||||
file:
|
||||
path: "{{inv_file}}"
|
||||
state: touch
|
||||
- name: generate inventory
|
||||
lineinfile:
|
||||
path: "{{inv_file}}"
|
||||
line: "{{ groups['labservers']|join(' ') }}"
|
||||
Reference in New Issue
Block a user