Add two playbooks: - hello_world.yml: AWX smoke test that asserts Debian-family OS and reports facts. Use this as the first Job Template to confirm AWX can reach hosts, become root, and gather facts. - setup_new_system.yml: Full host provisioning playbook that mirrors the function call order of SetupNewSystem.sh. Each role is gated by a run_* feature toggle so the same template can do partial runs. 🤖 Generated with [Crush](https://github.com/charmassociates/crush) Assisted-by: GLM-5 via Crush <crush@charm.land>
34 lines
1.3 KiB
YAML
34 lines
1.3 KiB
YAML
---
|
|
# AWX "hello world" smoke-test playbook.
|
|
#
|
|
# Point an AWX Project at this repo, then create a Job Template whose
|
|
# playbook is playbooks/hello_world.yml and run it against any inventory.
|
|
# A passing run confirms AWX can: clone the repo, parse the playbook,
|
|
# reach the target over SSH, become root, and report facts.
|
|
|
|
- name: AWX connectivity smoke test
|
|
hosts: all
|
|
gather_facts: true
|
|
become: true
|
|
|
|
tasks:
|
|
- name: Confirm reachable and privileged
|
|
ansible.builtin.assert:
|
|
that:
|
|
- ansible_facts.os_family == "Debian"
|
|
fail_msg: >-
|
|
KNELIAC only manages Debian-family hosts (Debian/Ubuntu/Kali/RPi OS);
|
|
found OS family "{{ ansible_facts.os_family }}".
|
|
success_msg: "Host {{ inventory_hostname }} is Debian-family ({{ ansible_facts.distribution }} {{ ansible_facts.distribution_version }})."
|
|
|
|
- name: Report management target
|
|
ansible.builtin.debug:
|
|
msg: >-
|
|
AWX successfully managed {{ inventory_hostname }}
|
|
({{ ansible_facts.distribution }} {{ ansible_facts.distribution_version }},
|
|
kernel {{ ansible_facts.kernel }}, arch {{ ansible_facts.architecture }}).
|
|
|
|
- name: Show where full provisioning runs from
|
|
ansible.builtin.debug:
|
|
msg: "Run playbooks/setup_new_system.yml for the full host build."
|