Re: [ansible-project] installing windows updates on windows hosts

2020-05-13 Thread David Foley
Again you seem to be missing vaules reboot: yes When: """ -- 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 ansible-project+unsubscr...@googlegroups.com.

Re: [ansible-project] installing windows updates on windows hosts

2020-05-13 Thread David Foley
Also appears you are missing the Tasks: element in your playbook -- 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] installing windows updates on windows hosts

2020-05-13 Thread harry devine
Your “hosts” line needs to be before the - name line. Harry On Wed, May 13, 2020 at 6:37 PM Tony Wong wrote: > --- > - name: Install all critical and security updates > hosts: all > win_updates: > category_names: > - CriticalUpdates > - SecurityUpdates > state: installed >

[ansible-project] installing windows updates on windows hosts

2020-05-13 Thread Tony Wong
--- - name: Install all critical and security updates hosts: all win_updates: category_names: - CriticalUpdates - SecurityUpdates state: installed register: update_result - name: Reboot host if required win_reboot: when: update_result.reboot_required but getting this

Re: [ansible-project] Is there a better way to search through a list using when and regex_search

2020-05-13 Thread Dick Visser
On Wed, 13 May 2020 at 19:44, Scott Fella wrote: > > Okay, this is what I have now that is working, but can I simplify the when? > > --- > - name: search_snmp # delete ime snmp ro string from wlc used in > {{ansible_play_name}} > hosts: all #wlc:london:sydney:!hawaii:!*5501 > no_log: no >

Re: [ansible-project] Is there a better way to search through a list using when and regex_search

2020-05-13 Thread Scott Fella
Vladimir, I'm a bit confused on how I can use the register: preOutputSummary in the set_facts search. My output when running the command: show snmpcommunity outputs this: IPSec mode: Disabled / Profile: none SNMP Community Name Client IP Address Client IP Mask

Re: [ansible-project] Re: Ansible unable to run command by becoming other user and using sudo

2020-05-13 Thread Luca 'remix_tj' Lorenzetto
On Wed, May 13, 2020 at 5:58 PM Zayed Mahmud wrote: > > Hi Luca, thanks for replying. Here's the data you requested: > > Here's the output of 'sudo -l' for user1: > [user1@server1 ~]$ sudo -l > Matching Defaults entries for user1 on server1: > !visiblepw, always_set_home, match_group_by_gid,

Re: [ansible-project] Is there a better way to search through a list using when and regex_search

2020-05-13 Thread Vladimir Botka
On Wed, 13 May 2020 10:44:18 -0700 (PDT) Scott Fella wrote: > ... can I simplify the when? > (when one of the items in the list is found in the output?) It's possible to create a list of the "search" results and use the test "any". For example the playbook

Re: [ansible-project] Is there a better way to search through a list using when and regex_search

2020-05-13 Thread Scott Fella
Okay, this is what I have now that is working, but can I simplify the when? --- - name: search_snmp # delete ime snmp ro string from wlc used in {{ansible_play_name}} hosts: all #wlc:london:sydney:!hawaii:!*5501 no_log: no gather_facts: no strategy: free vars: oldSnmp: -

Re: [ansible-project] Is there a better way to search through a list using when and regex_search

2020-05-13 Thread Scott Fella
So you mean define it like the following in a playbook: vars: snmp_strings: - a - b - cc -Scott > On May 13, 2020, at 8:19 AM, Dick Visser wrote: > > snmp_strings: > - a > - b > - cc -- You received this message because you are

[ansible-project] Re: Adding task output to a file in a loop

2020-05-13 Thread harry devine
OK, I'm finally getting back to this. I failed to mention that I'm trying to query our LDAP server, which is Red Hat IDM (based off of FreeIPA). Here's what I have so far but its not working: --- - hosts: ldap gather_facts: no become: yes become_method: sudo tasks: - name: Obtain

[ansible-project] Re: Ansible unable to run command by becoming other user and using sudo

2020-05-13 Thread Zayed Mahmud
*Hi Luca, thanks for replying. Here's the data you requested:* *Here's the output of 'sudo -l' for user1:* [user1@server1 ~]$ sudo -l Matching Defaults entries for user1 on server1: !visiblepw, always_set_home, match_group_by_gid, always_query_group_plugin, env_reset, env_keep="COLORS

Re: [ansible-project] Ansible unable to run command by becoming other user and using sudo

2020-05-13 Thread Luca 'remix_tj' Lorenzetto
Hello, can we have the output of: sudo -l for the user you're using for the connection? You need to be sure that the given user is allowed to sudo with NOPASSWD Luca On Wed, May 13, 2020 at 5:41 PM Zayed Mahmud wrote: > > Hi all, > > I have a target server where I have a user, user1, who can

Re: [ansible-project] Re: ssl: the specified credentials were rejected by the server

2020-05-13 Thread Tony Wong
Thanks I changed the auth to ntlm and works now another question how do I use a domain account instead of a local administrator? On Sat, Apr 25, 2020 at 3:28 PM Jordan Borean wrote: > You WinRM service has been set to reject Basic auth. You need to change > the auth to something like kerberos

[ansible-project] Ansible unable to run command by becoming other user and using sudo

2020-05-13 Thread Zayed Mahmud
Hi all, I have a target server where I have a user, *user1*, who can become another privileged user, *admin1*, without password.and admin1 can run any command with sudo, like "sudo ls /root" --> works. So from remote server I can do this: *[user1@server1~]$ sudo su - admin1 *--> successful

Re: [ansible-project] Is there a better way to search through a list using when and regex_search

2020-05-13 Thread Dick Visser
Is there any chance you can have a single var that is a list for those strings? I.e.: snmp_strings: - a - b - cc On Wed, 13 May 2020 at 16:25, Scott Fella wrote: > > Here is a sample output when I run a show snmpcommunity. The one with '*' > are hashed and

Re: [ansible-project] Forced --limit

2020-05-13 Thread Julien Seknazi
Thank you, it s work ! But, i have another question :) I use - hosts: "{{ ansible_limit }}" but i need to have "{{ ansible_limit }}" is included in group GROUP_1. When i use "{{ ansible_limit }}", it`s work for every host. I want to use var ansible_limit with condition, host is in

Re: [ansible-project] Is there a better way to search through a list using when and regex_search

2020-05-13 Thread Scott Fella
Here is a sample output when I run a show snmpcommunity. The one with '*' are hashed and read-only, so I will not be able to match on those, it is the read-only strings i'm worried about. rusred991c55p1 IPSec mode: Disabled / Profile: none SNMP Community Name Client IP Address

Re: [ansible-project] how to dynamic update value in vars_file

2020-05-13 Thread Stefan Hornburg (Racke)
On 5/13/20 3:58 PM, Eric Chang wrote: > location is defined in inventory file , but I have trouble to update nodes.pub > lineinfile is not appropriate for any structured data (JSON, YAML, XML, ...). Regards Racke > | > - hosts: srvs >   become: yes >   vars: >     location: l13 > >  

Re: [ansible-project] how to dynamic update value in vars_file

2020-05-13 Thread Eric Chang
location is defined in inventory file , but I have trouble to update nodes.pub - hosts: srvs become: yes vars: location: l13 tasks: - name: debug vars debug: var: nodes -

[ansible-project] win_shell, kerberos and credential delegation

2020-05-13 Thread Luca Lorenzetto
Hello, i'm hitting an issue with windows authentication and credential delegation. That's the piece of playbook that has problem with privileges: - name: define migrator command set_fact: migratore_command: "{{ backup_path }}\\Migrator\\DB.Migrator.exe -s -connstring

[ansible-project] Re: fortigate / fortinet

2020-05-13 Thread Robert Grätz
Hallo Andrew, I had the same problem as you. Please use https://galaxy.ansible.com/fortinet/fortios. This works very well. Am Mittwoch, 6. Mai 2020 21:49:51 UTC+2 schrieb Andrew Meyer: > > Has anyone gotten a fortinet/fortigate playbook to work? I have a > Fortigate 100D running 6.2.2 and I

Re: [ansible-project] Re: loop control for with_together

2020-05-13 Thread Diyawary
Hi , Please find below my inner yml - name: Checking TCP Service objects uri: url: "https://{{hostname}}/web_api/show-objects; validate_certs: False method: POST headers: x-chkp-sid: "{{ login.json.sid }}" body: filter: "{{item}}"

Re: [ansible-project] how to dynamic update value in vars_file

2020-05-13 Thread Stefan Hornburg (Racke)
On 5/13/20 9:32 AM, Eric Chang wrote: > like I said , I want to update nodes.ma with somevalue > based on location in playbook , if ma is not > defined. > ma is matainer's id , owner is customer's id. > with different location , there are different matainers. > and because some

Re: [ansible-project] how to dynamic update value in vars_file

2020-05-13 Thread Eric Chang
like I said , I want to update nodes.ma with somevalue based on location in playbook , if ma is not defined. ma is matainer's id , owner is customer's id. with different location , there are different matainers. and because some reason , we didn't keep all that records , so there are plenty of

Re: [ansible-project] how to dynamic update value in vars_file

2020-05-13 Thread Dick Visser
Update vars files based on the content of a variable it contains sounds like doing things backwards. Could you tell more about your ACTUAL deployment goal(s)? I.e. what are you trying to achieve with ansible? On Wed, 13 May 2020 at 03:34, Eric Chang wrote: > > I have a var file like > > nodes: >