Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I created a playbook to do shelf firmware updates, but it keeps failing and says the host is unreachable. But the debug output clearly shows that it connected to the ONTAP cluster via ssh and then tried to run a bourne shell instead of using a zapi or rest call:
<72.32.19.224> ESTABLISH SSH CONNECTION FOR USER: myuser
<72.32.19.224> SSH: EXEC sshpass -d8 ssh -C -o ControlMaster=auto -o ControlPersist=60s -o 'User="myuser"' -o ConnectTimeout=10 -o ControlPath=/home/john0839/.ansible/cp/e15ac7f1e5 72.32.19.224 '/bin/sh -c '"'"'echo ~myuser && sleep 0'"'"''
<72.32.19.224> (255, '\r\r\nLast login time: 7/17/2023 11:38:14\r\r\nUnsuccessful login attempts since last login: 2\r\r\n\x07\r\nError: "/bin/sh" is not a recognized command\r\n\r\n', '')
fatal: [c-1645000-954872-lab]: UNREACHABLE! => {
"changed": false,
"msg": "Failed to connect to the host via ssh: ",
"unreachable": true
The playbook is a very simple shelf fw update (sorry, indention is lost with a paste):
---
- hosts: all
gather_facts: false
collections:
- netapp.ontap
name: ONTAP shelf firmware upgrade
tasks:
- name: shelf firmware upgrade
na_ontap_firmware_upgrade:
state: present
firmware _type: shelf
package_url: "{{ 'http://mirror.somedomain.com/storagecenter/NetApp/AllPlatforms/all_shelf_fw_16MAY2023.zip' }}"
hostname: "{{ inventory_hostname }}"
username: "{{ ansible_user }}"
password: "{{ ansible_password }}"
https: true
validate_certs: false
Solved! See The Solution
1 ACCEPTED SOLUTION
jhelms has accepted the solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Looks like I left out one very important line in the playbook:
connection: local
"The solution is the task option “connection: local” along with an inventory file containing your cluster names."
Many thanks to David Blackwell, wherever he is now.
John
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I found this thread indicating that I have to specify the cluster in the playbook and can't use an inventory file:
This defeats the purpose of using ansible to manage a large environment. And this post indicates that an inventory file CAN be used:
https://netapp.io/2019/07/17/running-a-playbook-against-multiple-ontap-clusters/
jhelms has accepted the solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Looks like I left out one very important line in the playbook:
connection: local
"The solution is the task option “connection: local” along with an inventory file containing your cluster names."
Many thanks to David Blackwell, wherever he is now.
John
