Thanks
I am still getting another error message 

ansible@ansible-new:/etc/ansible$ ansible-playbook -i hosts 
backup_config-junos-facts.yml
PLAY [collect default set of facts] 
********************************************
TASK [Gathering Facts] 
*********************************************************
fatal: [10.101.250.41]: FAILED! => {"msg": "failed to transfer file to 
/tmp/tmpoJI85F error: unknown command: /bin/sh/setup.py:\n\nscp: error: 
unknown command: /bin/sh/setup.py: No such file or directory\n"}
 [WARNING]: Could not create retry file '/etc/ansible/backup_config-junos-
facts.retry'.         [Errno 13] Permission denied: u'/etc/ansible
/backup_config-junos-facts.retry'

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



ansible@ansible-new:/etc/ansible$ tail -f 
ansible.log                           2018-02-12 14:48:12,297 p=31643 
u=ansible |  10.101.250.41              : ok=0    changed=0    
unreachable=0    failed=1
2018-02-12 14:52:07,004 p=31666 u=ansible |  PLAY [collect default set of 
facts] ********************************************
2018-02-12 14:52:07,011 p=31666 u=ansible |  TASK [Gathering Facts] 
*********************************************************
2018-02-12 14:52:12,906 p=31666 u=ansible |  fatal: [10.101.250.41]: 
FAILED! => {"msg": "failed to transfer file to /tmp/tmpoJI85F error: 
unknown command: /bin/sh/setup.py:\n\nscp: error: unknown command: 
/bin/sh/setup.py: No such file or directory\n"}
2018-02-12 14:52:12,908 p=31666 u=ansible |   [WARNING]: Could not create 
retry file '/etc/ansible/backup_config-junos-
facts.retry'.         [Errno 13] Permission denied: u'/etc/ansible
/backup_config-junos-facts.retry'
2018-02-12 14:52:12,908 p=31666 u=ansible |  PLAY RECAP 
*********************************************************************
2018-02-12 14:52:12,908 p=31666 u=ansible |  10.101.250.41              : 
ok=0  





On Monday, February 12, 2018 at 2:41:15 PM UTC, Kai Stian Olstad wrote:

> On Monday, 12 February 2018 11.51.55 CET 'Daley Okuwa' via Ansible Project 
> wrote: 
> > I am trying to backup my config on a router 
> > but I want to use the login details on the router for ansible e.g admin 
> as 
> > written below to use to log into the router and not the ansible user on 
> the 
> > ansible server 
> > Please tell me how I can do this . 
> > when this playbook is run it uses the ansible user to log in 
> > 
> > 
> > - name: collect default set of facts 
> >   hosts: 10.101.250.41 
> >   tasks: 
> >   - name: collect default sets of facts and configuration 
> >     junos_facts: 
> >       gather_subset: config 
> >       username: admin 
> >       password: xxxxx 
>
> When connecting to network devices you need to use "connection: local" on 
> the play or "delegate_to: localhost" on the task. 
>
>
> -- 
> 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/6ed6ec30-40c2-4117-a8b7-cba6c62f1255%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to