0

I've been messing about with templates in my ansible-playbook lately, and it does as intended now: Upload a dynamic config file, and change a few entries in it.

However, this config file is part of a small structure of static files and folders that also need to be uploaded. Is there a way of doing this recursively, while still allowing the aforementioned dynamic config to be altered?

Alternatively, first upload the static config tree, and then use a template for that one dynamic config?

Jarmund
  • 535
  • 2
  • 6
  • 17
  • 1
    i beleave that you need to do template j2 for each file in your structure. and apply it by single playbook. – Рамиль Матрасов Jun 12 '20 at 10:13
  • I think you just need this: https://docs.ansible.com/ansible/latest/plugins/lookup/fileglob.html for your recursive copy needs and this: https://docs.ansible.com/ansible/latest/modules/template_module.html#examples for templating. – Roman Spiak Aug 20 '20 at 00:15

0 Answers0