spec.md 1.2 KB

MODIFIED Requirements

Requirement: Ansible inventory defines relay and landing server groups

The inventory SHALL define two host groups: relay and landing, each containing the respective server's connection details (IP, SSH user, SSH key). The ansible_user SHALL be a configurable placeholder supporting both root and non-root users. The repository SHALL ship inventory/hosts.yml.example as a template; the actual inventory/hosts.yml SHALL be gitignored and created by the user.

Scenario: Inventory is valid

  • WHEN the user copies hosts.yml.example to hosts.yml and fills in their values
  • THEN two groups relay and landing are available, each with at least one host

Scenario: Non-root user with sudo

  • WHEN ansible_user is set to a non-root user (e.g., ubuntu)
  • THEN Ansible connects as that user and uses become for privilege escalation

Scenario: Root user

  • WHEN ansible_user is set to root
  • THEN Ansible connects as root directly and become is a no-op

Scenario: Missing inventory

  • WHEN the user has not copied hosts.yml.example to hosts.yml
  • THEN Ansible fails with an error indicating the inventory file is missing