# errors in backing up a config from a juniper device

**URL:** <https://forum.ansible.com/t/errors-in-backing-up-a-config-from-a-juniper-device/26640>\
**Category:** Ansible Project\
**Created:** [February 2, 2018, 11:52am UTC](https://forum.ansible.com/t/errors-in-backing-up-a-config-from-a-juniper-device/26640 "2018-02-02T11:52:16Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![DOkuwa](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/dokuwa/32/1471_2.png) [@DOkuwa](https://forum.ansible.com/u/DOkuwa)\
**Post date:** [February 2, 2018, 11:52am UTC](https://forum.ansible.com/t/errors-in-backing-up-a-config-from-a-juniper-device/26640/1 "2018-02-02T11:52:16Z")

</div>

hello all  
I have this in my backup\_config\_yaml

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [February 2, 2018, 1:34pm UTC](https://forum.ansible.com/t/errors-in-backing-up-a-config-from-a-juniper-device/26640/2 "2018-02-02T13:34:16Z")

</div>

As the error message say, there is some problem with you module.  
When I check the documentation  
[https://docs.ansible.com/ansible/latest/list\_of\_network\_modules.html#junos](https://docs.ansible.com/ansible/latest/list_of_network_modules.html#junos)  
there is no module called junos\_get\_config, the closes is junos\_config.

---

<div class="post-metadata">

**Author:** ![DOkuwa](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/dokuwa/32/1471_2.png) [@DOkuwa](https://forum.ansible.com/u/DOkuwa)\
**Post date:** [February 2, 2018, 2:32pm UTC](https://forum.ansible.com/t/errors-in-backing-up-a-config-from-a-juniper-device/26640/3 "2018-02-02T14:32:06Z")

</div>

thanks

I have changed the code from a junos\_get\_config to junos\_config. and this is the error message I got  
nsible@ansible-new:/etc/ansible$ ansible-playbook -i hosts backup\_config-junos.yml  
PLAY [BACKUP CONFIGS OF JUNOS DEVICES] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
TASK [GET CONFIG] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
fatal: [10.101.250.41]: FAILED! =\> {“changed”: false, “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)”}  
[WARNING]: Could not create retry file ‘/etc/ansible/backup\_config-  
junos.retry’. [Errno 13] Permission denied: u’/etc/ansible  
/backup\_config-junos.retry’

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

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [February 2, 2018, 2:37pm UTC](https://forum.ansible.com/t/errors-in-backing-up-a-config-from-a-juniper-device/26640/4 "2018-02-02T14:37:44Z")

</div>

Did you at all read the error message?  
The error message even have a link on what you need to do?

---

<div class="post-metadata">

**Author:** ![DOkuwa](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/dokuwa/32/1471_2.png) [@DOkuwa](https://forum.ansible.com/u/DOkuwa)\
**Post date:** [February 2, 2018, 3:38pm UTC](https://forum.ansible.com/t/errors-in-backing-up-a-config-from-a-juniper-device/26640/5 "2018-02-02T15:38:15Z")

</div>

I have gone to that website to troubleshoot but I still cant get it

ansible@ansible-new:/etc/ansible$ ansible-playbook -vvvv -i hosts backup\_config-junos.yml  
[WARNING]: log file at /var/log/ansible.log is not writeable and we cannot create it, aborting  
ansible-playbook 2.4.2.0  
config file = /etc/ansible/ansible.cfg  
configured module search path = [u’/home/ansible/.ansible/plugins/modules’, u’/usr/share/ansible/plugins/modules’]  
ansible python module location = /usr/lib/python2.7/dist-packages/ansible  
executable location = /usr/bin/ansible-playbook  
python version = 2.7.12 (default, Dec 4 2017, 14:50:18) [GCC 5.4.0 20160609]  
Using /etc/ansible/ansible.cfg as config file  
setting up inventory plugins  
Parsed /etc/ansible/hosts inventory source with ini plugin  
Loading callback plugin default of type stdout, v2.0 from /usr/lib/python2.7/dist-packages/ansible/plugins/callback/ **init**.pyc  
PLAYBOOK: backup\_config-junos.yml \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
1 plays in backup\_config-junos.yml  
PLAY [BACKUP CONFIGS OF JUNOS DEVICES] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
META: ran handlers  
TASK [GET CONFIG] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
task path: /etc/ansible/backup\_config-junos.yml:10  
\<10.101.250.41\> using connection plugin netconf  
\<10.101.250.41\> socket\_path: None  
fatal: [10.101.250.41]: FAILED! =\> {  
“changed”: false,  
“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)”  
}  
[WARNING]: Could not create retry file ‘/etc/ansible/backup\_config-  
junos.retry’. [Errno 13] Permission denied: u’/etc/ansible  
/backup\_config-junos.retry’

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

---

<div class="post-metadata">

**Author:** ![DOkuwa](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/dokuwa/32/1471_2.png) [@DOkuwa](https://forum.ansible.com/u/DOkuwa)\
**Post date:** [February 5, 2018, 11:49am UTC](https://forum.ansible.com/t/errors-in-backing-up-a-config-from-a-juniper-device/26640/6 "2018-02-05T11:49:44Z")

</div>

still debugging my issues  
I thought it was a netconf issue and enabled netconf over ssh on the devices  
still having the same issue  
2018-02-05 11:46:33,654 p=17538 u=ansible | PLAY [BACKUP CONFIGS OF JUNOS DEVICES] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
2018-02-05 11:46:33,668 p=17538 u=ansible | TASK [GET CONFIG] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
2018-02-05 11:46:34,155 p=17546 u=ansible | creating new control socket for host 10.101.250.41:22 as user None  
2018-02-05 11:46:34,155 p=17546 u=ansible | control socket path is /home/ansible/.ansible/pc/cbc044ebbc  
2018-02-05 11:46:34,155 p=17546 u=ansible | current working directory is /etc/ansible  
2018-02-05 11:46:34,156 p=17546 u=ansible | using connection plugin netconf  
2018-02-05 11:46:34,208 p=17546 u=ansible | network\_os is set to junos  
2018-02-05 11:46:34,210 p=17546 u=ansible | ssh connection done, stating ncclient  
2018-02-05 11:46:44,192 p=17538 u=ansible | fatal: [10.101.250.41]: FAILED! =\> {“changed”: false, “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)”}  
2018-02-05 11:46:44,194 p=17538 u=ansible | [WARNING]: Could not create retry file ‘/etc/ansible/backup\_config-junos.retry’. [Errno 13] Permission denied: u’/etc/ansible/backup\_config-junos.retry’  
2018-02-05 11:46:44,194 p=17538 u=ansible | PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
2018-02-05 11:46:44,194 p=17538 u=ansible | 10.101.250.41 : ok=0 changed=0 unreachable=0 failed=1  
2018-02-05 11:46:44,221 p=17546 u=ansible | failed to create control socket for host 10.101.250.41  
2018-02-05 11:46:44,222 p=17546 u=ansible | Traceback (most recent call last):  
File “/usr/bin/ansible-connection”, line 315, in main  
server = Server(socket\_path, pc)  
File “/usr/bin/ansible-connection”, line 112, in **init**  
self.connection.\_connect()  
File “/usr/lib/python2.7/dist-packages/ansible/plugins/connection/netconf.py”, line 158, in \_connect  
ssh\_config=ssh\_config  
File “build/bdist.linux-x86\_64/egg/ncclient/manager.py”, line 154, in connect  
return connect\_ssh(\*args, \*\*kwds)  
File “build/bdist.linux-x86\_64/egg/ncclient/manager.py”, line 119, in connect\_ssh  
session.connect(\*args, \*\*kwds)  
File “build/bdist.linux-x86\_64/egg/ncclient/transport/ssh.py”, line 383, in connect  
raise SSHError(“Could not open socket to %s:%s” % (host, port))  
SSHError: Could not open socket to 10.101.250.41:22

---

<div class="post-metadata">

**Author:** ![DOkuwa](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/dokuwa/32/1471_2.png) [@DOkuwa](https://forum.ansible.com/u/DOkuwa)\
**Post date:** [February 5, 2018, 4:36pm UTC](https://forum.ansible.com/t/errors-in-backing-up-a-config-from-a-juniper-device/26640/7 "2018-02-05T16:36:57Z")

</div>



---

<div class="post-metadata">

**Author:** ![DOkuwa](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/dokuwa/32/1471_2.png) [@DOkuwa](https://forum.ansible.com/u/DOkuwa)\
**Post date:** [February 7, 2018, 9:45am UTC](https://forum.ansible.com/t/errors-in-backing-up-a-config-from-a-juniper-device/26640/8 "2018-02-07T09:45:58Z")

</div>

still getting the error messages

tail -f ansible.log  
self.\_cipher = factory.new(key, \*args, \*\*kwargs)  
2018-02-07 09:37:38,933 p=24501 u=ansible | connecting to host 10.101.250.41 returned an error  
2018-02-07 09:37:38,933 p=24501 u=ansible | Unknown host key [b4:5c:23:06:c0:6e:3f:b3:f0:2e:de:30:6d:75:a1:dd] for [10.101.250.41]  
2018-02-07 09:37:47,827 p=24493 u=ansible | fatal: [10.101.250.41]: FAILED! =\> {“changed”: false, “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)”}  
2018-02-07 09:37:47,828 p=24493 u=ansible | [WARNING]: Could not create retry file ‘/etc/ansible/backup\_config-  
junos.retry’. [Errno 13] Permission denied: u’/etc/ansible  
/backup\_config-junos.retry’

---

<div class="post-metadata">

**Author:** ![DOkuwa](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/dokuwa/32/1471_2.png) [@DOkuwa](https://forum.ansible.com/u/DOkuwa)\
**Post date:** [February 8, 2018, 9:24am UTC](https://forum.ansible.com/t/errors-in-backing-up-a-config-from-a-juniper-device/26640/9 "2018-02-08T09:24:41Z")

</div>

another error message  
ansible@ansible-new:/etc/ansible$ tail -f ansible.log  
2018-02-08 09:21:54,543 p=26612 u=ansible | socket operation completed with rc 0  
2018-02-08 09:21:54,543 p=26612 u=ansible | socket operation is RUN  
2018-02-08 09:21:54,543 p=26612 u=ansible | socket operation completed with rc 0  
2018-02-08 09:21:54,758 p=26604 u=ansible | fatal: [10.101.250.41]: FAILED! =\> {“changed”: false, “msg”: “Unsupported parameters for (junos\_config) module: dest Supported parameters include: backup,comment,confirm,confirm\_commit,host,lines,password,port,provider,replace,rollback,src,src\_format,ssh\_keyfile,timeout,transport,update,username,zeroize”}  
2018-02-08 09:21:54,760 p=26604 u=ansible | [WARNING]: Could not create retry file ‘/etc/ansible/backup\_config-  
junos.retry’. [Errno 13] Permission denied: u’/etc/ansible  
/backup\_config-junos.retry’  
2018-02-08 09:21:54,760 p=26604 u=ansible | PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
2018-02-08 09:21:54,760 p=26604 u=ansible | 10.101.250.41 : ok=0 changed=0 unreachable=0 failed=1  
2018-02-08 09:22:24,543 p=26612 u=ansible | persistent connection idle timeout triggered, timeout value is 30 secs  
2018-02-08 09:22:24,543 p=26612 u=ansible | shutdown persistent connection requested  
2018-02-08 09:22:24,543 p=26612 u=ansible | closing local listener  
2018-02-08 09:22:24,543 p=26612 u=ansible | closing the connection  
2018-02-08 09:22:24,544 ncclient.operations.rpc Requesting ‘CloseSession’  
2018-02-08 09:22:24,608 p=26612 u=ansible | removing the local control socket  
2018-02-08 09:22:24,608 p=26612 u=ansible | shutdown complete  
2018-02-08 09:22:24,608 p=26612 u=ansible | shutdown persistent connection requested  
2018-02-08 09:22:24,608 p=26612 u=ansible | persistent connection is not active  
2018-02-08 09:22:24,608 p=26612 u=ansible | shutdown local socket, connection was active for 0:00:39.071942 secs

Thanks
