Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
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
36 changes: 36 additions & 0 deletions linux/docs/linux-fleet-ao-smoke.md
Original file line number Diff line number Diff line change
@@ -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`.
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(omit) }}"
become: true
gather_facts: false

tasks:
- name: Check whether the transient demo service is already active

Check failure on line 10 in linux/fleet_ao_smoke.yml

View workflow job for this annotation

GitHub Actions / pre-commit-27

command-instead-of-module

systemctl used in place of systemd 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
Comment thread
chadmf marked this conversation as resolved.
Resolved

- name: Verify transient Fleet AO demo service is active

Check failure on line 24 in linux/fleet_ao_smoke.yml

View workflow job for this annotation

GitHub Actions / pre-commit-27

command-instead-of-module

systemctl used in place of systemd module
ansible.builtin.command:
cmd: systemctl is-active --quiet aap-demo-fleet-smoke.service
changed_when: false
23 changes: 23 additions & 0 deletions linux/setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading