semaphore/Create_User_aruba.yml

26 lines
892 B
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
- name: Créer / mettre à jour un utilisateur local admin sur Aruba CX
hosts: switch_aruba
gather_facts: no
connection: network_cli # < IMPORTANT : on parle à un équipement réseau
collections:
- arubanetworks.aoscx
vars:
ansible_network_os: arubanetworks.aoscx.aoscx # < IMPORTANT aussi
tasks:
- name: Vérifier que les variables nécessaires sont définies
ansible.builtin.assert:
that:
- new_user is defined
- new_pass is defined
fail_msg: "Les variables new_user et new_pass doivent être fournies via Semaphore (Survey)."
- name: Créer / mettre à jour l'utilisateur (groupe administrators)
aoscx_command:
commands:
- "configure terminal"
- "user {{ new_user }} group administrators password plaintext {{ new_pass }}"
- "exit"
no_log: true