Re: [ansible-project] problem while running role

2022-02-12 Thread Sk Ashir uddin
Yes!!, it's worked on many env but gets this error while ansible tries to 
gather facts on the host.
"line 1605, in get_lvm_facts\r\nIndexError: list index out of range"

--ashir
On Sunday, 13 February 2022 at 00:38:29 UTC+5:30 dick@geant.org wrote:

> Did this archeological setup work before?
>
>
> On Sat, 12 Feb 2022 at 19:06, Sk Ashir uddin  wrote:
>
>>
>> The output of "ansible --version"
>>
>>  ansible --version
>> ansible 2.4.0 (devel a06014663c) last updated 2017/04/18 12:36:51 (GMT 
>> +000)
>>   config file = /opt/ansible/config/ansible.cfg
>>   configured module search path = [u'/opt/ansible/library']
>>   ansible python module location = /opt/ansible/lib/ansible
>>   executable location = /usr/local/bin/ansible
>>   python version = 2.7.6 (default, Oct 26 2016, 20:30:19) [GCC 4.8.4]
>> On Saturday, 12 February 2022 at 23:28:30 UTC+5:30 dick@geant.org 
>> wrote:
>>
>>> On Sat, 12 Feb 2022 at 18:48, Sk Ashir uddin  
>>> wrote: 
>>> > 
>>> > I just try to run the ansible setup command I get this error, or I 
>>> preciously can say this error " line 1605, in get_lvm_facts" and ansible 
>>> version is 2.4.7. 
>>>
>>> AFAIK there has never been a version 2.4.7. 
>>> Also that is not what I asked. 
>>>
>>> > On Friday, 11 February 2022 at 20:01:16 UTC+5:30 dick@geant.org 
>>> wrote: 
>>> >> 
>>> >> Can there be even less information in your message? 
>>> >> 
>>> >> I only see one huge line with an error. 
>>> >> I'm guessing you want to get rid of it. If so, then you should 
>>> provide 
>>> >> much more information: 
>>> >> 
>>> >> - what you're trying to do 
>>> >> - playbook/inventory code 
>>> >> - output of "ansible --version" 
>>>
>>> This is what I asked. 
>>>
>>> So, please post the output of "ansible --version" 
>>>
>> -- 
>>
> 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-proje...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/dbf31cc9-567f-4797-ab5d-b39face62d40n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/ansible-project/dbf31cc9-567f-4797-ab5d-b39face62d40n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
> -- 
> Sent from a mobile device - please excuse the brevity, spelling and 
> punctuation.
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/82cc93b0-3497-46af-bc86-6b4f450d6254n%40googlegroups.com.


Re: [ansible-project] problem while running role

2022-02-12 Thread Sk Ashir uddin

The output of "ansible --version"

 ansible --version
ansible 2.4.0 (devel a06014663c) last updated 2017/04/18 12:36:51 (GMT +000)
  config file = /opt/ansible/config/ansible.cfg
  configured module search path = [u'/opt/ansible/library']
  ansible python module location = /opt/ansible/lib/ansible
  executable location = /usr/local/bin/ansible
  python version = 2.7.6 (default, Oct 26 2016, 20:30:19) [GCC 4.8.4]
On Saturday, 12 February 2022 at 23:28:30 UTC+5:30 dick@geant.org wrote:

> On Sat, 12 Feb 2022 at 18:48, Sk Ashir uddin  wrote:
> >
> > I just try to run the ansible setup command I get this error, or I 
> preciously can say this error " line 1605, in get_lvm_facts" and ansible 
> version is 2.4.7.
>
> AFAIK there has never been a version 2.4.7.
> Also that is not what I asked.
>
> > On Friday, 11 February 2022 at 20:01:16 UTC+5:30 dick@geant.org 
> wrote:
> >>
> >> Can there be even less information in your message?
> >>
> >> I only see one huge line with an error.
> >> I'm guessing you want to get rid of it. If so, then you should provide
> >> much more information:
> >>
> >> - what you're trying to do
> >> - playbook/inventory code
> >> - output of "ansible --version"
>
> This is what I asked.
>
> So, please post the output of "ansible --version"
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/dbf31cc9-567f-4797-ab5d-b39face62d40n%40googlegroups.com.


Re: [ansible-project] how to connect via ssh to different ansible nodes that have different root credentials ?

2020-12-12 Thread LaHwF Sk

thanks so much for helping guys
dont you think Passwordless sudo for the ansible user on each host is risky 
?
otherwise i will try to apply your second method @Stu with vars file, i 
think is more secure 
Le vendredi 11 décembre 2020 à 18:18:27 UTC+1, Stu a écrit :

> And I guess there could be an argument made against having password less 
> sudo for a user
>
> -Original Message-
> From: ansible...@googlegroups.com  On Behalf 
> Of Stuart Lowe
> Sent: 11 December 2020 17:15
> To: ansible...@googlegroups.com
> Subject: RE: [ansible-project] how to connect via ssh to different ansible 
> nodes that have different root credentials ?
>
> Deviates for managing windows servers
> Which is where having encrypted host_vars helps I guess.
>
>
>
> -Original Message-
> From: ansible...@googlegroups.com  On Behalf 
> Of Dick Visser
> Sent: 11 December 2020 16:46
> To: ansible...@googlegroups.com
> Subject: Re: [ansible-project] how to connect via ssh to different ansible 
> nodes that have different root credentials ?
>
> On Fri, 11 Dec 2020 at 17:33, Stuart Lowe  
> wrote:
>
> > SSH keys to each server,
> > Passwordless sudo for the ansible user on each host.
>
> That should be the default choice for almost everyone.
> Only deviating from that if there are very compelling reasons to do so.
> I have not come across them, but I'm interested to know what those might 
> be.
>
> --
> Dick Visser
> Trust & Identity Service Operations Manager GÉANT
>
> --
> 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-proje...@googlegroups.com.
> To view this discussion on the web visit 
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fansible-project%2FCAL8fbwOqXNXpgEOjx7rXUd7fOKruB4m7%253DQb-GnV0f1O3dj-2ag%2540mail.gmail.com&data=04%7C01%7Cstuart.lowe%40zeninternet.co.uk%7C9fe5486e13d3412e8eba08d89df85366%7Cf553766da74d4c29bbe3ae53a28c11d3%7C1%7C0%7C637433037166755338%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=DcM8n2304mQxZbh6Flvc95uR8W%2BM7YbGKgWDkF2UUr4%3D&reserved=0
> .
> --
> Stuart Lowe
> Cloud and Hosting Support Engineer
> Zen Internet
> Team: 01706 902009
> Web: zen.co.uk
>
> Proud to be a certified B Corporation
>
> This message is private and confidential. If you have received this 
> message in error, please notify us and remove it from your system.
>
> Zen Internet Limited may monitor email traffic data to manage billing, to 
> handle customer enquiries and for the prevention and detection of fraud. We 
> may also monitor the content of emails sent to and/or from Zen Internet 
> Limited for the purposes of security, staff training and to monitor quality 
> of service.
>
> Zen Internet Limited is registered in England and Wales, Sandbrook Park, 
> Sandbrook Way, Rochdale, OL11 1RY Company No. 03101568 VAT Reg No. 686 0495 
> 01
>
> -- 
> 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-proje...@googlegroups.com.
> To view this discussion on the web visit 
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fansible-project%2FVI1PR01MB4317765B66847F94E1E0F181A8CA0%2540VI1PR01MB4317.eurprd01.prod.exchangelabs.com&data=04%7C01%7Cstuart.lowe%40zeninternet.co.uk%7C9fe5486e13d3412e8eba08d89df85366%7Cf553766da74d4c29bbe3ae53a28c11d3%7C1%7C0%7C637433037166755338%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=X%2BWfAX17fOBKu2GsAKzDmsP2%2FusEgLtSC%2BuGHh%2Bdns4%3D&reserved=0
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/1b4f817e-aa42-437d-8c7c-274b36c11d26n%40googlegroups.com.


[ansible-project] how to connect via ssh to different ansible nodes that have different root credentials ?

2020-12-11 Thread LaHwF Sk

When configuring nodes with *Ansible*, each server has a its own user and 
password, but it asks for root pass for *ssh* connection.
is it a good idea to give all servers same root pass for easy use?
if not please how can i give each server different root pass and connect 
via ssh to use same playbook simultaneously in all nodes ?
i am new to *devops* and *ansible* so please bear with me :)

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/55415c5b-f5ed-4e5c-8d77-db51ab4ea845n%40googlegroups.com.


Re: [ansible-project] writing output to a csv file

2020-09-04 Thread SK
Thank Nuno, after changed the fork value its working fine now.

On Thursday, September 3, 2020 at 5:57:58 PM UTC+5:30 nuno@gmail.com 
wrote:

> Hello,
>
> If you are writing to the file in parallel into the localhost you may have 
> concurrency issues. Try to use only one fork to see if it helps.
>
> Nuno Jordão
>
> On Thu, Sep 3, 2020 at 11:44 AM SK  wrote:
>
>> Hi,
>>
>> Ansible version - 2.9
>>
>> Facing issue in writing output to a csv file, its not writing the output 
>> consistently into the file.
>>
>> Having an inventory file with three server IPs,  script will execute 
>> command to check the disk space of each server and writing the output to a 
>> csv file.
>>
>> Sometimes its writing all the three server details into the file, 
>> sometimes its writing only one or two server details into the file. 
>>
>>   - hosts: localhost
>> connection: local
>> gather_facts: False
>> vars:
>>   filext: ".csv"
>> tasks:
>>   - name: get the username running the deploy
>> local_action: command whoami
>> register: username_on_the_host
>>
>>   - name: get current dir
>> local_action: command pwd
>> register: current_dir
>>
>>   - name: create dir
>> file: path={{ current_dir.stdout }}/HCT state=directory
>>
>>   - name: Set file path here
>> set_fact:
>> file_path: "{{ current_dir.stdout }}/HCT/HCT_check{{ filext 
>> }}"
>>
>>   - name: Creates file
>> file: path={{ file_path }}  state=touch
>>
>> # Writing to a csv file
>>
>> - hosts:
>>   - masters
>> become: false
>> vars:
>>   disk_space: "Able to get disk space for the CM {{ hostname }} "
>>   disk_space_error: "The server {{ hostname  }} is down for some 
>> reason. Please check manually."
>>   disk_space_run_status: "{{disk_space}}"
>>   cur_date: "{{ansible_date_time.iso8601}}"
>>
>> tasks:
>>   - name: runnig command to get file system which are occupied 
>> command: bash -c "df -h | awk '$5>20'"
>> register: disk_space_output
>> changed_when: false
>> ignore_errors: True
>> no_log: True
>>
>>   - name: Log the task get list of file systems with space occupied 
>> lineinfile:
>>dest: "{{ hostvars['localhost']['file_path'] }}"
>>line: "File system occupying disk space, {{ hostname }}, {{ 
>> ip_address }}, {{ cur_date }}"
>>insertafter: EOF
>>state: present
>> delegate_to: localhost
>>
>> Please help to resolve this issue.
>>
>>
>> -- 
>> 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-proje...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/79186368-aa44-423b-b13a-c691269dbcabn%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/ansible-project/79186368-aa44-423b-b13a-c691269dbcabn%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/827149a3-9b90-4f30-98d0-2c233502f354n%40googlegroups.com.


[ansible-project] writing output to a csv file

2020-09-03 Thread SK
Hi,

Ansible version - 2.9

Facing issue in writing output to a csv file, its not writing the output 
consistently into the file.

Having an inventory file with three server IPs,  script will execute 
command to check the disk space of each server and writing the output to a 
csv file.

Sometimes its writing all the three server details into the file, sometimes 
its writing only one or two server details into the file. 

  - hosts: localhost
connection: local
gather_facts: False
vars:
  filext: ".csv"
tasks:
  - name: get the username running the deploy
local_action: command whoami
register: username_on_the_host

  - name: get current dir
local_action: command pwd
register: current_dir

  - name: create dir
file: path={{ current_dir.stdout }}/HCT state=directory

  - name: Set file path here
set_fact:
file_path: "{{ current_dir.stdout }}/HCT/HCT_check{{ filext }}"

  - name: Creates file
file: path={{ file_path }}  state=touch

# Writing to a csv file

- hosts:
  - masters
become: false
vars:
  disk_space: "Able to get disk space for the CM {{ hostname }} "
  disk_space_error: "The server {{ hostname  }} is down for some 
reason. Please check manually."
  disk_space_run_status: "{{disk_space}}"
  cur_date: "{{ansible_date_time.iso8601}}"

tasks:
  - name: runnig command to get file system which are occupied 
command: bash -c "df -h | awk '$5>20'"
register: disk_space_output
changed_when: false
ignore_errors: True
no_log: True

  - name: Log the task get list of file systems with space occupied 
lineinfile:
   dest: "{{ hostvars['localhost']['file_path'] }}"
   line: "File system occupying disk space, {{ hostname }}, {{ 
ip_address }}, {{ cur_date }}"
   insertafter: EOF
   state: present
delegate_to: localhost

Please help to resolve this issue.


-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/79186368-aa44-423b-b13a-c691269dbcabn%40googlegroups.com.


[ansible-project] Ansible playbook, trying to execute ssh-copy-id to remote host for passwd less login,

2019-12-17 Thread Ganeshwari Sk
Hi,

I am new for ansible. I wrote the following playbook to execute the 
ssh-copy-id to copy the id_rsa.pub key to remote host, but I am getting 
permission denied error or hanging when passing password as argument,

Playbook :

---
 - name: Copy ssh key
   hosts: Testing-Server
   become: true
   become_user: super_user
   gather_facts: True
   vars:
  my_remotehost: "{{failedhost}}"

   tasks:
   - name: Copy ssh key to remote host
 #command: "ssh-copy-id -i /super_user/.ssh/id_rsa.pub 
\"super_user@{{my_remotehost}}\""
 #shell: "sshpass -p \"password\" ssh-copy-id -o 
PreferredAuthentications=password -o PasswordAuthentication=yes -o 
StrictHostKeyChecking=no -o PasswordAuthentication=yes -i 
/super_user/.ssh/id_rsa.pub \"super_user@{{my_remotehost}} \""
 shell: "ssh-copy-id -o PreferredAuthentications=password -o 
PasswordAuthentication=yes -o StrictHostKeyChecking=no -o 
PasswordAuthentication=yes -i /super_user/.ssh/id_rsa.pub 
\"super_user@{{my_remotehost}} \""
 #command: "ssh-copy-id -i /super_user/.ssh/id_rsa.pub 
\"super_user@{{my_remotehost}} \""
 register: ssh_copy_id_execution
 failed_when: ssh_copy_id_execution.rc != 0

   - debug :
   var: ssh_copy_id_execution.stdout_lines

I have configured the ansigle_ssh_user and ansible_ssh_pass in 
/etc/ansible/hosts file

I am executing the above playbook like as,
ansible-playbook ssh_copy_id_task.yml --ask-pass --ask-become-pass 
--extra-vars "failedhost=x.x.x.x" -

After the below lines in the output, it is hanging,
 ESTABLISH SSH CONNECTION FOR USER: root
 SSH: EXEC sshpass -d12 ssh -vvv -C -o ControlMaster=auto -o 
ControlPersist=60s -o StrictHostKeyChecking=no -o User=root -o 
ConnectTimeout=10 -o ControlPath=/home/perl/.ansible/cp/07f7ed7577 -tt 
x.x.x.x '/bin/sh -c '"'"'/usr/bin/python 
/super_user/.ansible/tmp/ansible-tmp-1576576971.87-95887151849070/command.py 
&& sleep 0'"'"''



Please help me to resolve this issue.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/9cbcd41f-ca35-49bc-9520-03af80b91ba7%40googlegroups.com.


[ansible-project] Re: execute ssh-copy-id, if passwdless login not able

2019-12-11 Thread Ganeshwari Sk
I am newbie to ansible. I am trying to execute two different task. 
1. checking passwdless login. executing hostname and id command in the 
remote host and printing its result when succcess.
2. executing ssh-copy-id and copying pub key to the remote host

I want to execute the second task, only if the first task failed. 

Please let me know the mistake I am doing here.

On Wednesday, 11 December 2019 14:51:53 UTC+5:30, Ganeshwari Sk wrote:
>
> in Ansible playbook, I want to do two task, one to check passwdless ssh 
> login is enabled or not, and in another task if passwdless login not abled 
> for the remote host, then execute the ssh-copy-id command.
> I have written the following playbook, but it is not working as desired, 
> please help me to resolve the issue.
>
> ---
> - name: Check passwdless login
>   #hosts: stage-servers
>   hosts: Testing-Server
>   gather_facts: true
>
>   tasks:
> - name: check ssh to remote hosts works
>   block:
> - name: check ssh connection
>   shell: "hostname; id"
>   register: ssh_connection_test
>   failed_when: ssh_connection_test.rc != 0
>
> - debug:
> var: ssh_connection_test.stdout_lines
>
>   rescue:
> - debug:
>msg: "failed for host 
> {{hostvars[inventory_hostname]['ansible_default_ipv4']['address']}}"
> - name: Task failed, no passdwless ssh working
>   shell: "ssh-copy-id -o StrictHostKeyChecking=no -i 
> ~/.ssh/id_rsa.pub \"root@{{ 
> hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }} \""
>   register: ssh_copy_id_execution
>   failed_when: ssh_copy_id_execution.rc != 0
>
> - debug :
>  var: ssh_copy_id_execution.stdout_lines
>
>   always:
> - debug:
>  msg: "This always executed.."
>
>
> *I am getting this output:*
> LAY [Check passwdless login] 
> **
>
> TASK [Gathering Facts] 
> *
> fatal: [x.x.x.x]: UNREACHABLE! => {"changed": false, "msg": "Failed to 
> connect to the host via ssh: Address x.x.x.x maps to test.testlab.com, 
> but this does not map back to the address - POSSIBLE BREAK-IN 
> ATTEMPT!\r\nPermission denied 
> (publickey,gssapi-keyex,gssapi-with-mic,password).\r\n", "unreachable": 
> true}
> to retry, use: --limit @/etc/ansible/passwordless.retry
>
> PLAY RECAP 
> *
> x.x.x.x : ok=0changed=0unreachable=1failed=0   
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/b81ceb8a-f88a-49af-bfd1-fe553ba27541%40googlegroups.com.


[ansible-project] execute ssh-copy-id, if passwdless login not able

2019-12-11 Thread Ganeshwari Sk
in Ansible playbook, I want to do two task, one to check passwdless ssh 
login is enabled or not, and in another task if passwdless login not abled 
for the remote host, then execute the ssh-copy-id command.
I have written the following playbook, but it is not working as desired, 
please help me to resolve the issue.

---
- name: Check passwdless login
  #hosts: stage-servers
  hosts: Testing-Server
  gather_facts: true
   
  tasks:
- name: check ssh to remote hosts works
  block:
- name: check ssh connection
  shell: "hostname; id"
  register: ssh_connection_test
  failed_when: ssh_connection_test.rc != 0

- debug:
var: ssh_connection_test.stdout_lines

  rescue:
- debug:
   msg: "failed for host 
{{hostvars[inventory_hostname]['ansible_default_ipv4']['address']}}"
- name: Task failed, no passdwless ssh working
  shell: "ssh-copy-id -o StrictHostKeyChecking=no -i 
~/.ssh/id_rsa.pub \"root@{{ 
hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }} \""
  register: ssh_copy_id_execution
  failed_when: ssh_copy_id_execution.rc != 0

- debug :
 var: ssh_copy_id_execution.stdout_lines

  always:
- debug:
 msg: "This always executed.."


*I am getting this output:*
LAY [Check passwdless login] 
**

TASK [Gathering Facts] 
*
fatal: [x.x.x.x]: UNREACHABLE! => {"changed": false, "msg": "Failed to 
connect to the host via ssh: Address x.x.x.x maps to test.testlab.com, but 
this does not map back to the address - POSSIBLE BREAK-IN 
ATTEMPT!\r\nPermission denied 
(publickey,gssapi-keyex,gssapi-with-mic,password).\r\n", "unreachable": 
true}
to retry, use: --limit @/etc/ansible/passwordless.retry

PLAY RECAP 
*
x.x.x.x : ok=0changed=0unreachable=1failed=0   

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/ca240694-d328-4d69-8764-ecc1596c3b85%40googlegroups.com.


[ansible-project] How to remove unused/old configuration automatically using Ansible?

2018-05-21 Thread SK
I am currently using Ansible to generate running configuration for the 
network devices.  Here is the simple scenario I have.

I have defined the interface type (routed, access, trunk) in the variables 
file and then created a jinja file that will generate the necessary 
configuration based on variables definition.

Below is the sample variable definition and jinja template configuration:

CONFIG:
   - { id: Ethernet1/1, type: routed }
   - { id: Ethernet1/2, type: access }
   - { id: Ethernet1/3, type: trunk }

Jinja:

{% if int.type == 'routed' %}
 no switchport
{% elif int.type == 'access' %}
 switchport mode access
 switchport access vlan 10
 spanning-tree portfast
{% elif int.type == 'trunk' %}
 switchport mode trunk
 {% endif %}

This works perfectly fine when I define the variables, generate the 
configuration and push it to the device.  So, below is how the interface 
config will look like on the device after pushing the config:

interface Ethernet1/1
 no switchport
interface Ethernet1/2
 switchport mode access
 switchport access vlan 10
 spanning-tree portfast
interface Ethernet1/3
 switchport mode trunk

Now, I want to change Ethernet1/2 to trunk and Ethernet1/3 to access.  What 
happens is that Ansible pushes "switchport mode trunk" to Ethernet1/2, but 
doesn't remove "switchport access vlan 10" and "spanning-tree portfast" 
which are not needed anymore.  The behavior is consistent for both 
ios_config and eos_config.  I already tried the diff_against running 
option, but it still doesn't seem to work.  Any suggestions on how to fix 
this would be truly appreciated?  If you need more details around this, 
please let me know.

-- 
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.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/c6d60a00-ca2c-41f9-b578-a2e7134e529d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: ios_modules

2017-12-19 Thread SK
I got a response from Cisco sales representative that Ansible will not work 
on the Smart series switches as they come with limited functionality due to 
less cost.

On Tuesday, December 12, 2017 at 5:05:35 PM UTC+8, SK wrote:
>
> Have you been able to identify anything around this?  I am trying to get 
> Ansible to work on SG200 series switch and unable to.  Is it supported?
>
> Thank you in advance!
>
> On Monday, April 3, 2017 at 10:27:21 PM UTC+8, Dave wrote:
>>
>> Hi All,
>>
>> I've got a question regarding the supported platforms I hope someone can 
>> answer that. Does ansible support SG200 and SG300 switches? They do not 
>> really use the classic Cisco IOS hence I am not sure about it. Thanks in 
>> advance.
>>
>> Regards,
>> Dave
>>
>>

-- 
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.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/4ba80338-6d29-48db-a5bb-916385e710ee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: ios_modules

2017-12-12 Thread SK
Have you been able to identify anything around this?  I am trying to get 
Ansible to work on SG200 series switch and unable to.  Is it supported?

Thank you in advance!

On Monday, April 3, 2017 at 10:27:21 PM UTC+8, Dave wrote:
>
> Hi All,
>
> I've got a question regarding the supported platforms I hope someone can 
> answer that. Does ansible support SG200 and SG300 switches? They do not 
> really use the classic Cisco IOS hence I am not sure about it. Thanks in 
> advance.
>
> Regards,
> Dave
>
>

-- 
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.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/1e4d7542-58f3-4583-a5a1-45f969cf98e1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] No output from Cisco router

2017-12-08 Thread SK
Excellent!  Many thanks for the pointer and it is working now.  Is there 
any link that you could provide me regarding the best practices for 
indendations?

On Friday, December 8, 2017 at 4:19:41 PM UTC+8, Kai Stian Olstad wrote:
>
> On Friday, 8 December 2017 09.10.55 CET SK wrote: 
> > I am also facing a similar problem.  The output says "register" is not 
> > supported for ios_command module.  Any idea on this?  I am running the 
> > latest ansible version 2.4.2.0.  If I don't use the register command, 
> the 
> > playbook executes successfully, so the error is only caused by 
> > register/stdout related commands. 
> > 
> > Appreciate any help. 
> > 
> > 
> > --- 
> >  - name: Checking running cisco config 
> >hosts: cisco 
> >gather_facts: False 
> >connection: local 
> >vars_files: 
> >- creds.yml 
> > 
> >tasks: 
> > 
> > 
> >   - name: configure provider 
> > set_fact: 
> >  provider: 
> >username: "{{username}}" 
> >password: "{{password}}" 
> >host: "{{inventory_hostname}}" 
> > 
> > 
> >   - name: DEPLOY SNMP COMMANDS WITHIN PB 
> > delegate_to: localhost 
> > ios_command: 
> >provider: "{{ provider }}" 
> >commands: 
> >  - show mod | i c200 
> >register: showmod 
>
> register is a directive for the task and not the module. 
> So the register is indented to spaces to much, it should be on the same 
> level as ios_command, delegate_to and name. 
>
>
> -- 
> Kai Stian Olstad 
>

-- 
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.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/ae6568a4-5f25-4f7a-b213-ba5ced1ac194%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] No output from Cisco router

2017-12-08 Thread SK
Hi,

I am also facing a similar problem.  The output says "register" is not 
supported for ios_command module.  Any idea on this?  I am running the 
latest ansible version 2.4.2.0.  If I don't use the register command, the 
playbook executes successfully, so the error is only caused by 
register/stdout related commands.

Appreciate any help.


---
 - name: Checking running cisco config
   hosts: cisco
   gather_facts: False
   connection: local
   vars_files:
   - creds.yml

   tasks:


  - name: configure provider
set_fact:
 provider:
   username: "{{username}}"
   password: "{{password}}"
   host: "{{inventory_hostname}}"


  - name: DEPLOY SNMP COMMANDS WITHIN PB
delegate_to: localhost
ios_command:
   provider: "{{ provider }}"
   commands:
 - show mod | i c200
   register: showmod

  - debug: "msg='2c31.24a4.c200'"
when: showmod.stdout | join(" ") | search("/c200/")




PLAY [Checking running cisco config] 


TASK [configure provider] 
***
ok: [sltnrmgmt]

TASK [DEPLOY SNMP COMMANDS WITHIN PB] 
***
fatal: [sltnrmgmt -> localhost]: FAILED! => {"changed": false, "msg": 
"Unsupported parameters for (ios_command) module: register Supported 
parameters include: 
auth_pass,authorize,commands,host,interval,match,password,port,provider,retries,ssh_keyfile,timeout,username,wait_for"}
to retry, use: --limit @/etc/ansible/cisco-test.retry

PLAY RECAP 
**
sltnrmgmt  : ok=1changed=0unreachable=0failed=1


ansible --version
ansible 2.4.2.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/root/.ansible/plugins/modules', 
u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.5 (default, Nov  6 2016, 00:28:07) [GCC 4.8.5 
20150623 (Red Hat 4.8.5-11)]

-- 
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.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/3e988519-1c07-4c82-8390-ca30657bcf6d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] ansible-galaxy install is failing

2017-12-05 Thread SK
*I am following https://eos.arista.com/arista-eos-roles-for-ansible/ to 
setup Ansible for Arista devices and I am receiving the below errors:*

[root@dev14 ansible]# ansible-galaxy install arista.eos-system
 [WARNING]: - arista.eos-system was NOT installed successfully: Failed to 
get data from the API server (https://galaxy.ansible.com/api/): Connection 
to proxy failed

ERROR! - you can use --ignore-errors to skip failed roles and finish 
processing the list.
[root@dev14 ansible]# ansible-galaxy install arista.eos
 [WARNING]: - arista.eos was NOT installed successfully: Failed to get data 
from the API server (https://galaxy.ansible.com/api/): Connection to proxy 
failed

ERROR! - you can use --ignore-errors to skip failed roles and finish 
processing the list.
[root@dev14 ansible]# ansible-galaxy install arista.eos-system 
--ignore-errors
 [WARNING]: - arista.eos-system was NOT installed successfully: Failed to 
get data from the API server (https://galaxy.ansible.com/api/): Connection 
to proxy failed

[root@dev14 ansible]# ansible-galaxy install arista.eos --ignore-errors
 [WARNING]: - arista.eos was NOT installed successfully: Failed to get data 
from the API server (https://galaxy.ansible.com/api/): Connection to proxy 
failed

[root@dev14 ansible]#

*I can access the url using curl command without any issue:*

[root@dev14 ansible]# curl -I https://galaxy.ansible.com/api/
HTTP/1.1 200 Connection established

HTTP/1.1 200 OK
Allow: GET, HEAD, OPTIONS
Content-Type: application/json
Date: Wed, 06 Dec 2017 02:43:28 GMT
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5
Set-Cookie: sessionid=wlmm9uwqp9vad9z5pobql5sgn7a5xzy0; expires=Wed, 
20-Dec-2017 02:43:28 GMT; httponly; Max-Age=1209600; Path=/
Vary: Accept,Cookie
X-Frame-Options: SAMEORIGIN
Connection: keep-alive

[root@dev14 ansible]#

*Any idea where I am going wrong?  Below are the ansible and python 
versions in use.*

[root@dev14 ansible]# ansible --version
ansible 2.3.2.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides
  python version = 2.7.5 (default, Nov  6 2016, 00:28:07) [GCC 4.8.5 
20150623 (Red Hat 4.8.5-11)]
[root@dev14 ansible]# ansible-galaxy --version
ansible-galaxy 2.3.2.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides
  python version = 2.7.5 (default, Nov  6 2016, 00:28:07) [GCC 4.8.5 
20150623 (Red Hat 4.8.5-11)]
[root@dev14 ansible]#

-- 
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.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/2539e2f5-d21a-4b11-b548-6016e394db54%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Ansible network

2017-11-22 Thread SK
Excellent!  This worked now.  What did this delegate_to command actually 
do?  Did the provider under ios_config call the provider variables written 
already?

On Wednesday, November 22, 2017 at 4:35:38 PM UTC+8, Pshem Kowalczyk wrote:
>
> Hi,
>
> Try this:
>
> - name: DEPLOY SNMP COMMANDS WITHIN PB
>   delegate_to: localhost
>   ios_config:
>  provider: "{{ provider }}"
>  commands:
>- snmp-server community Test1ng rw
>
>
> (this is not tested)
>
> kind regards
> Pshem
>
>
> On Wed, 22 Nov 2017 at 20:58 SK > 
> wrote:
>
>> Hi Pshem,
>>
>> Thank you again for the assistance, the indentation problem is now solved 
>> and the playbook is running, but with errors.  I am back to the original 
>> question.  How does ansible connect to the network device?  Is it just 
>> username/password in the ansible configuration or do I need to setup any 
>> ssh keys on the Cisco network device for the Linux host running ansible to 
>> authenticate to device?
>>
>> I ran the playbook command with - option as well and almost similar 
>> error in addition to "open_shell() returned 255  failed to connect to 
>> control socket"
>>
>> Host#ansible-playbook  configs.yml
>>
>> PLAY [DEPLOY SNMP CONFIGURATIONS] 
>> 
>>
>> TASK [configure provider] 
>> 
>> ok: [sltnrmgmt]
>>
>> TASK [DEPLOY SNMP COMMANDS WITHIN PB] 
>> 
>> *fatal: [sltnrmgmt]: FAILED! => {"changed": false, "failed": true, "msg": 
>> "unable to open shell. Please see: 
>> https://docs.ansible.com/ansible/network_debug_troubleshooting.html#unable-to-open-shell
>>  
>> <https://docs.ansible.com/ansible/network_debug_troubleshooting.html#unable-to-open-shell>",
>>  
>> "rc": 255}*
>> to retry, use: --limit @/etc/ansible/configs.retry
>>
>> PLAY RECAP 
>> ***
>> sltnrmgmt  : ok=1changed=0unreachable=0failed=1
>>
>>
>>
>>
>> On Tuesday, November 21, 2017 at 3:31:43 PM UTC+8, Pshem Kowalczyk wrote:
>>
>>> Now the issue is caused by indentation:
>>>
>>> - name: configure provider
>>>set_fact:
>>>
>>> set_fact must start at the same position as 'name' above it.
>>>
>>> kind regards
>>> Pshem
>>>
>>>
>>> On Tue, 21 Nov 2017 at 18:39 SK  wrote:
>>>
>> Thank you for the suggestion about dash before name.  I have updated that 
>>>> and still receive the same error.  The error is pointing towards set_fact. 
>>>> I will take a look into text editors for YAML.
>>>>
>>>> ansible-playbook - configs.yml
>>>> Using /etc/ansible/ansible.cfg as config file
>>>> ERROR! Syntax Error while loading YAML.
>>>>
>>>>
>>>> The error appears to have been in '/etc/ansible/configs.yml': line 12, 
>>>> column 8, but may
>>>> be elsewhere in the file depending on the exact syntax problem.
>>>>
>>>> The offending line appears to be:
>>>>
>>>>   - name: configure provider
>>>>set_fact:
>>>>^ here
>>>>
>>>>
>>>> On Friday, November 17, 2017 at 5:16:24 PM UTC+8, Pshem Kowalczyk wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> You need a space between the dash '-' and 'name:' in the task list. 
>>>>> I suggest you find a text editor that supports YAML validation to make 
>>>>> your life easier.
>>>>>
>>>>> kind regards
>>>>> Pshem
>>>>>
>>>>>
>>

Re: [ansible-project] Ansible network

2017-11-21 Thread SK
Hi Pshem,

Thank you again for the assistance, the indentation problem is now solved 
and the playbook is running, but with errors.  I am back to the original 
question.  How does ansible connect to the network device?  Is it just 
username/password in the ansible configuration or do I need to setup any 
ssh keys on the Cisco network device for the Linux host running ansible to 
authenticate to device?

I ran the playbook command with - option as well and almost similar 
error in addition to "open_shell() returned 255  failed to connect to 
control socket"

Host#ansible-playbook  configs.yml

PLAY [DEPLOY SNMP CONFIGURATIONS] 


TASK [configure provider] 

ok: [sltnrmgmt]

TASK [DEPLOY SNMP COMMANDS WITHIN PB] 

*fatal: [sltnrmgmt]: FAILED! => {"changed": false, "failed": true, "msg": 
"unable to open shell. Please see: 
https://docs.ansible.com/ansible/network_debug_troubleshooting.html#unable-to-open-shell";,
 
"rc": 255}*
to retry, use: --limit @/etc/ansible/configs.retry

PLAY RECAP 
***
sltnrmgmt  : ok=1changed=0unreachable=0failed=1




On Tuesday, November 21, 2017 at 3:31:43 PM UTC+8, Pshem Kowalczyk wrote:
>
> Now the issue is caused by indentation:
>
> - name: configure provider
>set_fact:
>
> set_fact must start at the same position as 'name' above it.
>
> kind regards
> Pshem
>
>
> On Tue, 21 Nov 2017 at 18:39 SK > 
> wrote:
>
>> Thank you for the suggestion about dash before name.  I have updated that 
>> and still receive the same error.  The error is pointing towards set_fact. 
>> I will take a look into text editors for YAML.
>>
>> ansible-playbook - configs.yml
>> Using /etc/ansible/ansible.cfg as config file
>> ERROR! Syntax Error while loading YAML.
>>
>>
>> The error appears to have been in '/etc/ansible/configs.yml': line 12, 
>> column 8, but may
>> be elsewhere in the file depending on the exact syntax problem.
>>
>> The offending line appears to be:
>>
>>   - name: configure provider
>>set_fact:
>>^ here
>>
>>
>> On Friday, November 17, 2017 at 5:16:24 PM UTC+8, Pshem Kowalczyk wrote:
>>
>>> Hi,
>>>
>>> You need a space between the dash '-' and 'name:' in the task list. 
>>> I suggest you find a text editor that supports YAML validation to make 
>>> your life easier.
>>>
>>> kind regards
>>> Pshem
>>>
>>>
>>>
>>> On Fri, 17 Nov 2017 at 20:42 SK  wrote:
>>>
>> Hi,
>>>>
>>>> I am using Ansible for the first time to test basic commands on Network 
>>>> devices.  When I run the playbook, I am encountering errors even though 
>>>> the 
>>>> configuration looks normal.  Below is the OS of my source machine where 
>>>> Ansible is installed:
>>>>
>>>> CentOS Linux release 7.3.1611 (Core)
>>>>
>>>> My ansible version is below:
>>>>
>>>> ansible 2.3.2.0
>>>>   config file = /etc/ansible/ansible.cfg
>>>>   configured module search path = Default w/o overrides
>>>>   python version = 2.7.5 (default, Nov  6 2016, 00:28:07) [GCC 4.8.5 
>>>> 20150623 (Red Hat 4.8.5-11)]
>>>>
>>>> the config.yml file I am using to test is below:
>>>>
>>>> ---
>>>>   - name: DEPLOY SNMP CONFIGURATIONS
>>>> hosts: mgmt
>>>> gather_facts: False
>>>> connection: local
>>>> vars_files:
>>>> - creds.yml
>>>>
>>>> tasks:
>>>>
>>>>   -name: configure provider
>>>>set_fact:
>>>>  provider:
>>>>username

Re: [ansible-project] Ansible network

2017-11-20 Thread SK
Thank you for the suggestion about dash before name.  I have updated that 
and still receive the same error.  The error is pointing towards set_fact. 
I will take a look into text editors for YAML.

ansible-playbook - configs.yml
Using /etc/ansible/ansible.cfg as config file
ERROR! Syntax Error while loading YAML.


The error appears to have been in '/etc/ansible/configs.yml': line 12, 
column 8, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

  - name: configure provider
   set_fact:
   ^ here


On Friday, November 17, 2017 at 5:16:24 PM UTC+8, Pshem Kowalczyk wrote:
>
> Hi,
>
> You need a space between the dash '-' and 'name:' in the task list. 
> I suggest you find a text editor that supports YAML validation to make 
> your life easier.
>
> kind regards
> Pshem
>
>
>
> On Fri, 17 Nov 2017 at 20:42 SK > 
> wrote:
>
>> Hi,
>>
>> I am using Ansible for the first time to test basic commands on Network 
>> devices.  When I run the playbook, I am encountering errors even though the 
>> configuration looks normal.  Below is the OS of my source machine where 
>> Ansible is installed:
>>
>> CentOS Linux release 7.3.1611 (Core)
>>
>> My ansible version is below:
>>
>> ansible 2.3.2.0
>>   config file = /etc/ansible/ansible.cfg
>>   configured module search path = Default w/o overrides
>>   python version = 2.7.5 (default, Nov  6 2016, 00:28:07) [GCC 4.8.5 
>> 20150623 (Red Hat 4.8.5-11)]
>>
>> the config.yml file I am using to test is below:
>>
>> ---
>>   - name: DEPLOY SNMP CONFIGURATIONS
>> hosts: mgmt
>> gather_facts: False
>> connection: local
>> vars_files:
>> - creds.yml
>>
>> tasks:
>>
>>   -name: configure provider
>>set_fact:
>>  provider:
>>username: "{{username}}"
>>password: "{{password}}"
>>host: "{{inventory_hostname}}"
>>
>>   - name: DEPLOY SNMP COMMANDS WITHIN PB
>> ios_config:
>>   commands:
>> - snmp-server community Test1ng rw
>>
>> The content of creds.yml file is below:
>>
>> username: x
>> password: x
>>
>> grep inventory ansible.cfg
>> inventory  = /etc/ansible/inventory
>>
>> The content of the inventory file is below
>> [mgmt]
>> sltnrmgmt
>>
>> Error message I am noticing:
>>
>> ansible-playbook - configs.yml
>> Using /etc/ansible/ansible.cfg as config file
>> ERROR! Syntax Error while loading YAML.
>>
>>
>> The error appears to have been in '/etc/ansible/configs.yml': line 12, 
>> column 16, but may
>> be elsewhere in the file depending on the exact syntax problem.
>>
>> The offending line appears to be:
>>
>>   -name: configure provider
>>set_fact:
>>^ here
>>
>> *The set_fact seems to be defined the way it should be.  Appreciate any 
>> help on this.*
>>
>> Other details I am yet to figure out:
>>
>> How does Ansible communicate with Network devices by default in version 
>> 2.3?  Do I need to setup any SSH keys on the Cisco Network device?
>>
>> -- 
>> 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-proje...@googlegroups.com .
>> To post to this group, send email to ansible...@googlegroups.com 
>> .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/a58e6bb6-4e54-4c3c-94cd-faabddad33d2%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/ansible-project/a58e6bb6-4e54-4c3c-94cd-faabddad33d2%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/cc741e12-b495-4ec2-87e3-cff3d63302e8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Ansible network

2017-11-16 Thread SK
Hi,

I am using Ansible for the first time to test basic commands on Network 
devices.  When I run the playbook, I am encountering errors even though the 
configuration looks normal.  Below is the OS of my source machine where 
Ansible is installed:

CentOS Linux release 7.3.1611 (Core)

My ansible version is below:

ansible 2.3.2.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides
  python version = 2.7.5 (default, Nov  6 2016, 00:28:07) [GCC 4.8.5 
20150623 (Red Hat 4.8.5-11)]

the config.yml file I am using to test is below:

---
  - name: DEPLOY SNMP CONFIGURATIONS
hosts: mgmt
gather_facts: False
connection: local
vars_files:
- creds.yml

tasks:

  -name: configure provider
   set_fact:
 provider:
   username: "{{username}}"
   password: "{{password}}"
   host: "{{inventory_hostname}}"

  - name: DEPLOY SNMP COMMANDS WITHIN PB
ios_config:
  commands:
- snmp-server community Test1ng rw

The content of creds.yml file is below:

username: x
password: x

grep inventory ansible.cfg
inventory  = /etc/ansible/inventory

The content of the inventory file is below
[mgmt]
sltnrmgmt

Error message I am noticing:

ansible-playbook - configs.yml
Using /etc/ansible/ansible.cfg as config file
ERROR! Syntax Error while loading YAML.


The error appears to have been in '/etc/ansible/configs.yml': line 12, 
column 16, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

  -name: configure provider
   set_fact:
   ^ here

*The set_fact seems to be defined the way it should be.  Appreciate any 
help on this.*

Other details I am yet to figure out:

How does Ansible communicate with Network devices by default in version 
2.3?  Do I need to setup any SSH keys on the Cisco Network device?

-- 
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.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/a58e6bb6-4e54-4c3c-94cd-faabddad33d2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.