Re: [ansible-project] How to escape single quotes within single quotes in Ansible

2020-02-25 Thread Shifa Shaikh
@Stefan i tried using quote but it does not help. Can you confirm if this is the right way to use quote ? See below: excludefolders: "{{ excludefolders + ' -o -name ' + item | quote | default('') }}" On Wednesday, February 26, 2020 at 12:42:57 PM UTC+5:30, Stefan Hornburg (Racke) wrote: >

Re: [ansible-project] How to escape single quotes within single quotes in Ansible

2020-02-25 Thread Stefan Hornburg (Racke)
On 2/26/20 8:05 AM, Shifa Shaikh wrote: > Below is my playbook: > > | >    -set_fact: >        excludefolders:"{{ excludefolders + ' -o -name ' + item | default('') > }}" >      with_items:"{{ lookup('vars', 'EXCLUDE_' + Layer).split(',') }}" > > >    -debug: >        msg:"excludedfolder is {{

[ansible-project] How to escape single quotes within single quotes in Ansible

2020-02-25 Thread Shifa Shaikh
Below is my playbook: - set_fact: excludefolders: "{{ excludefolders + ' -o -name ' + item | default('') }}" with_items: "{{ lookup('vars', 'EXCLUDE_' + Layer).split(',') }}" - debug: msg: "excludedfolder is {{ excludefolders }}" I get the below output ok: