Re: [ansible-project] Re: The powershell shell family is incompatible with the sudo become plugin

2020-05-14 Thread Dick Visser
Please don't hijack a thread just because you see a similar error. Instead start a new one, which will also allow you to provide the information that is needed to answer your question (playbook, inventory, etc). In any case make sure you first read https://docs.ansible.com/ansible/latest/user_guide

[ansible-project] Re: The powershell shell family is incompatible with the sudo become plugin

2020-05-14 Thread kishore madasu
Hi, I am also getting the same error but i couldn't mentioned 'ansible_become=true' in my inventory file. where should i need to specify "ansible_become_method=runas".Plz help me sortout this issue. Thank you in advance. On Thursday, 30 April 2020 12:21:37 UTC+5:30, Jenisha T wrote: > > Hi >

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

2020-05-14 Thread Scott Fella
Vlad, Thanks for the feedback on [mcve]. Hopefully this is right. gist: https://gist.github.com/fella5/6842043ccc35f013c9092c6520dfb593 *Summary*: There are two playbooks that I was working off of. search_snmp_v1.yml (jinja template) and search_snmp_v2.yml (lineinfile) *Function of the Playb

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

2020-05-14 Thread Tony Wong
nice thank you. Do I need to specify the win_reboot module? here is my playbook --- - name: Install all critical and security updates hosts: all tasks: - name: Install windows updates win_updates: category_names: - CriticalUpdates - SecurityUpdates

Re: [ansible-project] Re: Ansible shell command adding backslash

2020-05-14 Thread Dick Visser
Do you mean the actual password has two, or the escaped string had two (meaning the password has one)? On Thu, 14 May 2020 at 21:38, Mark T. wrote: > Hello, > > Thanks for the feedback. Your code works with all special characters that > I've used, but I run into a problem when there are two back

Re: [ansible-project] Re: Integrating vault setup as a global variable

2020-05-14 Thread Dick Visser
https://docs.ansible.com/ansible/latest/user_guide/playbooks_filters.html#id30 On Thu, 14 May 2020 at 15:31, deepak upadhyay wrote: > Hi Dick, > yes,how i can merge them. > > On Thursday, May 14, 2020 at 5:41:25 PM UTC+5:30, deepak upadhyay wrote: >> >> Hello, >> I am trying to use vault for wh

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

2020-05-14 Thread Vladimir Botka
On Thu, 14 May 2020 13:16:53 -0700 (PDT) Scott Fella wrote: > When trying to use the jinja2 template and running this playbook over > multiple hosts, the file gets overwritten. This works for a single device > if there is a match. > > {{ inventory_hostname }} > > {% for line in preO

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

2020-05-14 Thread Jordan Borean
Just change the username and password to that domain account. Typically the user is either in the Netlogon 'DOMAIN\user' form or the UPN 'u...@domain.com' form. The latter is preferred as it's what is required for Kerberos auth which should be used for domain logons. -- You received this messa

Re: [ansible-project] facing the problem in mapping network drive

2020-05-14 Thread Jordan Borean
The error you have is nothing to do with mapped drives but that Ansible is unable to authenticate itself over the WinRM connection. YOu need to set ansible_user and ansible_password for Ansible to use as the connection credentials. Also please note that while you can map a network drive using

Re: [ansible-project] win_shell, kerberos and credential delegation

2020-05-14 Thread Jordan Borean
It really depends on how the 'DB.Migrator.exe' binary is set to use credentials over a network path. If it's trying to find a credential in the user's DPAPI cred store then Kerberos with credential delegation is not enough to unlock it. Your options for this case are either: - Use become on

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

2020-05-14 Thread Jordan Borean
> > TASK [Reboot host if required] > ** > fatal: [10.50.1.231]: FAILED! => {"changed": false, "msg": "Invalid > options for win_reboot: when"} > I can't see you task but this sounds like your when clause is

[ansible-project] Re: Can I override a collection's module using `library`?

2020-05-14 Thread Brian Coca
Sorry, no collections are not designed to allow overrides, you would have to use 'short names' and insert your collection above it in priority: collections: - google.fixed - google.cloud But that also means you could have to change more code (mostly imports, depending on how they are writ

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

2020-05-14 Thread Scott Fella
Vlad, When trying to use the jinja2 template and running this playbook over multiple hosts, the file gets overwritten. This works for a single device if there is a match. {{ inventory_hostname }} {% for line in preOutputSummary.stdout_lines[0] %} {{ line }} {% endfor %}

[ansible-project] Re: Ansible shell command adding backslash

2020-05-14 Thread Mark T.
Hello, Thanks for the feedback. Your code works with all special characters that I've used, but I run into a problem when there are two backslashes (\\) side-by-side in a password. Is there any way to fix this? Regards, Mark On Wednesday, April 1, 2020 at 1:14:36 PM UTC-4, Mark T. wrote: >

[ansible-project] Add dictionary item to an existing list item

2020-05-14 Thread Jerrod Finn
I'd like to be able to add a dictionary item to a list item. For example: my_list: - first_list_item: color: blue country: us - second_list_item: stuff: blah What I'm trying to do is add to a list item like adding "state" below to the first list item. my_list: - first_list_it

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

2020-05-14 Thread Scott Fella
Okay sorry for all the post... I think I have something I can work with now. Here is my playbook that is working with the set_fact: --- - name: search_snmp hosts: all no_log: no gather_facts: no strategy: free vars: oldSnmp: - testSNMP tasks: # - pre-checks - - name: validate all curre

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

2020-05-14 Thread Scott Fella
This is where I got the info from: https://stackoverflow.com/questions/45737295/using-when-conditional-to-match-string-in-output-register-ansible On Thursday, 14 May 2020 10:28:08 UTC-7, Scott Fella wrote: > > Okay, well from doing some online searching and tinkering, maybe the > aireos module d

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

2020-05-14 Thread Scott Fella
Okay, well from doing some online searching and tinkering, maybe the aireos module does something different. I saw this post stating the following: > you need intermediate join here, because for ios-family modules stdout is > a list of strings, and stdout_lines is a list of lists (whereas for u

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

2020-05-14 Thread Tony Wong
Just found out when I run windows update manually on the machine, there were 3 updates that ansible didnt report back? why is that On Thu, May 14, 2020 at 9:49 AM Tony Wong wrote: > I am not sure what it should be > > I logged everything to a file and doesnt look like any updates but still >

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

2020-05-14 Thread Tony Wong
I am not sure what it should be I logged everything to a file and doesnt look like any updates but still getting this error TASK [Reboot host if required] ** fatal: [10.50.1.231]: FAILED! => {"changed": false

Re: [ansible-project] escaping curly braces in lineinfile module

2020-05-14 Thread Vladimir Botka
On Thu, 14 May 2020 08:16:20 -0700 (PDT) Laci wrote: > Another task I'm working on is a conditional blockinfile, something like: > if OS=BSD do this, if Linux do that. > > I need this because there is a slightly different configuration for them: > > BSD: > Job { > Name= "serverX"

Re: [ansible-project] Passing bulk data from ansible uri module to service and gettings status code -1 error

2020-05-14 Thread Diyawary
Hi Team, I am getting ('The read operation timed out',) error when sending data from ansible to snow even for some 300 lines also . could you please suggest how this can be resolved. -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To un

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

2020-05-14 Thread Zayed Mahmud
Hey Luca, Thanks for your great advice, but maybe there were some syntax error, hence I couldn't update suoders file.but i figured it out the syntax error too. here's an update for my testing, and it seems to work as i wanted to..but i will test in my main prod hosts where i faced the problem. h

Re: [ansible-project] escaping curly braces in lineinfile module

2020-05-14 Thread Stefan Hornburg (Racke)
On 5/14/20 5:16 PM, Laci wrote: > Another task I'm working on is a conditional blockinfile, something like:  > if OS=BSD do this, if Linux do that. > > I need this because there is a slightly different configuration for them: > > BSD: >  Job {  >       Name    = "serverX"  >       Client  = "serv

Re: [ansible-project] escaping curly braces in lineinfile module

2020-05-14 Thread Laci
Another task I'm working on is a conditional blockinfile, something like: if OS=BSD do this, if Linux do that. I need this because there is a slightly different configuration for them: BSD: Job { Name= "serverX" Client = "serverX-fd" JobDefs = "DefaultJob" } Lin

Re: [ansible-project] Convert string to yaml path

2020-05-14 Thread Dumast Axel
Hello, It worked ! I searched for 2 days but the solution was simple... Thank you very much, you saved me !! :) Have a nice day Le jeudi 14 mai 2020 16:51:10 UTC+2, Stefan Hornburg (Racke) a écrit : > > You can't wrap Jinja inside Jinja, but you can try to use either vars or > Python method:

Re: [ansible-project] Convert string to yaml path

2020-05-14 Thread Stefan Hornburg (Racke)
On 5/14/20 4:35 PM, Dumast Axel wrote: > Hello, > > I search since 2 days but I don't find any solution: > > I have 2 yaml files : > > Master.yml: > > values.yml: > I try to catch hostname1 and hostname2's list using command like *msg"{{ > firewall.port.{{ansible_hostname}} }}"*. > > The prob

[ansible-project] Convert string to yaml path

2020-05-14 Thread Dumast Axel
Hello, I search since 2 days but I don't find any solution: I have 2 yaml files : Master.yml: values.yml: I try to catch hostname1 and hostname2's list using command like *msg"{{ firewall.port.{{ansible_hostname}} }}"*. The problem is that {{ansible_hostname}} is a string value and "firewal

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

2020-05-14 Thread Scott Fella
I have tried your example also and got the same error using Vlad's example also. *search_snmp.yml* --- - name: search_snmp hosts: all no_log: no gather_facts: no strategy: free vars: oldSnmp: - tasks: - name: validate all current snmp string aireos_command:

Re: [ansible-project] escaping curly braces in lineinfile module

2020-05-14 Thread Laci
Actually this is my goal. We are going to have add new servers every time to this file. So the following lines will be repeated X times Job { Name= "serverX" Client = "serverX-fd" JobDefs = "DefaultJob" } > > "Using a custom marker without the {mark} variable m

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

2020-05-14 Thread Scott Fella
I gave it a try and got an error I don't know how to resolve it. The set_facts my_search is over my head:) *search_snmp.yml* --- - name: search_snmp hosts: all no_log: no gather_facts: no strategy: free vars: oldSnmp: - a tasks: - name: validate all current snmp st

Re: [ansible-project] win_shell, kerberos and credential delegation

2020-05-14 Thread Luca 'remix_tj' Lorenzetto
Hi, nobody has knowledge on this topic? It's quite critical to me for having a deployment workflow completed entirely with ansible. Luca On Wed, May 13, 2020 at 2:42 PM Luca Lorenzetto wrote: > > Hello, > > i'm hitting an issue with windows authentication and credential delegation. > That's th

[ansible-project] Re: Integrating vault setup as a global variable

2020-05-14 Thread deepak upadhyay
Hi Dick, yes,how i can merge them. On Thursday, May 14, 2020 at 5:41:25 PM UTC+5:30, deepak upadhyay wrote: > > Hello, > I am trying to use vault for which values are defined already (global > variables) i want to use them in my automation.How i can do it. Please help. > > structure is like > a

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

2020-05-14 Thread Eric Chang
so , what module you recommend ? Stefan Hornburg (Racke)於 2020年5月13日星期三 UTC+8下午10時12分58秒寫道: > > 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,

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

2020-05-14 Thread Scott Fella
Thanks for this! I will give this a try later also. -Scott > On May 14, 2020, at 5:50 AM, Vladimir Botka wrote: > > On Thu, 14 May 2020 09:58:22 +0200 > Vladimir Botka wrote: > >>- name: Create list of search results >> set_fact: >>my_search: "{{ my_search|defa

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

2020-05-14 Thread Scott Fella
Thanks for the follow up. I will give this a try today and let you know. I’m not familiar with the set_facts and using templates. -Scott -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emai

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

2020-05-14 Thread Vladimir Botka
On Thu, 14 May 2020 09:58:22 +0200 Vladimir Botka wrote: > - name: Create list of search results > set_fact: > my_search: "{{ my_search|default([]) + >[preOutputSummary.stdout is search(item)] }}" > loop: "{{ oldSnmp }}" > >

Re: [ansible-project] Unable to run command via Ansible to Sonus and Acme/Oracle SBC

2020-05-14 Thread Ravi Virmani
Hello Kai I am also facing same problem and in my case command prompt is '>' . Where I need to hit 'configure' first and prompt changed to '%' for further config commands. It is same sonus box and I am switching from 'root' to 'admin' to execute configuration commands via ansible expect module

Re: [ansible-project] Integrating vault setup as a global variable

2020-05-14 Thread Dick Visser
vaulted variables are only different in the way they are stored. otherwise pretty much transparent So your question is more how to merge variables i guess? On Thu, 14 May 2020 at 14:11, deepak upadhyay wrote: > > Hello, > I am trying to use vault for which values are defined already (global > v

[ansible-project] Integrating vault setup as a global variable

2020-05-14 Thread deepak upadhyay
Hello, I am trying to use vault for which values are defined already (global variables) i want to use them in my automation.How i can do it. Please help. structure is like a: b: vault: url: user: -- You received this message because you are subscribed to the Google Groups "An

Re: [ansible-project] facing the problem in mapping network drive

2020-05-14 Thread mahesh g o
I am setting the username and password: i have a volume name "test" in my storage box and i want to map it windows machine: details in host_vars are my machine details: volume details: letter: Z path: \\10.237.163.116\test username: test password: Password123 i am expec

Re: [ansible-project] facing the problem in mapping network drive

2020-05-14 Thread Luca 'remix_tj' Lorenzetto
Hello, On Thu, May 14, 2020 at 12:49 PM mahesh g o wrote: > i am getting below error when run the playbook: > fatal: [localhost]: UNREACHABLE! => {"changed": false, "msg": "ssl: auth > method ssl requires a username", "unreachable": true} > are you setting (or asking) username somewhere? Becaus

[ansible-project] facing the problem in mapping network drive

2020-05-14 Thread mahesh g o
Hi , help is appreciated playbook:mount.yml - hosts: localhost gather_facts: false vars_files: - /etc/ansible/group_vars/host_vars tasks: - name: create a mapped drive under Z win_mapped_drive: letter: Z path: \\10.237.163.116\test username: test

Re: [ansible-project] Ansible import excel format price list from supplier and export to remote inventory unit how to

2020-05-14 Thread Stefan Hornburg (Racke)
On 5/14/20 8:28 AM, Michael Chan wrote: > Hi I am not sure if this idea even possible, I want to use Ansible to pull > price list from suppliers and remotely send > and (copy) into designated inventory (remote servers) these update price > lists are in excel and once the price list are > updated,

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

2020-05-14 Thread Vladimir Botka
On Wed, 13 May 2020 15:16:30 -0700 (PDT) Scott Fella wrote: > .. how to integrate your feedback to my playbook. Searching "preOutputSummary.stdout[0]" doesn't make sense. To clarify the difference between ".stdout" and ".stdout_lines" of registered output. ".stdout" is a string and ".stdout_lin