[ansible-project] Inventory file parsing in Copy Module

2021-04-16 Thread Pawan Kumar
Hi Team, I want to parse inventory file using ansible playbook to copy ssh public id . Something like ,contents of inventory file should be used as source of copy module ... --- - host: all tasks - name: var file include_vars: file: /home/raka/raka.txt - name: copy copy: src:

Re: [ansible-project] Reduce duplicate/repeated steps in playbook

2020-07-21 Thread Pawan Kumar
> > Regards > Gg > > > > On Mon, 20 Jul 2020, 21:42 Pawan Kumar, wrote: > >> Hi Team >> >> Any thoughts on reducing this repetition !! >> >> Thanks >> >> On Mon, 20 Jul 2020, 00:28 Pawan Kumar, wrote: >> >>> >>&g

Re: [ansible-project] Reduce duplicate/repeated steps in playbook

2020-07-20 Thread Pawan Kumar
Hi Team Any thoughts on reducing this repetition !! Thanks On Mon, 20 Jul 2020, 00:28 Pawan Kumar, wrote: > > > > > > Hi ,Team > > Require your help to reduce repeated steps , in the following playbook ,3 > roles are common ,but 2 roles( permission.yml & relo

[ansible-project] Reduce duplicate/repeated steps in playbook

2020-07-19 Thread Pawan Kumar
Hi ,Team Require your help to reduce repeated steps , in the following playbook ,3 roles are common ,but 2 roles( permission.yml & reload_base_service.yml) variable value is different - hosts: masters gather_facts: yes vars: - owner: "roks" - mode: "0644" -

[ansible-project] Issue while parsing Complex Regular expression in YAML file

2020-06-03 Thread Pawan Kumar
Issue is coming while parsing the following regular expression "^[a-zA-Z0-9-+.#$%&~*\/=?^_ '\"\\!]{9,430}$" *Tried other options like * "^[a-zA-Z0-9-+.#$%&~*\/=?^_ '\\\"\\!]{9,430}$" '^[a-zA-Z0-9-+.#$%&~*\/=?^_ '\"\\!]{9,430}$' *Issues coming * stderr: |- while scanning a

Re: [ansible-project] [ Ansible ] - How to comment (add #) all lines in file

2020-02-21 Thread Pawan Kumar
Vlado you are the champ 鷺 On Fri, 21 Feb 2020, 15:46 Vladimir Botka, wrote: > On Fri, 21 Feb 2020 08:48:33 + > João Santos wrote: > > > Indeed that suggestion worked out in replacement of using `shell` module > > (or similar). > > > > On Thu, 20 Feb 2020 at 18:53, Vladimir Botka wrote: >

[ansible-project] Re: Able to extract list of installed rpm using "shell" module but not with yum module

2020-01-30 Thread Pawan Kumar
Hi Team, May i get some response to this issue . Hopefully I am able to explain the problem . warm regards Pawan kumar On Wednesday, January 29, 2020 at 9:24:31 PM UTC+5:30, Pawan Kumar wrote: > > --- > > - hosts: localhost > > tasks: > > - name: Create a

Re: [ansible-project] format List comparison ansible

2020-01-30 Thread Pawan Kumar
Thanks Vladimir , Extraordinary solution . Just for curiosity , would be please explain the steps in solution . warm regards Pawan On Thursday, January 30, 2020 at 11:59:37 PM UTC+5:30, Vladimir Botka wrote: > > On Thu, 30 Jan 2020 10:08:02 -0800 (PST) > Rakesh Parida > wrote: > > > Is

[ansible-project] Re: Able to extract list of installed rpm using "shell" module but not with yum module

2020-01-29 Thread Pawan Kumar
"update_cache": false, "update_only": false, "use_backend": "auto", "validate_certs": true } }, "item": "gawk", "results": [ { "arch": "x86_64",

[ansible-project] Able to extract list of installed rpm using "shell" module but not with yum module

2020-01-29 Thread Pawan Kumar
Hi Team, I am able to extract the selected list of installed rpms using ansible "shell" module ,But when I tried using "yum" module ,it's no success . Your help would be appreciated . The playbook which is running with "shell" module & it's output is as follows --- Playbook--- --- -

Re: [ansible-project] Requires Help ,using Python for accessing dictionary values from yaml file

2019-09-04 Thread Pawan Kumar
Thanks @Zolvaring I tried your previous suggestion , ansible-playbook ansible_dictionary.yml -e INV_FILE=dictionaryFile.yaml But unable to print key values in dictonary format , For example - Each key is product. Parse the each key and extract the “product_name”, “release_candidate” and

Re: [ansible-project] Requires Help ,using Python for accessing dictionary values from yaml file

2019-09-03 Thread Pawan Kumar
; > I'm not clear if you will need to do something beyond that for it to > naturally interpret the yaml object though there's a chance you'll still > end up with a string. > > > > On Mon, Sep 2, 2019, 4:09 PM Pawan Kumar > > wrote: > >> My Ansible code works fine ,

Re: [ansible-project] Requires Help ,using Python for accessing dictionary values from yaml file

2019-09-02 Thread Pawan Kumar
19 at 4:31:37 AM UTC+5:30, Pawan Kumar wrote: > > Hi Dick, > > Thanks for replying . > > Well said , i was working with Ansible to parse values from dictionary > file . > > working with the following ansible playbook > > > > --- > - hosts: 127.0.0.1 >

Re: [ansible-project] Requires Help ,using Python for accessing dictionary values from yaml file

2019-09-02 Thread Pawan Kumar
25.0.0 On Tuesday, September 3, 2019 at 4:06:16 AM UTC+5:30, Dick Visser wrote: > > Hi > > Kindly explain where ansible comes into play in this story? > > On Tue, 3 Sep 2019 at 00:18, Pawan Kumar > > wrote: > >> Using Python script to access values from yaml dic

[ansible-project] Requires Help ,using Python for accessing dictionary values from yaml file

2019-09-02 Thread Pawan Kumar
Using Python script to access values from yaml dictionary & print some of the values as list . For Example - Parse the each key and extract the “product_name”, “release_candidate” and “version“ & Print results as list The yaml file looks like - releases: - gotcha: file_name:

[ansible-project] get_url module failed when we download file from ftp with username and password

2016-06-01 Thread pawan kumar
fatal: [192.168.0.111]: FAILED! => {"changed": false, "dest": "/root/", "failed": true, "gid": 0, "group": "root", "mode": "0755", "msg": "Request failed", "owner": "root", "response": "OK (unknown bytes)", "secontext": "unconfined_u:object_r:admin_home_t:s0", "size": 4096, "state":

[ansible-project] How to get values for inventory files using with_inventory_hostname

2016-05-12 Thread pawan kumar
Hi all, I am trying to figure out how to use inventory created dynamically in my playbook. I dynamically create an inventory file as below and place it in inventory folder : [gapp] gapp[01:02]-leo.dev.com role=gapp [papp] papp[01:02]-leo.dev.com role=papp [relay] relay[01:02]-leo.dev.com