[ansible-project] Re: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password)

2020-01-15 Thread mili singh
Hi Amadin, Follow below steps to to ping hosts: Create ssh connection with host And ping to the host using below command: #ansible -i -m ping and then run playbook on that host. Or You can avoid this by providing ansible_password (The password to use to authenticate to the host) in inventory

[ansible-project] Foreman inventory source plugin and dynamic groups

2020-01-15 Thread Jim Richard
This says: https://docs.ansible.com/ansible/latest/plugins/inventory.html "create dynamic groups using host variables with the constructed keyed_groups option. The option groups can also be used to create groups and compose creates and modifies host variables. Here is an aws_ec2 example

[ansible-project] Re: How can I connect to Windows Server using WinRM without password(like linux ssh authentication)?

2020-01-15 Thread renu jessi
WinRM HTTPS Listener The ConfigWinRMListenerPlugin configures a WinRM HTTPS listener with a self signed certificate generated on the spot and enables (optionally) basic authentication, which means that a secure communication channel can be established between any client and the server being

[ansible-project] How can I connect to Windows Server using WinRM without password(like linux ssh authentication)?

2020-01-15 Thread Jiwoong Lee
Hi, all. Now I can connect to Linux server without password, It just using SSH key. And I need to connect Windows Server using WinRM but it need to Windows account and password. How can I connect to Windows Server without password? Please let me know any methods. -- You received this

[ansible-project] unable to install vim plugin via shell module

2020-01-15 Thread Eric Chang
I want to install vim plugins with ansible shell module the task is quite simple as follow - name: install vim vundle plugin > shell: "vim +PluginInstall +qall" > but the playbook will hang at this task like forever. even with -vv or -vvv , there`s no more detail log , it just hangs ! any

[ansible-project] New Ansible releases 2.9.3, 2.8.8, and 2.7.16

2020-01-15 Thread Matt Davis
Hi all- we're happy to announce that the general release of Ansible 2.9.3, 2.8.8, and 2.7.16 are now available! How do you get it? -- $ pip install ansible==2.9.3 --user or $ pip install ansible==2.8.8 --user or $ pip install ansible==2.7.16 --user The tar.gz of the releases

[ansible-project] Re: Windows mapped drives – what the hell is going on?

2020-01-15 Thread Jordan Borean
Unfortunately I cannot explain this at all, a couple of final question/clarifications - When you map it manually with net use, can you log off and back on and the drive still remains connected and visible in Windows Explorer? - The output for 'net use' on a limited process is showing

Re: [ansible-project] Gathering Facts hangs when using become

2020-01-15 Thread Chris Thro
Thank you for the print idea. I was able to trace it to the following commands: /usr/bin/facter --puppet –json Looks like the version of facter doesn't like the --puppet option. WIll probably have to look into uprading it. Thanks again. -- You received this message because you are

Re: [ansible-project] Re: Does current Ansible support templates macro?

2020-01-15 Thread Vladimir Botka
On Wed, 15 Jan 2020 11:57:49 -0800 (PST) Xinhuan Zheng wrote: > I tested the solution, it doesn't work. item.1 becomes: > {u'id_provider': u'local', u'auth_provider': u'local', u'enumerate': True} > So I get error there is no keys on {{ item.1.keys().0 }} Both versions works for me.

[ansible-project] loop and pass variables from vars_files to task command

2020-01-15 Thread Matthew DeSantos
Hi Folks, I'm trying to loop over a list of production vlan's using a vars_file named exos_vlans.yml. The playbook runs fine on the first vlan but doesn't attempt to create the 2nd vlan. It just starts the next task and finishes up w/out any errors. My file includes 3 variables (vlan_name,

Re: [ansible-project] Re: Does current Ansible support templates macro?

2020-01-15 Thread Xinhuan Zheng
Got this error: "AnsibleUndefinedVariable: 'list object' has no attribute 'items' for item.1.items() - Xinhuan On Wednesday, January 15, 2020 at 1:56:58 PM UTC-5, Vladimir Botka wrote: > > On Wed, 15 Jan 2020 19:47:23 +0100 > Vladimir Botka > wrote: > > > Fit the template to your needs. For

[ansible-project] Pass variables to template file from Ansible.

2020-01-15 Thread Mo A
Hi, I'm using Ansible 2.9 and I'm using roles as well. I have the following variable defined in my "role-directory"/var/main.yml file: routers: bbrs: - BBR-ROUTER01 - BBR-ROUTER02 bprs: - BPR-ROUTER01 - BPR-ROUTER02 BBRS and BPRS are a specific type of hardware type. So

Re: [ansible-project] Re: Does current Ansible support templates macro?

2020-01-15 Thread Xinhuan Zheng
I tested the solution, it doesn't work. item.1 becomes: {u'id_provider': u'local', u'auth_provider': u'local', u'enumerate': True} So I get error there is no keys on {{ item.1.keys().0 }} - Xinhuan On Wednesday, January 15, 2020 at 1:47:42 PM UTC-5, Vladimir Botka wrote: > > On Wed, 15 Jan

Re: [ansible-project] Re: Does current Ansible support templates macro?

2020-01-15 Thread Vladimir Botka
On Wed, 15 Jan 2020 19:47:23 +0100 Vladimir Botka wrote: > Fit the template to your needs. For example the template > > {% for item in sssd_config.items() %} > [{{ item.0 }}] > {{ item.1.keys().0 }}={{ item.1.values().0 }} > {% endfor %} > > gives > > [nss] >

Re: [ansible-project] Re: Does current Ansible support templates macro?

2020-01-15 Thread Vladimir Botka
On Wed, 15 Jan 2020 10:40:53 -0800 (PST) Xinhuan Zheng wrote: > Tried what you said. Here is what {{ item }} look like: > > [(u'sssd', {u'debug_level': 5, u'reconnection_retries': 3, > u'config_file_version': 2, u'sbus_timeout': 30})] > [(u'services', [u'nss', u'pam', u'ssh'])] > > What

[ansible-project] Re: Does current Ansible support templates macro?

2020-01-15 Thread Xinhuan Zheng
Tried what you said. Here is what {{ item }} look like: [(u'sssd', {u'debug_level': 5, u'reconnection_retries': 3, u'config_file_version': 2, u'sbus_timeout': 30})] [(u'services', [u'nss', u'pam', u'ssh'])] ... What should I do next? Thanks again, - Xinhuan On Tuesday, January 14, 2020 at

Re: [ansible-project] Does current Ansible support templates macro?

2020-01-15 Thread Vladimir Botka
On Wed, 15 Jan 2020 09:45:41 -0800 (PST) Xinhuan Zheng wrote: > *I still cannot figure out how to loop through my variable:* > > *sssd_config:* > * sssd:* > *debug_level: 1* > * nss:* > *reconnection_retries: 3* > * pam:* > * debug_level: 5* > > Here is my template code: > > {% for

Re: [ansible-project] register results in a text file after retrieving it on a device with (gather_facts)

2020-01-15 Thread Brian Coca
instead of the 2 debug statements use a `template` action https://docs.ansible.com/ansible/latest/modules/template_module.html if you delegate_to: localhost it will write the file on the controller. -- -- Brian Coca -- You received this message because you are subscribed to the Google

Re: [ansible-project] Does current Ansible support templates macro?

2020-01-15 Thread Xinhuan Zheng
*I still cannot figure out how to loop through my variable:* *sssd_config:* * sssd:* *debug_level: 1* * nss:* *reconnection_retries: 3* * pam:* * debug_level: 5* Here is my template code: {% for item in sssd_config %} [{{ item }}] {% set list = sssd_config[item] %} {% for i in list

Re: [ansible-project] Ansible passwordless login not working

2020-01-15 Thread Vladimir Botka
On Wed, 15 Jan 2020 05:36:23 -0800 (PST) Yehuda Pinhas wrote: > fatal: [R-TEST-SNIF]: UNREACHABLE! => {"changed": false, "msg": "Failed to > connect to the host via ssh: Warning: Permanently added > 'r-test-snif,10.70.54.102' (RSA) to the list of known hosts.\r\nPermission > denied

Re: [ansible-project] Re: curl and Ansible AWX

2020-01-15 Thread Douglas Thompson
Awesome! My apologies, I was not aware of the AWX group. Thank you and I'll try there, On Wed, Jan 15, 2020 at 9:47 AM Matt Martz wrote: > You may want to try the AWX mailing list instead: > https://groups.google.com/forum/#!forum/awx-project > > Typically speaking, this list is solely for the

Re: [ansible-project] Re: curl and Ansible AWX

2020-01-15 Thread Matt Martz
You may want to try the AWX mailing list instead: https://groups.google.com/forum/#!forum/awx-project Typically speaking, this list is solely for the purpose of discussing ansible proper. On Wed, Jan 15, 2020 at 9:45 AM Douglas Thompson < douglas.thomp...@peripatetics.net> wrote: > Anyone have

[ansible-project] Re: curl and Ansible AWX

2020-01-15 Thread Douglas Thompson
Anyone have any ideas? I have 'prompt at launch' setup on the AWX job template. On Wednesday, January 8, 2020 at 2:32:55 PM UTC-6, Douglas Thompson wrote: > > anyone know why this curl command passes the host_config_key but not the > extra_vars? > > curl -f -k -H 'Content-Type:

Re: [ansible-project] Unable to print regex registered variable in Ansible

2020-01-15 Thread Kai Stian Olstad
On 15.01.2020 06:34, Shifa Shaikh wrote: I wish to search for all entries of string starting with "SSLFile" or starting with "SSLFile" in a file(httpd.conf) and register it to a variable and print all the matches found. The string is found as evident from the output and the file is not modified

Re: [ansible-project] Gathering Facts hangs when using become

2020-01-15 Thread Kai Stian Olstad
On 15.01.2020 00:53, Chris Thro wrote: Thank you. I did the strace and it shows that it is just repeating the same two lines over and over again. select(7, [4 6], [], [4 6], {1, 0}) = 0 (Timeout) wait4(29548, 0x7fff6a145c84, WNOHANG, NULL) = 0 When I checked the details of the select I get

[ansible-project] Ansible create module mssql_querry

2020-01-15 Thread Karther
Hello, I have create module mssql_query in my repertory library/mssql_query.py for execut commande ligne on my database MSSQL with this website : https://github.com/melmorabity/ansible-mssql-query/blob/master/mssql_query.py My task is : - local_action: module: mssql_query

Re: [ansible-project] Ansible passwordless login not working

2020-01-15 Thread Yehuda Pinhas
*Hi Vladimir,* *with this code on the playbook:* --- - name: --- 1. Applying Layer 2 Configuration --- hosts: Snif_TEST connection: network_cli tasks: - include_vars: dir: /etc/ansible/roles/new_vlan/vars/ - include_role: name:

[ansible-project] register results in a text file after retrieving it on a device with (gather_facts)

2020-01-15 Thread Kaouane Alaaeddine
Hello all my tesk consist to register the number of vlan available in the device ( cisco switch) in a texte file 1) I want to get just the value of vlan sotred in the item"vlan_id" I hope someone can help me :) This my script --- -

Re: [ansible-project] Ansible passwordless login not working

2020-01-15 Thread Vladimir Botka
On Wed, 15 Jan 2020 03:56:14 -0800 (PST) Yehuda Pinhas wrote: > *Cisco IOS Software Version 15.4(1)T (I86BI_LINUX-ADVENTERPRISEK9-M)* Cisco IOS is supported platform https://access.redhat.com/articles/3168091 > - name: > hosts: Snif_TEST > connection: local The connection should be

Re: [ansible-project] Unable to print regex registered variable in Ansible

2020-01-15 Thread Jean-Yves LENHOF
Not undestanding exactly what you want to achieve... For the syntax error you forgot a quote So instead of this target: "{{ input | regex_replace('\\sSSLFile.*, '\\1') }}" You need this target: "{{ input | regex_replace('\\sSSLFile.*' , '\\1') }}" Regards, Le 15 janvier 2020 08:59:32

[ansible-project] Re: Windows mapped drives – what the hell is going on?

2020-01-15 Thread Pjotr Banas
1) What is the full command you run to map the drive normally (outside of Ansible)? - net use z: \\bellagio.intra.vegas.net\how\the\hell\to\solve\this\issue /persistent:yes' 2) If you manually map it through the GUI are you connecting with explicit credentials? - I'm connecting using mRemote,

Re: [ansible-project] Ansible passwordless login not working

2020-01-15 Thread Yehuda Pinhas
*Oh. of course.* *The router is virtual image - IOL.* *Cisco IOS Software Version 15.4(1)T (I86BI_LINUX-ADVENTERPRISEK9-M)* *Full code is:* */etc/ansible/roles/new_vlan/new_vlan_playbook.yml:* --- - name: --- 1. Applying Layer 2 Configuration --- hosts:

[ansible-project] Re: Windows mapped drives – what the hell is going on?

2020-01-15 Thread Pjotr Banas
1) What is the full command you run to map the drive normally (outside of Ansible)? - net use z: \\burak2.intra.noklab.net\Global_veryfication\[4]_TP\Ansible /persistent:yes' 2) If you manually map it through the GUI are you connecting with explicit credentials? - I'm connection using mRemote,

[ansible-project] Re: Windows mapped drives – what the hell is going on?

2020-01-15 Thread Jordan Borean
That is very curious, typically the opposite is the case where the standard (limited) process is able to see the mapped drive but the admin process is not. We can see that in both scenarios net use can see that there is a valid configuration for the mapped drive but it is only successfully

Re: [ansible-project] Unable to print regex registered variable in Ansible

2020-01-15 Thread Dick Visser
On Wed, 15 Jan 2020 at 06:35, Shifa Shaikh wrote: > > I wish to search for all entries of string starting with "SSLFile" or > starting with "SSLFile" in a file(httpd.conf) and register it to > a variable and print all the matches found. It's not entirely clear what you mean by this. Can you

Re: [ansible-project] Ansible passwordless login not working

2020-01-15 Thread Vladimir Botka
On Wed, 15 Jan 2020 01:26:07 -0800 (PST) Yehuda Pinhas wrote: > The device is a router Sure it is. Could you disclose the brand and type? > 1. If im sshing normaly with ansible:ansible credentials it works > 2. If im installing ssh keypair (publickey on the router) the ansible is > working.

[ansible-project] Ansible - How get status of all users on my Active Directory Windows

2020-01-15 Thread Karther
Hello Guy !! :) I want to know how get status of all users on my Active Directory Windows. So i want to know if the user has status enabled or disabled on my Active Directory I know there is this ansible website but i don't find what i want ... Thanks for your help community Ansible ;)

[ansible-project] Re: Windows mapped drives – what the hell is going on?

2020-01-15 Thread Pjotr Banas
EDIT: 2) PowerShell as Administrator: PS C:\Windows\system32> gdr -PSProvider 'FileSystem' > > > Name Used (GB) Free (GB) Provider Root > CurrentLocation > - -

[ansible-project] Re: Windows mapped drives – what the hell is going on?

2020-01-15 Thread Pjotr Banas
It turned out that this issue is somehow related to permissions/security settings - any suggestions? I asked our internal IT team to check security event log: Please, look what I've found: * RDP login, user: elvis * I've mounted drive under Z: letter, Z: drive is visible.

Re: [ansible-project] Ansible passwordless login not working

2020-01-15 Thread Yehuda Pinhas
Hi Vladimir, The device is a router, and I have made few more checks: 1. If im sshing normaly with ansible:ansible credentials it works 2. If im installing ssh keypair (publickey on the router) the ansible is working. Problem occurs once I take off the public key from the router and try to

[ansible-project] Re: Windows mapped drives – what the hell is going on?

2020-01-15 Thread Jordan Borean
Sorry about the option name mismatch but glad you found the correct one. Your task seems to be correct so it's curious as to why it isn't showing up. What I recommend you look at; - See if the key 'HKCU:\Network\Z' is present and if the entries match what you set - Run the command

Re: [ansible-project] Ansible passwordless login not working

2020-01-15 Thread Yehuda Pinhas
> > Hi Vladimir, The device is a router, and I have made few more checks: 1. If im sshing normaly with ansible:ansible credentials it works 2. If im installing ssh keypair (publickey on the router) the ansible is working. Problem occurs once I take off the public key from the router and try

Re: [ansible-project] Ansible passwordless login not working

2020-01-15 Thread Vladimir Botka
On Tue, 14 Jan 2020 23:30:43 -0800 (PST) Yehuda Pinhas wrote: > using connection plugin network_cli (was local) > [...] > fatal: [R-TEST-SNIF]: FAILED! => { > "changed": false, > "msg": "command timeout triggered, timeout value is 10 secs.\nSee the > timeout setting options in the

[ansible-project] Re: Windows mapped drives – what the hell is going on?

2020-01-15 Thread Pjotr Banas
Hi Jordan, First of all big thanks for your reply, I'm really surprised how efficiently this community works. So, let's cut to the chase. I focused on your first hint and according to it, I've corrected my playbook: (for others info: there was a 'typo' - name instead of letter) - name:

[ansible-project] Re: Windows mapped drives – what the hell is going on?

2020-01-15 Thread Pjotr Banas
Hi Jordan, First of all big thanks for your reply, I'm really surprised how efficiently this community works. So, let's cut to the chase. I focused on your first hint and according to it, I've corrected my playbook: (for others info: there was a 'typo' - *name* instead of *letter*) -

Re: [ansible-project] Unable to print regex registered variable in Ansible

2020-01-15 Thread Shifa Shaikh
Reading the contents of the file is not the challenge. I used both sllurp as well as cat and I can see the file contents in the debug. The error occurs when I regex for the desired string. - name: Slurp certificate entries slurp: src: "{{ httpd_home }}/conf/httpd.conf"