[ansible-project] Re: Updating Windows 10

2020-07-29 Thread jbor...@gmail.com
I still don't fully see the issue, the first call to win_updates found 4 updates and no updates were filtered. The screenshot you shared show that 4 updates were available which matches the 4 that are in log. Based on the logs it was run in check mode so it didn't actually install the updates

[ansible-project] Re: Powershell script works locally on windows machine but fails when attempted to run via playbook.

2020-07-29 Thread jbor...@gmail.com
This part '"*'{{ SITE }}'*"' means it will template the raw PowerSHell script as 'Get-WebSite -Name "*'cdu'*" (with the inner single quotes). My guess is you want this to be 'Get-Website -Name "*{{ SITE }}*"'. There's no need to quote a jinja2 block unless you are starting the YAML value with

[ansible-project] Re: Jinja2 Template to use as SRC Path

2020-07-29 Thread wpgpo...@gmail.com
Hello Jon, Thank you so much for the idea. Cheers On Monday, July 27, 2020 at 5:16:52 PM UTC-5 J Hawkesworth wrote: > I would try and organize variables so they are associated with the host in > inventory, rather than setting a lot of playbook vars > > # ansible inventory (notice both

[ansible-project] Re: backup playbook yml files - only if chaned

2020-07-29 Thread Kiran Kumar
I was able to do backup ... any suggestions on below TASK [backup playbooks] ** fatal: [localhost]: FAILED! =>

[ansible-project] backup playbook yml files - only if chaned

2020-07-29 Thread Kiran Kumar
Hi I do not want to use GIT for version control , so i am going to backup my playbooks .. only if this is changed copy the yml file with date ... I see copy module can do it - name: Copy a new "ntp.conf file into place, backing up the original if it differs from the copied version copy:

Re: [ansible-project] Powershell script runs locally but when run via ansible playbook doesn't produce the expected results.

2020-07-29 Thread Darshan Yamakanamardi
*Hello Avinash,* *Thanks for your response. And sorry for this duplicate post. (I missed the response from other community members) The original post is here: * https://groups.google.com/d/msg/ansible-project/LGtMnY3b32E/XN5bRkBwCQAJ *The script module never worked for me. * fatal:

[ansible-project] Re: Powershell script works locally on windows machine but fails when attempted to run via playbook.

2020-07-29 Thread Darshan Yamakanamardi
Thank you very much for your response and for explaining the issue in detail. I have tried this and it worked as expected. In the playbook which you provided below, I would like to define the "cdu" as a variable since I have to identify it dynamically. (Actually, this playbook will be called

[ansible-project] Re: Updating Windows 10

2020-07-29 Thread Alan Woods
My end goal it actually not to install all teh windows updates. I am just wanting to upgrade windows 10 boxes to 1909 and the 2004 updates. I am trying to get a group of Windows 10 PC of 5-10 and run a upgrade playbook and install the 1909 and the 2004 update after hours when the users are not

Re: [ansible-project] How to change form ssh username/password to public key encryption in a playbook?

2020-07-29 Thread Stefan Hornburg (Racke)
On 7/29/20 1:30 PM, Hans IJ wrote: > Hi, > > I am a beginner with ansible; I couldn't find the answer yet. > I want to bootstrap virgin raspberry pi's (raspbian based); > > It all works fine as intended, except for one step,  > I have to change the ansible hosts file manually half way between

[ansible-project] How to change form ssh username/password to public key encryption in a playbook?

2020-07-29 Thread Hans IJ
Hi, I am a beginner with ansible; I couldn't find the answer yet. I want to bootstrap virgin raspberry pi's (raspbian based); It all works fine as intended, except for one step, I have to change the ansible hosts file manually half way between two playbooks to make it work. What I want to

Re: [ansible-project] Reduce debug task

2020-07-29 Thread Rahul Kumar
Benifit is reducing 2 tasks in one task ! Or 10 tasks in 5 tasks ! If it can be done ! On Wed, 29 Jul 2020 at 13:41, Stefan Hornburg (Racke) wrote: > On 7/29/20 9:58 AM, Rahul Kumar wrote: > > Hi Ansible Gurus, > > Is it possible to print some message in the task itself when condition > is not

Re: [ansible-project] Reduce debug task

2020-07-29 Thread Stefan Hornburg (Racke)
On 7/29/20 9:58 AM, Rahul Kumar wrote: > Hi Ansible Gurus, > Is it possible to print some message in the task itself when condition is not > matched , rather than having new task with > debug module ? > > Example: currently i am writing two tasks: >  - name: Get Active Application server >      

Re: [ansible-project] Collection: adding ps1 script breaks anisble_connection=local?

2020-07-29 Thread Romain Pelisse
Hi, Thanks for pointing this out! We've indeed separated the Windows scripts (see windows_support branch) from the regular python scripts, but it leads to awful a lot of code duplication :( . We need to duplicate both the plugins/module/jcliff.py (into its own .ps1), but, as it turns out, we also

[ansible-project] Reduce debug task

2020-07-29 Thread Rahul Kumar
Hi Ansible Gurus, Is it possible to print some message in the task itself when condition is not matched , rather than having new task with debug module ? Example: currently i am writing two tasks: - name: Get Active Application server debug: msg: "No active Application server

Re: [ansible-project] pass playbook vars to a python script

2020-07-29 Thread Stefan Hornburg (Racke)
On 7/28/20 10:40 PM, Jerry Hwang wrote: > hello, > > I am trying to have a python script (auto triggered when a playbook is run) > to take from playbook extra_vars and uses it > as var for the script. > > for example: > ansible-playbook test.yml --extra-vars "win=True" > > something like in