01-09-2024 08:55 AM
ay idea why I am getting this error. I am trying to run ansible playbook to my connected virtual appliance. was working before but now not working
Solved! Go to Solution.
01-09-2024 11:42 AM
Do you have a directory called '/Users/towong/git/FlashStack_IMM_Ansible/collections/ansible_collections/cisco/intersight'? If so, any reason modules are there and not in the normal collection search locations (/Users/towong/.ansible/collections:/usr/share/ansible/collections)?
If it was me I would try renaming the directory /Users/towong/git/FlashStack_IMM_Ansible/collections to something like /Users/towong/git/FlashStack_IMM_Ansible/old.collections so its not interfering and see if that helps. Maybe also try to reinstall the collections afterwards.
01-09-2024 09:16 AM
Based on the error, the ansible-playbook can't find the intersight_rest_api module. It could be a typo or module missing issue.
Please share the following command output: ansible-galaxy collection list
Also share your playbook to advise further.
Once we verify the Ansible Intersight Module is installed and the playbook looks good, to debug further, we need to get verbose output from Ansible playbook run. Add -vvvv with the ansible-playbook command. Start with a single -v and keep adding till you get some meaningful error to debug this further.
01-09-2024 09:21 AM
# /Users/xxx/.ansible/collections/ansible_collections
Collection Version
----------------------------- -------
ansible.netcommon 5.1.2
ansible.utils 2.10.3
cisco.intersight 2.0.6
cisco.nxos 5.1.0
community.vmware 3.4.0
purestorage.flasharray 1.20.0
# /usr/local/lib/python3.11/site-packages/ansible_collections
Collection Version
----------------------------- -------
amazon.aws 6.5.0
ansible.netcommon 5.2.0
ansible.posix 1.5.4
ansible.utils 2.11.0
ansible.windows 1.14.0
arista.eos 6.1.2
awx.awx 22.7.0
azure.azcollection 1.18.1
check_point.mgmt 5.1.1
chocolatey.chocolatey 1.5.1
cisco.aci 2.7.0
cisco.asa 4.0.2
cisco.dnac 6.7.5
cisco.intersight 1.0.27
cisco.ios 4.6.1
cisco.iosxr 5.0.3
cisco.ise 2.5.16
cisco.meraki 2.16.5
cisco.mso 2.5.0
cisco.nso 1.0.3
cisco.nxos 4.4.0
cisco.ucs 1.10.0
cloud.common 2.1.4
cloudscale_ch.cloud 2.3.1
community.aws 6.3.0
community.azure 2.0.0
community.ciscosmb 1.0.6
community.crypto 2.15.1
community.digitalocean 1.24.0
community.dns 2.6.2
community.docker 3.4.9
community.fortios 1.0.0
community.general 7.5.0
community.google 1.0.0
community.grafana 1.5.4
community.hashi_vault 5.0.0
community.hrobot 1.8.1
community.libvirt 1.3.0
community.mongodb 1.6.3
community.mysql 3.7.2
community.network 5.0.0
community.okd 2.3.0
community.postgresql 2.4.3
community.proxysql 1.5.1
community.rabbitmq 1.2.3
community.routeros 2.10.0
community.sap 1.0.0
community.sap_libs 1.4.1
community.skydive 1.0.0
community.sops 1.6.6
community.vmware 3.10.0
community.windows 1.13.0
community.zabbix 2.1.0
containers.podman 1.10.3
cyberark.conjur 1.2.2
cyberark.pas 1.0.23
dellemc.enterprise_sonic 2.2.0
dellemc.openmanage 7.6.1
dellemc.powerflex 1.9.0
dellemc.unity 1.7.1
f5networks.f5_modules 1.26.0
fortinet.fortimanager 2.2.1
fortinet.fortios 2.3.2
frr.frr 2.0.2
gluster.gluster 1.0.2
google.cloud 1.2.0
grafana.grafana 2.2.3
hetzner.hcloud 1.16.0
hpe.nimble 1.1.4
ibm.qradar 2.1.0
ibm.spectrum_virtualize 1.12.0
infinidat.infinibox 1.3.12
infoblox.nios_modules 1.5.0
inspur.ispim 1.3.0
inspur.sm 2.3.0
junipernetworks.junos 5.3.0
kubernetes.core 2.4.0
lowlydba.sqlserver 2.2.1
microsoft.ad 1.3.0
netapp.aws 21.7.0
netapp.azure 21.10.0
netapp.cloudmanager 21.22.0
netapp.elementsw 21.7.0
netapp.ontap 22.7.0
netapp.storagegrid 21.11.1
netapp.um_info 21.8.0
netapp_eseries.santricity 1.4.0
netbox.netbox 3.14.0
ngine_io.cloudstack 2.3.0
ngine_io.exoscale 1.1.0
ngine_io.vultr 1.1.3
openstack.cloud 2.1.0
openvswitch.openvswitch 2.1.1
ovirt.ovirt 3.2.0
purestorage.flasharray 1.21.0
purestorage.flashblade 1.14.0
purestorage.fusion 1.6.0
sensu.sensu_go 1.14.0
servicenow.servicenow 1.0.6
splunk.es 2.1.0
t_systems_mms.icinga_director 1.33.1
telekom_mms.icinga_director 1.34.1
theforeman.foreman 3.14.0
vmware.vmware_rest 2.3.1
vultr.cloud 1.10.0
vyos.vyos 4.1.0
wti.remote 1.0.5
01-09-2024 09:24 AM
i am using playbook from flashstack github repo
---
# Creating server policies specific to Converged Infrastrucure stack. These policies are used
# to configure the Server Profile Template(s)
- name: "Conifgure IMM Server Policies"
hosts: localhost
gather_facts: no
# Create Various Server Policies
roles:
- role: create_server_policies
01-09-2024 10:04 AM
Add -vvvv with the ansible-playbook command and share the output
01-09-2024 10:22 AM
ansible-playbook create_server_policies.yml -vvvv
ansible-playbook [core 2.15.5]
config file = None
configured module search path = ['/Users/towong/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/lib/python3.11/site-packages/ansible
ansible collection location = /Users/towong/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/local/bin/ansible-playbook
python version = 3.11.4 (main, Jun 20 2023, 16:59:59) [Clang 14.0.3 (clang-1403.0.22.14.1)] (/usr/local/opt/python@3.11/bin/python3.11)
jinja version = 3.1.2
libyaml = True
No config file found; using defaults
setting up inventory plugins
Loading collection ansible.builtin from
host_list declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Skipping due to inventory source not existing or not being readable by the current user
script declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
auto declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Skipping due to inventory source not existing or not being readable by the current user
yaml declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Skipping due to inventory source not existing or not being readable by the current user
ini declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Skipping due to inventory source not existing or not being readable by the current user
toml declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
redirecting (type: modules) ansible.builtin.intersight_rest_api to cisco.intersight.intersight_rest_api
Loading collection cisco.intersight from /Users/towong/git/FlashStack_IMM_Ansible/collections/ansible_collections/cisco/intersight
ERROR! couldn't resolve module/action 'intersight_rest_api'. This often indicates a misspelling, missing collection, or incorrect module path.
The error appears to be in '/Users/towong/git/FlashStack_IMM_Ansible/roles/create_server_policies/tasks/main.yml': line 3, column 3, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
# Create server policies specific to Converged Infrastrucure stack
- name: "Create IMM Server Policies"
^ here
FlashStack_IMM_Ansible towong$
01-09-2024 10:59 AM
any idea?
01-09-2024 11:42 AM
Do you have a directory called '/Users/towong/git/FlashStack_IMM_Ansible/collections/ansible_collections/cisco/intersight'? If so, any reason modules are there and not in the normal collection search locations (/Users/towong/.ansible/collections:/usr/share/ansible/collections)?
If it was me I would try renaming the directory /Users/towong/git/FlashStack_IMM_Ansible/collections to something like /Users/towong/git/FlashStack_IMM_Ansible/old.collections so its not interfering and see if that helps. Maybe also try to reinstall the collections afterwards.
01-09-2024 12:18 PM
yes that was it. but now i get a different error
The full traceback is:
File "/var/folders/0x/b8776q3d3r92tmhjw6pkb9hh0028xg/T/ansible_intersight_rest_api_payload_t0fthg86/ansible_intersight_rest_api_payload.zip/ansible_collections/cisco/intersight/plugins/module_utils/intersight.py", line 243, in call_api
raise RuntimeError(info['status'], info['msg'], info['body'])
~~~~^^^^^^^^
fatal: [localhost]: FAILED! => {
"changed": false,
"invocation": {
"module_args": {
"api_body": null,
"api_key_id": "652aafb0756461301e44d5bf/652b6d6e756461301e451eab/6567c51a756461301ea7d371",
"api_private_key": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
"api_uri": "https://xxxxxxx/api/v1",
"list_body": null,
"query_params": {
"$filter": "Name eq 'default'"
},
"resource_path": "/organization/Organizations",
"return_list": false,
"state": "present",
"update_method": "patch",
"use_proxy": true,
"validate_certs": true
}
},
"msg": "API error: 'body' "
}
NO MORE HOSTS LEFT *************************************
01-09-2024 12:22 PM
ok figured it out added validate_certs: 'False'
now its working. Thank you very much
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide