First of all, I am still learning Ansible, so there is a very real possibility this is user error, but here is my issue:
When I try to log in using the sros module, regardless of the username I am using in the yml file, it is using my username from the ansible host machine
Here is the yml:
---
- name: Test SROS in lab
hosts: lab-12e
vars:
cli:
host: "{{ inventory_hostname }}"
username: ansible
ssh_keyfile: /home/nkeeling/ansible/rsa-keys/ansible_rsa.pub
transport: cli
tasks:
- name: run show version on remote devices
sros_command:
commands: show version
provider: "{{ cli }}"
This was taken directly from the examples for the module. When I run the module, I get a failure:
nkeeling@eng-tools:~/ansible$ ansible-playbook sros_test.yml
PLAY [Test SROS in lab] ********************************************************
TASK [setup] *******************************************************************
fatal: [192.168.253.137]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: TiMOS-C-13.0.R4 cpm/hops64 ALCATEL SR 7750 Copyright (c) 2000-2015 Alcatel-Lucent.\r\nAll rights reserved. All use subject to applicable license agreements.\r\nBuilt on Wed Jul 29 16:27:26 PDT 2015 by builder in /rel13.0/b1/R4/panos/main\r\nThis computer system is the property of xxxxxxxxx Networks. It is for authorized use only. Users (authorized or unauthorized) have no explicit or implicit expectation of privacy. Unauthorized or improper use of this system may result in administrative disciplinary action and civil and criminal penalties. \r\nPermission denied (publickey,password).\r\n", "unreachable": true}
to retry, use: --limit @/home/nkeeling/ansible/sros_test.retry
PLAY RECAP *********************************************************************
192.168.253.137 : ok=0 changed=0 unreachable=1 failed=0
When I look at the security log on my SR-OS device, I see:
64 2001/02/23 22:41:40.17 PST MINOR: SECURITY #2011 Base nkeeling
"User nkeeling from 172.17.25.236 failed authentication"
I have tried setting the username in multiple places in the yml file, with no change in the result. If anyone is able to steer me in the right direction, it would be VERY much appreciated!