diff --git a/docs/_data/demos.yml b/docs/_data/demos.yml index a690e62b5..c1842c1fc 100644 --- a/docs/_data/demos.yml +++ b/docs/_data/demos.yml @@ -477,6 +477,23 @@ playbooks: 1 github_path: linux/run_script.yml +- slug: linux-fleet-ao-smoke + readme_path: linux/docs/linux-fleet-ao-smoke.md + url: /demos/linux-fleet-ao-smoke/ + title: "Fleet AO Smoke Service" + category: linux + status: active + tags: + - Playbook + - Automation Orchestrator + thumbnail: + gradient: "linear-gradient(135deg, #d13438 0%, #7a0000 100%)" + icon: "🐧" + blurb: "Start and verify the short-lived service used by the Fleet Automation Orchestrator integration." + stats: + playbooks: 1 + github_path: linux/fleet_ao_smoke.yml + - slug: linux-install-ssh-key readme_path: linux/docs/linux-install-ssh-key.md url: /demos/linux-install-ssh-key/ diff --git a/linux/README.md b/linux/README.md index 4837f254b..ee267f593 100644 --- a/linux/README.md +++ b/linux/README.md @@ -32,6 +32,7 @@ This category of demos shows examples of linux operations and management with An | [**Start Service**](docs/linux-start-service.md) | Start a named service on a target system. | | [**Stop Service**](docs/linux-stop-service.md) | Stop a named service on a target system. | | [**Run Shell Script**](docs/linux-run-shell-script.md) | Execute a shell script or command across a group of systems as root, with RBAC-controlled access. | +| [**Fleet AO Smoke Service**](docs/linux-fleet-ao-smoke.md) | Start and verify the bounded transient service used by the Fleet Automation Orchestrator integration. | | [**Add SSH Public Key**](docs/linux-install-ssh-key.md) | Add an SSH public key to a Linux user's authorized_keys file on one or more hosts. | | [**Fact Scan**](docs/linux-fact-scan.md) | Run a fact, package, and service scan against a system and store results in the AAP fact cache. | | [**Podman Webserver**](docs/linux-podman-webserver.md) | Install and run an Apache webserver in a Podman container with a configurable home page message. | diff --git a/linux/docs/linux-fleet-ao-smoke.md b/linux/docs/linux-fleet-ao-smoke.md new file mode 100644 index 000000000..3939bde58 --- /dev/null +++ b/linux/docs/linux-fleet-ao-smoke.md @@ -0,0 +1,36 @@ +# Fleet Automation Orchestrator smoke service + +`fleet_ao_smoke.yml` provides the visible state change used by the +`aap-demo` Fleet and Automation Orchestrator integration. It starts +`aap-demo-fleet-smoke.service` on the selected Linux host, then verifies that +the unit is active. The transient service sleeps for five minutes and systemd +collects it afterwards. + +Product Demos setup creates a generic job template. The `aap-demo` integration +separately provisions its Fleet-scoped template, inventory, and Automation +Orchestrator workflow. + +## Prerequisites + +- Linux hosts with systemd and privilege to run `systemd-run`. +- For the generic template, hosts in **Ansible Product Demos Inventory** and SSH access through **APD Machine Credential**. + +## Survey prompts + +| Prompt | Variable | Type | Required | +|--------|----------|------|----------| +| Server Name or Pattern | `_hosts` | text | Yes | + +## Job templates + +| Template | Playbook | Description | +|----------|----------|-------------| +| LINUX ǀ Fleet AO Smoke Service | [`linux/fleet_ao_smoke.yml`](../fleet_ao_smoke.yml) | Starts and verifies the transient service on selected hosts | + +The generic template requires a host pattern through its survey. Other job +templates must also provide `_hosts` to select their target hosts. + +If a previous unit remains failed or uncollected, inspect it with +`systemctl status aap-demo-fleet-smoke.service` and clear the failed state with +`sudo systemctl reset-failed aap-demo-fleet-smoke.service` before retrying. If +the unit still exists, stop it with `sudo systemctl stop aap-demo-fleet-smoke.service`. diff --git a/linux/fleet_ao_smoke.yml b/linux/fleet_ao_smoke.yml new file mode 100644 index 000000000..4d19f9ff8 --- /dev/null +++ b/linux/fleet_ao_smoke.yml @@ -0,0 +1,29 @@ +--- +# A bounded, visible state change for the aap-demo Fleet/AO integration. +# The transient unit is collected by systemd after its five-minute sleep. +- name: Start a short-lived Fleet AO demo service + hosts: "{{ _hosts | default(omit) }}" + become: true + gather_facts: false + + tasks: + # is-active returns a useful nonzero status when the transient unit is absent. + - name: Check whether the transient demo service is already active # noqa: command-instead-of-module + ansible.builtin.command: + cmd: systemctl is-active --quiet aap-demo-fleet-smoke.service + register: fleet_ao_service_state + changed_when: false + failed_when: false + + - name: Run the temporary Fleet AO demo service + ansible.builtin.command: + cmd: >- + systemd-run --collect --unit=aap-demo-fleet-smoke /usr/bin/sleep 300 + when: fleet_ao_service_state.rc != 0 + changed_when: true + + # Verify with the same active-state check used before starting the unit. + - name: Verify transient Fleet AO demo service is active # noqa: command-instead-of-module + ansible.builtin.command: + cmd: systemctl is-active --quiet aap-demo-fleet-smoke.service + changed_when: false diff --git a/linux/setup.yml b/linux/setup.yml index 5168169af..ea3d488ad 100644 --- a/linux/setup.yml +++ b/linux/setup.yml @@ -252,6 +252,29 @@ controller_templates: variable: service_name required: true + - name: "LINUX | Fleet AO Smoke Service" + labels: + - linux + job_type: run + inventory: Ansible Product Demos Inventory + project: "Ansible Product Demos" + playbook: "linux/fleet_ao_smoke.yml" + notification_templates_started: Telemetry + notification_templates_success: Telemetry + notification_templates_error: Telemetry + use_fact_cache: true + credentials: + - APD Machine Credential + survey_enabled: true + survey: + name: '' + description: '' + spec: + - question_name: Server Name or Pattern + type: text + variable: _hosts + required: true + - name: "LINUX | Stop Service" labels: - linux