Configuring Solace with Ansible : ERROR! couldn't resolve module/action 'solace_client_username'
Hi there,
I am trying to use Ansible to configure solace (create client usernames and acl-profles) however i get an Error (at least one right now). The error says:
ERROR! couldn't resolve module/action 'solace_client_username'. This often indicates a misspelling, missing collection, or incorrect module path. The error appears to be in '/Users/quais/reddi_infrastructure/ansible/solace-cloud/ansible-code/playbook.create-sc-client.yml': line 10, column 5, but may be elsewhere in the file depending on the exact syntax problem. The offending line appears to be: - name: Remove Client ^ here ERROR ...
Apparently it cannot resolve module action 'solace_client_username'. I have to admit that the playbook.create-sc.client.yml was not already in the repo (written by @swenhelge I guess) (below), I had to create it.
I used this Repo and added the playbook.create-sc-client.yml which is also below https://github.com/solace-iot-team/ansible-solace/tree/master/working-with-solace-cloud
- name: Playbook to add a client named 'nemo-ansible' hosts: localhost vars: msg_vpn: reddi client_profile: default client: nemo-ansible client_password: ansible123 tasks: - name: Remove Client solace_client_username: name: "{{ client }}" msg_vpn: "{{ msg_vpn }}" state: absent - name: Add Client solace_client_username: name: "{{ client }}" msg_vpn: "{{ msg_vpn }}" settings: clientProfileName: "{{ client_profile }}" password: "{{ client_password }}" - name: Update Client password solace_client_username: name: "{{ client }}" msg_vpn: "{{ msg_vpn }}" settings: password: "{{ client_password }}_new" # not in response so always changed
Comments
-
Hi Qais,
This looks to be ansible environment glitch to me. I just tested with ansible 2.10 on my Mac (installed with pip3) and got the same error. Looks like it can't find the modules under network/solace. I'll update here when I got a fix.
What is your ansible version?1 -
Hi @arih ,
thanks for looking into this. My Ansible version is 2.10.2
I had a look at the ansible module documentation apparently these modules we need for solace don't exist (anymore).
https://docs.ansible.com/ansible/2.3/list_of_all_modules.html0 -
Hi
Just came across this discussion.The modules currently DON'T work with ansible 2.10, you would need to use something like 2.9.11, e.g.
sudo pip3 install ansible==2.9.11
, then install ansible solace via pip. See the prerequisites here - https://github.com/solace-iot-team/ansible-solace, Ricardo has also added a dedicated installation examples page - https://github.com/solace-iot-team/ansible-solace/blob/master/Install.md1 -
I had an issue similar to this,
ERROR! couldn't resolve module/action 'solace_acl_publish_topic_exception'.
To fix the issue I went into the Ansible module directory:
(/collections/ansible_collections/solace/pubsub_plus/plugins/modules)Opened the python file related to the module I was trying to use: solace_acl_publish_topic_exception.py
Under the following function I update the code block to return '<=2.13' for semp version '>= 2.14' and it worked:
def get_sempv2_version_map_key(self, semp_version: float) -> str: if semp_version <= 2.13: return '<=2.13' elif semp_version >= 2.14: return '<=2.13' #return '>=2.14'
0