Re: [ansible-project] Jinja template as variable value

2021-05-07 Thread Brian Coca
This won't work as you expect line: "{% set option = item %}{% include 'option.ji2' %}" do this instead line: " {{lookup('template', 'option.j2', template_vars={'option': item}) }} On Fri, May 7, 2021 at 4:13 AM Mario S wrote: > > Thank you for checking it out. > So shouldn't ../templates/optio

Re: [ansible-project] Jinja template as variable value

2021-05-07 Thread Mario S
Thank you for checking it out. So shouldn't ../templates/option.ji2 work? Anyways, I had to move on with the project and now template module is used instead of lineinfile, inside ji2 file include works as expected. Not the most elegant solution but it does the job. piątek, 7 maja 2021 o 08:42:29

Re: [ansible-project] Jinja template as variable value

2021-05-06 Thread Stefan Hornburg (Racke)
On 5/6/21 11:13 AM, Stefan Hornburg (Racke) wrote: > On 5/6/21 10:26 AM, Mario S wrote: >> Hello >> >> I'm trying to use jinja template as value for ansible.builtin.lineinfile >> module >> >> in role task

Re: [ansible-project] Jinja template as variable value

2021-05-06 Thread Stefan Hornburg (Racke)
On 5/6/21 10:26 AM, Mario S wrote: > Hello > > I'm trying to use jinja template as value for ansible.builtin.lineinfile > module > > in role task. > > named > ├── tasks > │   ├── config.yml > │   ├── ma

[ansible-project] Jinja template as variable value

2021-05-06 Thread Mario S
Hello I'm trying to use jinja template as value for ansible.builtin.lineinfile module in role task. named ├── tasks │ ├── config.yml │ ├── main.yml ├── templates │ ├── option.ji2 │ ├── view