Re: [ansible-project] Need Help in Ansible regex

2020-01-24 Thread James Cassell
On Fri, Jan 24, 2020, at 1:09 AM, Rakesh Parida wrote: > Hi all, > > I have a rpm whcich i have added in a list. I want to make it dynamic > i.e when the version of rpm changes playbook should handle it. > I have build a logic but the playbook skips the task where i have > mentioned the

[ansible-project] Re: What is the module to install drivers?

2020-01-24 Thread Work-Hard
changed - catagory_names to category_names.. Will try again but will the driver update ? please let me know On Friday, January 24, 2020 at 4:03:45 PM UTC-8, Work-Hard wrote: > > it's filtering now > vars : > win_updates: > - SecurityUpdates > - CriticalUpdates > -

[ansible-project] Re: What is the module to install drivers?

2020-01-24 Thread Work-Hard
it's filtering now vars : win_updates: - SecurityUpdates - CriticalUpdates - UpdateRollups - Definition Updates - Updates - Windows Server 2016 - Windows Defender - Feature Packs - Silverlight - Upgrades - Windows 10 - Drivers

[ansible-project] What is the module to install drivers?

2020-01-24 Thread Work-Hard
What is the module to install drivers ? it's not working with win_updates. === "changed": false, "filtered_updates": { "3ae62049-cfd0-482e-b95b-e44f346aa156": { "categories": [ "Drivers" ],

[ansible-project] What is the best approach to creating a inlude_vars file for my requirement

2020-01-24 Thread Shifa Shaikh
I use the stat module to read multiple files statistics from each remote server. Thus, I'm able to get the file mode and checksum value of say 3 files on host1 and 2 files on host2. I wish to know what is a good way to create/construct an include_vars file so that I can easily read back each

Re: [ansible-project] Re: can someone please explain about "undefined" error

2020-01-24 Thread Work-Hard
Got it thanks On Friday, January 24, 2020 at 6:07:34 AM UTC-8, Karl Auer wrote: > > To expand on what Eric said: > > Your when: condition refers to a variable called "update_count". > > At the point where you refer to it, that variable does not exist. I bolded > the bits of the error message

[ansible-project] Run excel VB or Macro?

2020-01-24 Thread John Harmon
I am trying to automate a process. Is it possible, natively in Ansible, to run an Excel Macro, or Visual Basic code against an .csv? Thanks in advance. -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and

[ansible-project] Re: Hostvars giving me undefined error

2020-01-24 Thread Rakesh Parida
Hi Dick/Jean, My inventory file has only one entry of yum.. Now i have also tried to use : - name: Show hostvars debug: msg: "{{ hostvars[groups['yum']['some_value'] }}" But still i get same error I think iam doing some error in syntax... as i keep getting the undefined

Re: [ansible-project] Hostvars giving me undefined error

2020-01-24 Thread Rakesh Parida
On Saturday, January 25, 2020 at 12:25:26 AM UTC+5:30, Jean-Yves LENHOF wrote: > > Hi, > > You should better use the find module instead of shell module and ls. > > As said, yum seem to be a group... To use hostvars special variable you > need to use host and not group... > > Something like

Re: [ansible-project] Hostvars giving me undefined error

2020-01-24 Thread Rakesh Parida
I had already tried d same but same error On Sat, 25 Jan, 2020, 12:25 AM Jean-Yves LENHOF, wrote: > Hi, > > You should better use the find module instead of shell module and ls. > > As said, yum seem to be a group... To use hostvars special variable you > need to use host and not group... > >

Re: [ansible-project] Hostvars giving me undefined error

2020-01-24 Thread Rakesh Parida
Yum is a hostname ina group variable And der are multiple yum server entries On Fri, 24 Jan, 2020, 11:35 PM Dick Visser, wrote: > Is 'yum' a group name perhaps? > > On Fri, 24 Jan 2020 at 17:49, Rakesh Parida > wrote: > >> Hi >> >> Iam trying to access the variable from other hosts using

Re: [ansible-project] How to skip the playbook based on a condition

2020-01-24 Thread Anand Solomon
Thanks I got this working. On Friday, January 24, 2020 at 3:37:43 PM UTC-5, Dick Visser wrote: > > meta: end_play > is what you want > > https://docs.ansible.com/ansible/latest/modules/meta_module.html > > > On Fri, 24 Jan 2020 at 21:01, Anand Solomon > wrote: > >> Hi, >> I basically wanted to

Re: [ansible-project] How to skip the playbook based on a condition

2020-01-24 Thread Dick Visser
meta: end_play is what you want https://docs.ansible.com/ansible/latest/modules/meta_module.html On Fri, 24 Jan 2020 at 21:01, Anand Solomon wrote: > Hi, > I basically wanted to skip the remaining of the playbook if a file exists > > > - name: Check if the file exists > stat: >

[ansible-project] How to skip the playbook based on a condition

2020-01-24 Thread Anand Solomon
Hi, I basically wanted to skip the remaining of the playbook if a file exists - name: Check if the file exists stat: path: /home/ansible/dbname/sql/file.sql register: optional_file - debug: msg: "File Exists" when: optional_file.stat.exists == True

Re: [ansible-project] Hostvars giving me undefined error

2020-01-24 Thread Jean-Yves LENHOF
Hi, You should better use the find module instead of shell module and ls. As said, yum seem to be a group... To use hostvars special variable you need to use host and not group... Something like this will work : msg: "{{ hostvars['YUM01']['some_value'] }}" But instead of asking to remove

Re: [ansible-project] Hostvars giving me undefined error

2020-01-24 Thread Dick Visser
Is 'yum' a group name perhaps? On Fri, 24 Jan 2020 at 17:49, Rakesh Parida wrote: > Hi > > Iam trying to access the variable from other hosts using hostvars. I am > getting the undefined error. > Can anybody help me: stuck at this point > > > > - hosts: yum > gather_facts: false > vars: >

[ansible-project] Unable to connect to Windows 2016 over HTTPS using self signed certificates; using ansible securely in a mixed active directory environment

2020-01-24 Thread Dan Hebert
Good afternoon, I have been trying to get ansible working over a Windows 2016 HTTPS listener with encryption using TLS encryption and self-signed certificate authentication. User authentication over HTTP is not going to be sufficient. The environment where I work is a mix of nodes

[ansible-project] Re: I have Ansible and Jenkins installed on Different Servers how can i configure both

2020-01-24 Thread 'J Hawkesworth' via Ansible Project
You can use the not-particularly-helpfully-named 'Publish Over SSH' Jenkins plugin https://plugins.jenkins.io/publish-over-ssh which lets you run arbitrary commands as well as transferring files. If your playbooks run for more than 2 minutes you will need to configure the 'Exec timeout (ms)'

[ansible-project] Re: Need Help in Ansible regex

2020-01-24 Thread Cyril Stoll
Hi Not quite sure what you are trying to do with the slash ("/") symbol in your regex. If you want to use it to escape the dot (".") sign then you need to use a backslash ("\") instead of a slash and you need to put it before the dot not after it. So try this:

[ansible-project] How to a activate ONOS apps by ansible-playbook?

2020-01-24 Thread Ivy Min
My ansible-playbook version is latest. I try to activate ONOS service in docker container by running ansible-playbook. I tried some ways. However they all failed. --- - hosts: local tasks: - name: Create a onos-a container docker_container: name: onos-a image:

[ansible-project] Hostvars giving me undefined error

2020-01-24 Thread Rakesh Parida
Hi Iam trying to access the variable from other hosts using hostvars. I am getting the undefined error. Can anybody help me: stuck at this point - hosts: yum gather_facts: false vars: file_locn: "/san/repos/{{ version }}/packages" tasks: - name: Find the Packages that are

Re: [ansible-project] Re: can someone please explain about "undefined" error

2020-01-24 Thread Karl Auer
To expand on what Eric said: Your when: condition refers to a variable called "update_count". At the point where you refer to it, that variable does not exist. I bolded the bits of the error message that really matter: TASK [reboot if required] **

[ansible-project] Re: can someone please explain about "undefined" error

2020-01-24 Thread 'Eric Hymowitz' via Ansible Project
At the risk of being rude, I'm not sure what you don't understand. You're querying a hash variable update_count , and looking for the member named reboot_required . Where did you define this variable? If you don't define a variable, then the variable is undefined. Is there more to this

Re: [ansible-project] Encrypted Password in Playbook

2020-01-24 Thread Srinivas Naram
Ok, I found the solution myself. Group or host variables should have different directory. There is no need of explicit mention such as in the playbook, but create a directory called group_vars or host_vars in the directory where the playbook is placed. these directories will have files with

[ansible-project] Help on using the wen condition

2020-01-24 Thread Daniel Nanboe
I have a list of users defined as variable on my inventory. I want to create a task that checks if for each user exists a file in a folder if it exists will run a task if not will run an other task. I have a task that add the user with password if password exists and no ssh key is found and