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

2019-09-02 Thread Zolvaring
I think what you want to do to use cli is specify the path as your var name just like your example, and then in your code when you invoke the variable, use the file lookup: - set_fact: your_fact: "{{ lookup('file', INV_VAR) }}" I'm not clear if you will need to do something beyond that for

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

2019-09-02 Thread Pawan Kumar
My Ansible code works fine , if i call dictionary values from file . But requires guidance , how using the yaml file to pass as argument as INV file command line to execute playbook: something like : "ansible-playbook test.yml -e INV_FILE=latest123.yaml" On Tuesday, September 3, 2019 at

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

2019-09-02 Thread Pawan Kumar
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 connection: local vars_files: - latest123.yaml tasks: - name: Printing "releases" value from yaml

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

2019-09-02 Thread Dick Visser
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 dictionary & print some of > the values as list . > > For Example - Parse the each key and extract the “product_name”, >

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

Re: [ansible-project] Support for installing Ansible on Windows

2019-09-02 Thread 'J Hawkesworth' via Ansible Project
I use ansible from WSL most days and it works just fine for me. Unless you are calling stuff which attempts to use a system call that hasn't been implemented in WSL translation layer it will be fine. The above shouldn't be an issue with WSL 2 but I haven't tried that myself. That said I use

Re: [ansible-project] Ansible for windows

2019-09-02 Thread 'J Hawkesworth' via Ansible Project
Did you try using async to run the command? I think you should be able to use async with win_shell module. The other steps you describe sound like they could be done using win_copy module and fetch module to retrieve the test results. See