Try PubSub+

Configuring Solace with Ansible : ERROR! couldn't resolve module/action 'solace_client_username'

QaisQais Member Posts: 9
edited October 9 in PubSub+ Event Broker

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

  • ariharih Member, Employee Posts: 38 Solace Employee

    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?

  • QaisQais Member Posts: 9

    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.html

  • ariharih Member, Employee Posts: 38 Solace Employee

    Hi Qais,

    I'm not sure about the Ansible 2.3 list of modules there, but I just quickly try and use my Ubuntu VM with Ansible 2.9.6, and put the Ansible-solace modules in my local plugin dir and it works as expected.

  • QaisQais Member Posts: 9

    @arih okay that helps. But are the modules somewhere in the Repo? or do you get them from somewhere else?

  • ariharih Member, Employee Posts: 38 Solace Employee

    Hi @Qais , I used pip as shown in the repo, but then I just copy over the modules to my own plugin folder from wherever the pip installs it. That is just one way to do things tough, you can check Ansible doc on other ways to use modules.

  • swenhelgeswenhelge Member, Employee Posts: 46 Solace Employee
    edited October 12

    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.md

Sign In or Register to comment.