I'm having fun with the new Ansible collection!
I wonder there is a way to get some debug info. I strugle with creating NTP assigned to a fabric. The task fails, but the NTP config is created. So some debugging may help figure out why it states to be failed.
Next time I run the play it's green and listed as created.
When the task fails my role stops, so it would be cool to figure out why I get an error.
Test playbook:
---
- name: Playbook test NTP
hosts: platform_aoscx
gather_facts: false
tasks:
- name: Configure NTP
arubanetworks.afc.afc_ntp:
afc_ip: "{{ config_context.afc_host }}"
afc_username: "{{ afc_username }}"
afc_password: "{{ afc_password }}"
operation: 'create'
data:
name: "{{ config_context.afc_fabric }}-NTP"
fabrics:
- "{{ config_context.afc_fabric }}"
servers:
- server: "{{ config_context.ntp_servers.0.server }}"
# burst_mode: "iburst"
# perfer: true
delegate_to: localhost
running: ansible-playbook -l z16-leaf-1 test_ntp.yml -vvvv
Output from task:
TASK [Configure NTP] *************************************************************************************************************************************************************************
task path: /home/arne/code/ao-fabric/test_ntp.yml:6
<localhost> ESTABLISH LOCAL CONNECTION FOR USER: arne
<localhost> EXEC /bin/sh -c 'echo ~arne && sleep 0'
<localhost> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/arne/.ansible/tmp `"&& mkdir "` echo /home/arne/.ansible/tmp/ansible-tmp-1745170667.2155805-29673-193779388731084 `" && echo ansible-tmp-1745170667.2155805-29673-193779388731084="` echo /home/arne/.ansible/tmp/ansible-tmp-1745170667.2155805-29673-193779388731084 `" ) && sleep 0'
Using module file /home/arne/code/ao-fabric/collections/ansible_collections/arubanetworks/afc/plugins/modules/afc_ntp.py
<localhost> PUT /home/arne/.ansible/tmp/ansible-local-29414o81onvid/tmpld88vr3z TO /home/arne/.ansible/tmp/ansible-tmp-1745170667.2155805-29673-193779388731084/AnsiballZ_afc_ntp.py
<localhost> EXEC /bin/sh -c 'chmod u+x /home/arne/.ansible/tmp/ansible-tmp-1745170667.2155805-29673-193779388731084/ /home/arne/.ansible/tmp/ansible-tmp-1745170667.2155805-29673-193779388731084/AnsiballZ_afc_ntp.py && sleep 0'
<localhost> EXEC /bin/sh -c '/home/arne/code/ao-fabric/venv/bin/python3 /home/arne/.ansible/tmp/ansible-tmp-1745170667.2155805-29673-193779388731084/AnsiballZ_afc_ntp.py && sleep 0'
<localhost> EXEC /bin/sh -c 'rm -f -r /home/arne/.ansible/tmp/ansible-tmp-1745170667.2155805-29673-193779388731084/ > /dev/null 2>&1 && sleep 0'
[WARNING]: Module did not set no_log for afc_password
fatal: [z16-leaf-1 -> localhost]: FAILED! => {
"changed": false,
"invocation": {
"module_args": {
"afc_ip": "172.16.3.29",
"afc_password": "xxxxxx",
"afc_username": "admin",
"auth_token": null,
"data": {
"fabrics": [
"test_fabric"
],
"name": "test_fabric-NTP",
"servers": [
{
"server": "klokke.opdal.net"
}
]
},
"operation": "create"
}
},
"msg": "edfdb886-33f9-459c-9f03-f972101cc2b9"
}
PLAY RECAP ***********************************************************************************************************************************************************************************
z16-leaf-1 : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
------------------------------
Arne Opdal
------------------------------
Original Message:
Sent: Apr 09, 2025 12:11 PM
From: Tiffany.Chiapuzio-Wong
Subject: Python SDK and Ansible Collection for HPE Aruba Fabric Composer Released!
Hello all! It is with great pleasure that I'm able to announce the publishing of the pyafc Python SDK and the HPEANFC Ansible Collection! You can find detailed guides on how to get started with these packages on our HPE Aruba Networking Developer Hub:
Getting Started with Pyafc
Getting Started with Ansible and HPEANFC
To install these packages run the following commands:
pip install pyafc
ansible-galaxy collection install arubanetworks.afc
Happy Automating!
------------------------------
Ti Chiapuzio-Wong (they/them)
HPE Aruba Networking
------------------------------