48 lines
1.1 KiB
YAML
48 lines
1.1 KiB
YAML
---
|
|
- name: WiFiDebug scheduler wrapper
|
|
hosts: all
|
|
gather_facts: false
|
|
|
|
vars:
|
|
sot_wrapper_mode: true
|
|
|
|
tasks:
|
|
- name: Run sot-updater-iponly in wrapper mode
|
|
import_playbook: sot-updater-iponly.yml
|
|
|
|
- name: Extract NetBox IP from preflight output
|
|
set_fact:
|
|
nb_ip: >-
|
|
{{
|
|
(nb_preflight.stdout_lines
|
|
| select('match', '^NB_IP=')
|
|
| list
|
|
| first
|
|
| regex_replace('^NB_IP=', '')
|
|
) | default('')
|
|
}}
|
|
when:
|
|
- nb_preflight is defined
|
|
- nb_preflight.stdout_lines is defined
|
|
|
|
- name: Fail if NetBox IP not found
|
|
fail:
|
|
msg: "NB_IP not found in nb_preflight output, cannot continue wrapper"
|
|
when:
|
|
- nb_ip is not defined or nb_ip | length == 0
|
|
|
|
- name: Override ansible_host to NetBox IP
|
|
set_fact:
|
|
ansible_host: "{{ nb_ip }}"
|
|
|
|
- name: Reset SSH connection after changing ansible_host
|
|
meta: reset_connection
|
|
|
|
- name: Small pause after reset_connection
|
|
pause:
|
|
seconds: 2
|
|
|
|
- import_playbook: wifidebug17.yml
|
|
vars:
|
|
is_run_by: "scheduler"
|