1

With Ansible 2.3 for the Core modules junos_config we get error "unable to open shell".

My playbook

25      tasks:
26        - name:          Build configuration
27          template:      src={{ playbook_dir }}/bgp.j2 dest={{ build }}/{{ inventory_hostname }}.conf
28          notify:
29            -            Pushing config ... please wait
30      handlers:
31        - name:          Pushing config ... please wait
32          junos_config:
33            host:        "{{ inventory_hostname }}"
34            provider:    "{{ credentials }}"
35            src:         "{{ build }}/{{ inventory_hostname }}.conf"
36            src_format:  set
37            comment:     "config by Ansible junos_config"

output:

seanw@seanw-mbp:~/bgp$ ansible-playbook pb2.bgp.yml

 PLAY [Create config/build directory] 
 *******************************************

 TASK [Remove build directory] 
 **************************************************
 changed: [localhost]


 RUNNING HANDLER [Pushing config ... please wait] 
******************************************************
fatal: [vsrx1]: 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}
fatal: [vsrx2]: 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}

This works in Ansible 2.2

Nitin Kr
  • 521
  • 2
  • 12

1 Answers1

2

In Ansible-2.3, the check for SSH host key is done by default. Due to this check you might be encountering this error. You may want to try disabling this setting temporarily in ansible.cfg

More details are here: http://docs.ansible.com/ansible/intro_configuration.html#host-key-checking

Community
  • 1
  • 1
Nitin Kr
  • 521
  • 2
  • 12