Thank you, Ti.
Original Message:
Sent: Aug 28, 2024 03:07 PM
From: Tiffany.Chiapuzio-Wong
Subject: Create local admin user via ansible
You're going to want to use the "prompt:" and "answer:" parameters in the aoscx_command module you can see an example here: https://github.com/aruba/aoscx-ansible-workflows/blob/main/copy_config_using_cli_prompt.yml
An example could look like so:
- name: Enter config mode and remove User
aoscx_command:
commands:
- command: config
- command: no user test
check_all: True
prompt:
- '.*\(y\/n\)\?.*'
answer:
- y
------------------------------
Ti Chiapuzio-Wong (they/them)
HPE Aruba Networking
Original Message:
Sent: Aug 28, 2024 02:53 PM
From: zwluxx
Subject: Create local admin user via ansible
I create a local admin account with aoscx_config, but I failed to run the "no user xyz" with aoscx_config, it is expecting to type "y/n", how would I do that with aoscx_config?
Thank you.
Original Message:
Sent: Aug 28, 2024 01:37 PM
From: zwluxx
Subject: Create local admin user via ansible
I think that I figured out the issue. I need to start a "ssh-agent", even though, the test user private-key is passphraseless. After I added the key into ssh-agent, I was able to run the playbook with ssh key authentication.
Original Message:
Sent: Aug 28, 2024 12:30 PM
From: zwluxx
Subject: Create local admin user via ansible
Thank you Ti.
I finally got some time to test the aoscx_command ( show version and show run) via ssh. While I was able to run the simple playbook via user/password. I failed to run the playbook via ssh public key.
I can login into the switch with my public key, but failed with simple playbook. I also noticed that the command line option of -u, does not seem to work, it didn't overwrite the user defined in the inventory.
Is there anything I need to do for ssh-public-key authentication to work on ansible aoscx
sample_playbook.yml
- hosts: all
collections:
- arubanetworks.aoscx
gather_facts: False
tasks:
- name: show version
aoscx_command:
commands:
- 'show version'
- 'show run'
output_file: /tmp/show-test.txt
output_file_format: plain-text
sample_inventory.yml
all:
hosts:
testaruba:
ansible_host: 10.1.1.1
ansible_user: test
ansible_ssh_private_key_file: ~/.ssh/id_ed25519
ansible_connection: network_cli
ansible_network_os: arubanetworks.aoscx.aoscx
Original Message:
Sent: Aug 14, 2024 01:40 PM
From: Tiffany.Chiapuzio-Wong
Subject: Create local admin user via ansible
Hi @zwluxx!
------------------------------
Ti Chiapuzio-Wong (they/them)
HPE Aruba Networking
Original Message:
Sent: Aug 12, 2024 11:10 AM
From: zwluxx
Subject: Create local admin user via ansible
I just wonder if there is an ansible module for arubaos-cx to create local admin users via ansible, similar to cisco.nxos.nxos_user.
Thank you.
I tried to post the message last night, but I could not find it anywhere, so I post it again.