Re: [ansible-project] Complex process to generate template/lineinfile data?

2021-05-18 Thread Richard Hector
On 18/05/21 2:24 am, Brian Coca wrote: For data manipulation you want to create a filter plugin, you still need to be explicit about the data you feed it. Thanks for that - this is what I've ended up with. There's probably some copy/paste boilerplate that's not needed in my case. Does it lo

Re: [ansible-project] Complex process to generate template/lineinfile data?

2021-05-17 Thread Brian Coca
plugins in general only get the variables they need, vars_plugins are supposed to generate them, not change them, so they get very little access to variables in general. For data manipulation you want to create a filter plugin, you still need to be explicit about the data you feed it. -- ---

Re: [ansible-project] Complex process to generate template/lineinfile data?

2021-05-17 Thread Richard Hector
On 15/05/21 6:39 pm, Richard Hector wrote: Do I need to write a custom plugin of some kind? I'm experimenting with writing a vars plugin, referring to these: https://docs.ansible.com/ansible/latest/dev_guide/developing_plugins.html https://github.com/ansible/ansible/blob/devel/lib/ansible/plug

Re: [ansible-project] Complex process to generate template/lineinfile data?

2021-05-15 Thread Richard Hector
On 15/05/21 6:39 pm, Richard Hector wrote: Any suggestions? Is this stuff reasonable to do with ansible, and a templating language? Do I need to write a custom plugin of some kind? If I had a dynamic inventory, then I could probably generate extra variables at that stage, but that's further

[ansible-project] Complex process to generate template/lineinfile data?

2021-05-14 Thread Richard Hector
Hi all, Well, it's not really that complex, but seems complex to do within the constraints of ansible/jinja. My scenario is that I run dirvish to back up multiple containers on multiple hosts. The containers are backed up via the filesystems on the hosts. The root filesystem of the contain