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

2020-01-14 Thread Yehuda Pinhas
*Hi,* *Thank you for your answer. but its still not working* *This is how my code looks like now:* ansible_ssh_common_args: -o StrictHostKeyChecking=no -o UserKnownHostsFile=~/.ssh/known_hosts ansible_user: ansible ansible_password: ansible *And here is my error now:*

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

2020-01-14 Thread Yehuda Pinhas
*Hi,* *Thank you for your answer. but its still not working* *any idea why? * *here is my error now:* [ansible@Netauto-Dev new_vlan]$ ansible-playbook new_vlan_playbook.yml -v ansible-playbook 2.9.1 config file = /etc/ansible/ansible.cfg configured module search path =

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

2020-01-14 Thread Jean-Yves LENHOF
Hi, Perhaps you should better use slurp module to register the content of the file and do some regexp to print what you want on it... https://docs.ansible.com/ansible/latest/modules/slurp_module.html#slurp-module Regards, Le 15/01/2020 à 06:34, Shifa Shaikh a écrit : I wish to search for

[ansible-project] How to print all matched strings using Ansible regex

2020-01-14 Thread Shifa Shaikh
I wish to match all lines that begin with SSLFile or SSLFile in a file httpd.conf on a remote server and store the matched found strings in a variable for use later in the playbook. Below is what i did. - name: Find entries shell: "cat /tmp/httpd.conf" register: filecontent

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

2020-01-14 Thread Shifa Shaikh
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 which is good; but I'm unable to print

[ansible-project] parameterized roles which can import 1 or multiple dashboards based on requirements

2020-01-14 Thread anilkumar panditi
I have following ansible playbook ,which will import few dashboards in an iteration, but i am trying to import dashboard based on input parameter(like kafka,kubernetes etc). could anyone help please. -Playbook: - -- - name: Import Grafana dashboard grafana_dashboard:

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

2020-01-14 Thread Chris Thro
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 the following: lsof -p 10984 -ad 4,6

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

2020-01-14 Thread Vladimir Botka
On Tue, 14 Jan 2020 13:27:45 -0800 (PST) Xinhuan Zheng wrote: > ... However, I don't understand what it is doing in line: > {% from "templates/encoder/macros/ini_encode_macro.j2" import ini_encode > with context -%} This link to the Jinja doc will help you

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

2020-01-14 Thread 'J Hawkesworth' via Ansible Project
Having a file server mounted on lots of windows client pcs is a common pattern in windows shops but I decided to use a web server and make the windows client machines collect the apps they need using win_get_url module. Hope this helps, Jon On Tuesday, January 14, 2020 at 1:57:40 PM UTC,

[ansible-project] Re: ansible communication to windows

2020-01-14 Thread Jordan Borean
CredSSP send the user accounts password across the wire but it is definitely not in the clear. It is "wrapped" which means it's encrypted and the Windows host can decrypt the value. This is unlike other authentication formats where typically only a hash or shared secret known only to the

[ansible-project] ansible communication to windows

2020-01-14 Thread Olivier SECRET
Hello, I discovered ansible recently. I would like to use the ansible for the deployment of software on a fleet under Windows 7 and 10. I plan to use CredSSP authentication in order to use a local account on the target machines. On the server hosting ansible, I installed via pip3 the

[ansible-project] ansible communication to windows

2020-01-14 Thread Olivier SECRET
Hello, I discovered ansible recently. I would like to use the ansible for the deployment of software on a fleet under Windows 7 and 10. I plan to use CredSSP authentication in order to use a local account on the target machines. On the server hosting ansible, I installed via pip3 the

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

2020-01-14 Thread Xinhuan Zheng
Hello, I'm working on a role for system SSSD daemon. I found this piece of code online: https://github.com/picotrading/ansible-sssd/blob/master/templates/sssd.conf.j2 I have defined my own sssd_config variable in my role's defaults directory, so I'd like to use that piece of code. That code is

Re: [ansible-project] debug msg ignore other results.

2020-01-14 Thread alicia
For more details, see the section on “Adding controls to loops” here: https://docs.ansible.com/ansible/devel/user_guide/playbooks_loops.html > On Jan 14, 2020, at 6:36 AM, Jegan A wrote: > > Thanks a lot. It is working

Re: [ansible-project] ansible ignore_errors: yes

2020-01-14 Thread alicia
For more information on controlling what Ansible sees as a failure and how it responds, see https://docs.ansible.com/ansible/devel/user_guide/playbooks_error_handling.html Hope this helps, Alicia > On Jan 14,

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

2020-01-14 Thread Jordan Borean
Hi, the blog is still accepting comments, I just need to approve them so it doesn't get spammed. As for your issue at hand. 1) to use Ansible to map this network drive automatically in all VMs for > the domain user (mapped drive should be visible after VM reboots, during > every RDP sessions

Re: [ansible-project] ansible ignore_errors: yes

2020-01-14 Thread Vladimir Botka
On Tue, 14 Jan 2020 08:30:49 -0800 (PST) Karther wrote: > I would like to know if possible there is a parameter same ignore_errors > but not display on screen message error in red ... Use 'rescue' section. See "Blocks error handling"

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

2020-01-14 Thread Vladimir Botka
On Tue, 14 Jan 2020 06:38:34 -0800 (PST) Yehuda Pinhas wrote: > *Here is my code on my /etc/ansible/roles/new_vlan/vars/new_vlan_vars.yml > file:* > ansible_ssh_common_args: > -o StrictHostKeyChecking=no -o UserKnownHostsFile=~/.ssh/known_hosts > ansible_user: ansible > ansible_pass:

[ansible-project] ansible ignore_errors: yes

2020-01-14 Thread Karther
Hey community Ansible !! :) I would like to know if possible there is a parameter same ignore_errors but not display on screen message error in red ... The problem with *ignore_errors: yes* is that when there is one error in this task, the message error is display in red ... Can you help

[ansible-project] Re: Ansible ios_command: copy tftp: flash: keeps sending IOS file data until timeout

2020-01-14 Thread Gerry Maddock
Below is the playbook to enable scp on switches/routers: tasks: - name: IOS CONFIG 1a ios_config: lines: - ip scp server enable On Tuesday, January 14, 2020 at 11:14:59 AM UTC-5, Gerry Maddock wrote: > > I had the same issue, I ended up using scp: > - name: COPY

Re: [ansible-project] Create file who is in my csv file

2020-01-14 Thread Vladimir Botka
On Tue, 14 Jan 2020 06:57:06 -0800 (PST) Karther wrote: > Maybe 2.8.0.dev0 is not good version ? It's not same that version 2.8.0 ? This looks suspicious. Upgrade to the latest stable version in your distro. Probably 2.9.0 ? See "Release and maintenance"

[ansible-project] Re: Ansible ios_command: copy tftp: flash: keeps sending IOS file data until timeout

2020-01-14 Thread Gerry Maddock
I had the same issue, I ended up using scp: - name: COPY OVER IOS IMAGE command: "firmwarename.bin {{inventory_hostname}}:flash:/firmwarename.bin" I ran a separate playbook 1st to enable scp on the switches. On Sunday, June 16, 2019 at 11:02:24 AM UTC-4, Frankie Soto wrote: > > Hi! > >

[ansible-project] win_robocopy using remote windows share as src

2020-01-14 Thread Gerry Maddock
I'm trying to get the following to run: -- - name: backup hosts: prod-2016 gather_facts: false tasks: - name: Backup share win_robocopy: src: "\\10.5.1.248\\Data" dest: "Z:\\stuff\\IT_Backup\\CIF\\Data" remote_src: yes recurse: yes purge:

Re: [ansible-project] Create file who is in my csv file

2020-01-14 Thread Karther
Hello Visser, My version is : *ansible 2.8.0.dev0* * config file = /etc/ansible/ansible.cfg* * configured module search path = [u'/usr/share/ansible']* * ansible python module location = /usr/local/lib/python2.7/dist-packages/ansible* * executable location = /var/ansible/bin/ansible* *

[ansible-project] Ansible passwordless login not working

2020-01-14 Thread Yehuda Pinhas
*Hi!!* *Here is my code on my /etc/ansible/roles/new_vlan/vars/new_vlan_vars.yml file:* ansible_ssh_common_args: -o StrictHostKeyChecking=no -o UserKnownHostsFile=~/.ssh/known_hosts ansible_user: ansible ansible_pass: ansible *I want to disable the SSH authenticity of host check, and I

Re: [ansible-project] Create file who is in my csv file

2020-01-14 Thread Karther
And, I have this problem only with module read_csv it's very strange ... all parameters are well indented Can you help me please ... Best regards, Karther Le mardi 14 janvier 2020 15:07:11 UTC+1, Karther a écrit : > > Hey Vladimir, > > The error is : > > *ERROR! no action detected in task.

Re: [ansible-project] Create file who is in my csv file

2020-01-14 Thread Karther
Hey Vladimir, The error is : *ERROR! no action detected in task. This often indicates a misspelled module name, or incorrect module path.* *The error appears to have been in '/home/ansible/mssql_query/roles/tasks/main.yml': line 36, column 3, but may* *be elsewhere in the file depending on

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

2020-01-14 Thread Pjotr Banas
Hello experts, I was trying to reach Jordan on his blog: http://www.bloggingforlogging.com/2018/11/22/windows-mapped-drives-what-the-hell-is-going-on/#comment-178 ,but I see that comments are closed, so maybe here someone can help me with my issue: I've read article from the blog and I've

Re: [ansible-project] Question: How to use the same host for multiple groups?

2020-01-14 Thread Konstantinos Tzevelekidis
Hello, Finally we made it work using the following approach: Inventory file: Host1 mygroups='["groupA","groupB"]' Created two playbook files one with the tasks (PlaybookTasks.yml) and one that does an iteration (Playbook.yml) Playbook.yml: --- - hosts: all tasks: - include:

[ansible-project] Re: Ansible ios_command: copy tftp: flash: keeps sending IOS file data until timeout

2020-01-14 Thread 'Mysimpia' via Ansible Project
Ansible version : 2.9 Python version : 3.7.5 I also tried many times with sftp or scp with ios_command module but no luck. Instead, as shown below, net_put successfully copied the file over to the Cisco switch. The ansible_ssh_user and ansible_ssh_pass needs to be set in inventory file. One

Re: [ansible-project] Create file who is in my csv file

2020-01-14 Thread Vladimir Botka
On Tue, 14 Jan 2020 05:00:35 -0800 (PST) Karther wrote: > My problem is that there is problem of syntax with module read_csv: > > *- name: "Read users from CSV file and return a list"* > * read_csv:* > * path: /home/ansible/mssql_query/roles/files/csv_file.csv* > * delimiter: ','* > *

Re: [ansible-project] Create file who is in my csv file

2020-01-14 Thread Karther
Hey Vladimir !! :) Thanks for your answer, My problem is that there is problem of syntax with module read_csv: My task is : *- name: "Read users from CSV file and return a list"* * read_csv:* * path: /home/ansible/mssql_query/roles/files/csv_file.csv* * delimiter: ','* * register:

Re: [ansible-project] debug msg ignore other results.

2020-01-14 Thread Jegan A
Thanks a lot. It is working for me. On Tuesday, January 14, 2020 at 3:03:12 PM UTC+5:30, James Cassell wrote: > > > On Tue, Jan 14, 2020, at 12:48 AM, Jegan A wrote: > > Hello Team, > > > > I am iterating register result using debug and loop but it prints > > other variable result as well

Re: [ansible-project] Re: How to configure prompt with 2 inputs

2020-01-14 Thread Srinivas Naram
Thanks, that helped. On Mon, Jan 13, 2020 at 9:55 PM Uriel wrote: > I think the only thing missing from @Phil's answer is check_all: True > > On Monday, January 13, 2020 at 2:51:48 AM UTC-6, Srinivas Naram wrote: >> >> Thanks for our reply Phil. It did not work though. >> >> Any other

Re: [ansible-project] Running a dynamically generated playbook.

2020-01-14 Thread Vladimir Botka
On Mon, 13 Jan 2020 23:55:25 -0800 (PST) Anurag Negi wrote: > Hi, I have a requirement to run a dynamically generated playbook from a > main playbook. The idea is to run only a main playbook which would be > generating a sub-playbook and it would be run from one of the tasks in the > main

Re: [ansible-project] debug msg ignore other results.

2020-01-14 Thread James Cassell
On Tue, Jan 14, 2020, at 12:48 AM, Jegan A wrote: > Hello Team, > > I am iterating register result using debug and loop but it prints > other variable result as well how to ignore that one while printing > value which I want Below is the sample results. Cloud you please help > me on this