Inventory file parsing in Copy Module

19 views
Skip to first unread message

Pawan Kumar

unread,
Apr 16, 2021, 5:01:10 AM4/16/21
to Ansible Project
Hi Team,

I want to parse inventory file using ansible playbook to copy ssh public id .
Something like ,contents of inventory file  should be used as source of copy module ... 
---

- host: all

tasks
- name: var file
include_vars:
file: /home/raka/raka.txt
- name: copy
copy:
src: /root/.ssh/$lab4
dest: /home/mp/.ssh/authorized_keys  


 The contents of inventory inventory_file --

lab4=MP04.pub

lab6=MP06.pub

 ---------------------------------------

Please guide .

Thanks 

Reply all
Reply to author
Forward
0 new messages