ansible-aci icon indicating copy to clipboard operation
ansible-aci copied to clipboard

Private Key specified in the task is not taken into consideration when httpapi plugin is enabled

Open shrsr opened this issue 1 year ago • 1 comments

shrsr avatar Feb 26 '24 19:02 shrsr

Tested with latest code and below playbook and works and works.

---
- name: My playbook
  hosts: aci
  gather_facts: false

  tasks:
    - name: Set vars
      ansible.builtin.set_fact:
        aci_info: &aci_info
          private_key: "{{ lookup('file', '<path-to-key>.key') }}"
          output_level: debug

    - name: Query all tenants
      cisco.aci.aci_tenant: &tenant
        <<: *aci_info
        state: query

below inventory was used

[aci]
apic ansible_host=<IP>

[aci:vars]
ansible_user=<user>
ansible_connection=ansible.netcommon.httpapi
ansible_network_os=cisco.aci.aci
ansible_httpapi_validate_certs=False
ansible_httpapi_use_ssl=True

@shrsr, @lhercot I think we can close this issue.

akinross avatar Mar 06 '24 14:03 akinross

The actual issue is when you pass the path directly which is supported in the non-plugin way. Like:

---
- name: My playbook
  hosts: aci
  gather_facts: false

  tasks:
    - name: Set vars
      ansible.builtin.set_fact:
        aci_info: &aci_info
          private_key: "<path-to-key>.key"
          output_level: debug

    - name: Query all tenants
      cisco.aci.aci_tenant: &tenant
        <<: *aci_info
        state: query

lhercot avatar Apr 23 '24 21:04 lhercot