vars demo completed

This commit is contained in:
Ilgar_Naghiyev
2020-03-05 14:07:37 +01:00
parent 561e8a159a
commit d90120d49f
2 changed files with 42 additions and 2 deletions

View 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(' ') }}"