---
- name: configure hostapd on Cumulus Linux
  hosts: cumulus
  become: true
  gather_facts: False
  
  collections:
    - inverse_inc.cumulus

  pre_tasks:
  - name: wait for SSH available before provisioning
    wait_for_connection:

  roles:
    - role: hostapd
    - role: restserver

  post_tasks:
  - name: Change {{ switch01_api_user }} password user
    ansible.builtin.user:
      name: "{{ switch01_api_user }}"
      password: "{{ switch01_api_password | password_hash }}"
      force: true
