Files
ansible user 110301f862 first commit
2025-10-22 14:11:49 +02:00

34 lines
903 B
YAML

---
- name: Reset radios on a host and show brief status
hosts: all
gather_facts: no
tasks:
- name: Bounce ath0 and ath1 with ifconfig
ansible.builtin.raw: |
set -e
PATH=/sbin:/usr/sbin:/bin:/usr/bin:$PATH
ifconfig ath0 down
sleep 2
ifconfig ath0 up
ifconfig ath1 down
sleep 1
ifconfig ath1 up
register: reset_out
changed_when: true
- name: Wait 2s for interfaces to settle (controller-side)
ansible.builtin.pause:
seconds: 2
- name: Grab brief ath0/ath1 status (header + one following line)
ansible.builtin.raw: |
PATH=/sbin:/usr/sbin:/bin:/usr/bin:$PATH
iwconfig 2>/dev/null | grep -E '^(ath0|ath1)\b' -A 1
register: iw_out
changed_when: false
- name: Show ath0/ath1 status
ansible.builtin.debug:
msg: "{{ iw_out.stdout | trim }}"