spec.md 1.5 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. The group_vars/all.yml SHALL set ansible_python_interpreter: auto to enable interpreter auto-discovery on all hosts.

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

Scenario: Python interpreter auto-discovery

  • WHEN Ansible connects to any managed host
  • THEN it uses auto-discovery to locate the Python interpreter instead of assuming /usr/bin/python3