Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions docs/_data/demos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment thread
hammer-redhat marked this conversation as resolved.
Resolved
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/
Expand Down
1 change: 1 addition & 0 deletions linux/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. |
Comment thread
hammer-redhat marked this conversation as resolved.
Resolved
| [**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. |
Expand Down
11 changes: 11 additions & 0 deletions linux/docs/linux-fleet-ao-smoke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# 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.

Run it only through the Fleet-scoped AAP job template created by the
integration. The playbook needs a host with systemd and permission to use
`systemd-run`.
Comment thread
chadmf marked this conversation as resolved.
Resolved
27 changes: 27 additions & 0 deletions linux/fleet_ao_smoke.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
# 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('all') }}"
Comment thread
hammer-redhat marked this conversation as resolved.
Resolved
become: true
gather_facts: false

tasks:
- name: Check whether the transient demo service is already active
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
Comment thread
chadmf marked this conversation as resolved.
Resolved

- name: Verify transient Fleet AO demo service is active
ansible.builtin.command:
cmd: systemctl is-active --quiet aap-demo-fleet-smoke.service
changed_when: false
7 changes: 7 additions & 0 deletions tests/test_fleet_ao_smoke.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
set -euo pipefail

playbook=linux/fleet_ao_smoke.yml
test -f "$playbook"
rg -F 'systemd-run --collect --unit=aap-demo-fleet-smoke /usr/bin/sleep 300' "$playbook"
rg -F 'systemctl is-active --quiet aap-demo-fleet-smoke.service' "$playbook"
Comment thread
hammer-redhat marked this conversation as resolved.
Resolved