CiscoDevNet / ansible-aci

Cisco ACI Ansible Collection
https://galaxy.ansible.com/cisco/aci
GNU General Public License v3.0
133 stars 91 forks source link

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

Closed shrsr closed 2 weeks ago

akinross commented 3 months ago

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.

lhercot commented 2 months ago

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