Re: [ansible-project] Unable to load variable from include_vars into my playbook

2020-02-25 Thread Shifa Shaikh
It's works. Thank you Stefen On Wed, 26 Feb, 2020, 12:13 am Stefan Hornburg (Racke), wrote: > On 2/24/20 9:52 PM, Dick Visser wrote: > > You can’t resolve variables with names that contain variables > themselves. > > Instead, use a lookup: > > > >

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: >

[ansible-project] Re: remote_src and template_host for template module not working for me

2020-02-25 Thread Janmejaya Swain
Hi , 1. I have multiple json as well as j2 files , Need to generate multiple config files by using template module. 2. In fetch module . fetch the files with including host name in path . How we can avoid this hostname in path ? Ex: - name: fetch tar file from remote to local machine

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:

Re: [ansible-project] set_fact undefined variable issue when concat string to itself.

2020-02-25 Thread Abhijeet Kasurde
You can try this - - set_fact: excludefolders: "{{ excludefolders | default('') + ' -o -name ' + item | default('') }}" with_items: "{{ lookup('vars', 'EXCLUDE_' + Layer).split(',') }}" On Wed, Feb 26, 2020 at 12:00 PM Shifa Shaikh wrote: > I need to set_fact variable and

[ansible-project] set_fact undefined variable issue when concat string to itself.

2020-02-25 Thread Shifa Shaikh
I need to set_fact variable and contact to itself a list of items as below: - set_fact: excludefolders: "{{ excludefolders + ' -o -name ' + item | default('') }}" with_items: "{{ lookup('vars', 'MY_' + Layer).split(',') }}" Getting error: FAILED! => {"msg": "The task

Re: [ansible-project] Re: remote_src and template_host for template module not working for me

2020-02-25 Thread Janmejaya Swain
if ansible controller having no rsync command , it is showing following error Could not chdir to home directory /home/unixawx: No such file or directory\nbash: rsync: command not found\nrsync: connection unexpectedly closed (0 bytes received so far) [Receiver]\nrsync error: remote command

Re: [ansible-project] Unable to load variable from include_vars into my playbook

2020-02-25 Thread Stefan Hornburg (Racke)
On 2/24/20 9:52 PM, Dick Visser wrote: > You can’t resolve variables with names that contain variables themselves.  > Instead, use a lookup: > > https://docs.ansible.com/ansible/latest/plugins/lookup/vars.html > > Also try to use the args: chdir option instead of doing &&, see  >

Re: [ansible-project] How to translate a complex sed expressions into regex_replace

2020-02-25 Thread Stefan Hornburg (Racke)
On 2/25/20 4:27 PM, jean-christophe manciot wrote: > > {{ var }} is already a yaml object: it is the list of dictionaries. Good .. so there is no point to using shell + sed here, right? Loop over the list of dictionaries and manipulate it with "set_fact". Maybe you can give an example how a

Re: [ansible-project] How to translate a complex sed expressions into regex_replace

2020-02-25 Thread jean-christophe manciot
{{ var }} is already a yaml object: it is the list of dictionaries. -- 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

Re: [ansible-project] Re: remote_src and template_host for template module not working for me

2020-02-25 Thread Janmejaya Swain
Sure , i will post it here thanks On Tuesday, February 25, 2020 at 8:23:37 PM UTC+5:30, Stefan Hornburg (Racke) wrote: > > On 2/25/20 3:49 PM, Janmejaya Swain wrote: > > Thanks Racke , its work for me > > > > Well if you don't mind please post your resulting task so other list > members

[ansible-project] Re: remote_src and template_host for template module not working for me

2020-02-25 Thread Janmejaya Swain
Hi , I have multiple json as well as j2 files , Need to generate multiple config files by using template module On Wednesday, February 19, 2020 at 7:42:56 PM UTC+5:30, Janmejaya Swain wrote: > > Hi , > > Can any one please help on this, which is very appreciable. . > > --- > - hosts: all

Re: [ansible-project] ansible and yaml syntax - There appears to be both 'k=v' shorthand syntax and YAML in this task. Only one syntax may be used.

2020-02-25 Thread Nicolas W
Thanks for confirming the syntax looks ok. On Tuesday, February 25, 2020 at 9:44:32 AM UTC-5, Dick Visser wrote: > > There is nothing wrong with that variable. > As the error says, it may be elsewhere in the file depending on the > exact syntax problem. > In fact, it might not even be in >

Re: [ansible-project] How to translate a complex sed expressions into regex_replace

2020-02-25 Thread Stefan Hornburg (Racke)
On 2/25/20 3:48 PM, jean-christophe manciot wrote: > ansible 2.9.5 (pip3) > > The following sed command: > - function is to replace all '_' by '-' in all keys only (and not values) > within a list of dictionaries in memory > - uses character classes which are probably not supported by

Re: [ansible-project] Re: remote_src and template_host for template module not working for me

2020-02-25 Thread Stefan Hornburg (Racke)
On 2/25/20 3:49 PM, Janmejaya Swain wrote: > Thanks Racke , its work for me  > Well if you don't mind please post your resulting task so other list members can see how you use synchronize. Simply stating "it doesn't work" or "it works for me" without a task to refer to doesn't really work for

[ansible-project] How to translate a complex sed expressions into regex_replace

2020-02-25 Thread jean-christophe manciot
ansible 2.9.5 (pip3) The following sed command: - function is to replace all '_' by '-' in all keys only (and not values) within a list of dictionaries in memory - uses character classes which are probably not supported by regex_replace: + [:blank:]: space and tab + [:space:]: tab, newline,

Re: [ansible-project] Re: remote_src and template_host for template module not working for me

2020-02-25 Thread Janmejaya Swain
Thanks Racke , its work for me On Tuesday, February 25, 2020 at 6:42:31 PM UTC+5:30, Stefan Hornburg (Racke) wrote: > > On 2/25/20 1:56 PM, Janmejaya Swain wrote: > > Thank u Jordan and Dick , > > > > Can you please help to know , how can we fetch folder from remote to > controller as

Re: [ansible-project] ansible and yaml syntax - There appears to be both 'k=v' shorthand syntax and YAML in this task. Only one syntax may be used.

2020-02-25 Thread Vladimir Botka
On Tue, 25 Feb 2020 06:07:52 -0800 (PST) Nicolas Wright wrote: > db_connectionstring: "User ID=myuser;Initial Catalog=mycatalog;Data > Source=db\\instance;persist security info=True;password=mypass;Pooling=True" > [...] > 2020-02-25T14:01:13.6121920Z ##[error]ERROR! Syntax Error while loading

Re: [ansible-project] ansible and yaml syntax - There appears to be both 'k=v' shorthand syntax and YAML in this task. Only one syntax may be used.

2020-02-25 Thread Dick Visser
There is nothing wrong with that variable. As the error says, it may be elsewhere in the file depending on the exact syntax problem. In fact, it might not even be in /var/lib/rundeck/ansible/inventories/vin_qa01/group_vars/all/vars.yml (which you didn't post). A clue is found here: 'There appears

[ansible-project] ansible and yaml syntax - There appears to be both 'k=v' shorthand syntax and YAML in this task. Only one syntax may be used.

2020-02-25 Thread Nicolas Wright
Hello, any clues what is a workaround for the syntax issue below? This variable is defined in a group among other variables. My playbook won't run because of this error. I may have to escape the =.. I m hoping to keep the string as human friendly as possible though. I am using quote so I can

Re: [ansible-project] Re: remote_src and template_host for template module not working for me

2020-02-25 Thread Stefan Hornburg (Racke)
On 2/25/20 1:56 PM, Janmejaya Swain wrote: > Thank u Jordan and Dick ,  > > Can you please help to know , how can we fetch folder from remote to > controller as fetch module not supported folders > rather than files.  > i  can able   to fetch  multiple files but not able to fetch folders . >

[ansible-project] Re: Windows updates found but not installed

2020-02-25 Thread Andre Gronwald
hi, i had a look into the issue again. it seems that some updates were filtered because of the categories. that is ok (.net is featurepack). but i don't know why the sql server sp2 gdr wasn't found (

[ansible-project] Re: remote_src and template_host for template module not working for me

2020-02-25 Thread Janmejaya Swain
Thank u Jordan and Dick , Can you please help to know , how can we fetch folder from remote to controller as fetch module not supported folders rather than files. i can able to fetch multiple files but not able to fetch folders . On Wednesday, February 19, 2020 at 7:42:56 PM UTC+5:30,

Re: [ansible-project] My playbook hangs during a task.

2020-02-25 Thread Ansible Krazy
We faced the same problem in our production. So if the node is slow//sluggish or goes unresponsive while playbook is running, Ansible will not leave the connection or in other words will keep waiting for output from the node(s). Well, in the case, playbooks seems to be hang. Try to use async poll