cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
998
Views
1
Helpful
9
Replies

ERROR! couldnt resolve module/action 'intersight_rest_api'

tdubb123
Level 1
Level 1

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

1 Accepted Solution

Accepted Solutions

Brian Morrissey
Cisco Employee
Cisco Employee

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.

View solution in original post

9 Replies 9

Sandeep Kumar
Cisco Employee
Cisco Employee

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. 

 

# /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

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

 

---
# Create Pools
- name: "Create IMM Pools"
vars:
api_info: &api_info_org_moid
api_private_key: "{{ api_private_key }}"
api_key_id: "{{ api_key_id }}"
api_uri: "{{ api_uri | default(omit) }}"
validate_certs: "{{ validate_certs | default(omit) }}"
state: "{{ state | default(omit) }}"
intersight_rest_api:
<<: *api_info_org_moid
resource_path: /organization/Organizations
query_params:
$filter: "Name eq '{{ org_name }}'"
register: intersight_org
delegate_to: localhost
tags: always
run_once: true

# Create IP Pool for Management
- include_tasks: create_ip_pools.yml
#
# Create MAC Pools for FI-A and FI-B
- include_tasks: create_mac_pools.yml
#
# Create UUID Pool
- include_tasks: create_uuid_pool.yml
#
# Create IQN pool only if configure_iscsi value is set to true in group_vars/all.yml
- include_tasks: create_iqn_pools.yml
when: configure_iscsi == 'true'
#
# Create iSCSI IP pools only if configure_iscsi value is set to true in group_vars/all.yml
- include_tasks: create_iscsi_pools.yml
# when: configure_iscsi == 'true'
#
# Create FC WWN and WWPN pools only if configure_fc value is set to true in group_vars/all.yml
- include_tasks: create_fc_ww_pools.yml
when: configure_fc == 'true'


Ruben Cocheno
Spotlight
Spotlight

@tdubb123 

 Add -vvvv with the ansible-playbook command and share the output

Tag me to follow up.
Please mark it as Helpful and/or Solution Accepted if that is the case. Thanks for making Engineering easy again.
Connect with me for more on Linkedin https://www.linkedin.com/in/rubencocheno/

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$

any idea?

Brian Morrissey
Cisco Employee
Cisco Employee

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.

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 *************************************

ok figured it out added validate_certs: 'False'

 

now its working. Thank you very much

Review Cisco Networking for a $25 gift card