Hi The information you've provided seems to contain several cases of wheel reinvention. Rather than helping you do that, please explain what you are REALLY looking to achieve. The file names in your example suggest: "configuring a web server". In which case, a few template tasks and a handler might be all you need.
Dick On Sat, 25 Jan 2020 at 00:10, Shifa Shaikh <[email protected]> wrote: > > I use the stat module to read multiple files statistics from each remote > server. > > Thus, I'm able to get the file mode and checksum value of say 3 files on > host1 and 2 files on host2. > > I wish to know what is a good way to create/construct an include_vars file so > that I can easily read back each file's mode and checksum for any given > server? > > I thought of constructing a myvars.yaml as below: > > --- > host1: > name: /tmp/conf/httpd.conf > checksum: 79783482382789273 > mode: 0744 > name: /tmp/conf/extra/httpd.conf > checksum: 112312382789273 > mode: 0754 > > > > host2: > > name: /tmp/conf/httpd.conf > checksum: 89662ff9273 > mode: 0774 > name: /tmp/conf/extra/httpd.conf > checksum: 82094810498 > mode: 0754 > > > I can construct the myvars.yaml as I like but the challenge is how can I read > the values of the individual file name on a given hots? > > Any suggestions for construct myvars.yaml differently and reading individual > file details in a playbook will be of great help. > > Thank you !! > > -- > You received this message because you are subscribed to the Google Groups > "Ansible Project" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/fd96dabf-6ed9-4924-84b5-d855d15f05ff%40googlegroups.com. -- Dick Visser Trust & Identity Service Operations Manager GÉANT -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAL8fbwNAw3ghSnrh7WpyTX1nbq6UyVKxtmEZoA1Yp5Y-3%2BMcsQ%40mail.gmail.com.
