brocade / ansible

56 stars 33 forks source link

brocade_security_sec_crypto_cfg_template_action - Import fails with bracket in remote_user_password #78

Closed mamoep closed 3 years ago

mamoep commented 3 years ago

I don't know if this is a limitation of the REST API or some issue with the Base64 encoding, but the remote connection for import is not established when there is a bracket in the remote_user_password value. I can see in the connection logs, that the switch doesn't even try to connect to the remote host. After I changed the password to include a different special character the issue was gone.

  - hosts: test
    become: false
    collections:
      - brocade.fos
    gather_facts: false
    name: Cipher template test
    vars:
      login: &login
        fos_user_name: "{{ username }}"
        fos_password: "{{ password }}"
        https: self
    tasks:
    - name: Cipher template import
      brocade_security_sec_crypto_cfg_template_action:
        credential:
          fos_ip_addr: "{{ inventory_hostname }}"
          <<: *login
        vfid: -1
        action_inputs:
          remote_user_name: user
          remote_host_ip: "xx.xx.xx.xx"
          remote_user_password: "abc)d1"
          remote_directory: "/tmp/test.file"
          file_transfer_protocol_type: scp
          template_name: new_template
          action: import
      connection: local
daniel-chung-broadcom commented 3 years ago

Sorry for the late response. We narrowed the issue down to rest limitations but having delays in identifying the documentation that we can share. We'll try to get back to you shortly.

mamoep commented 3 years ago

Any news on this topic?

daniel-chung-broadcom commented 3 years ago

The following characters are not supported in the password.

" Not supported $ Not supported & Not supported Apostrophe Not supported ( Not supported ) Not supported ; Not supported < Not supported = Not supported

Not supported \ Not supported ` Not supported | Not supported space Not supported

Please let me know if this resolves this issue. Thanks.

mamoep commented 3 years ago

Is this a limitation of the REST API or the Ansible module? Could you add that to the documentation?

daniel-chung-broadcom commented 3 years ago

These are specifically related to REST API. Since Brocade Ansible modules use REST API to communicate with FOS switches, the behavior is reflected on the Ansible modules as well.

The REST behavior is documented in detail under github.com/brocade/yang in general and this behavior will also be documented there as well.

daniel-chung-broadcom commented 3 years ago

closing based on the latest answers. Please reopen with comments if any additional clarification is needed. Thanks.