Skip to content

quadsproject/ansible-quads-ssm

Repository files navigation

Ansible QUADS Self-Scheduler

GHA

Schedule hosts on a QUADS server via its self-scheduling REST API.

Features

  • Supports SSO API token (qat_) and legacy username/password authentication
  • Performs all self-service steps: registration, login, host discovery and scheduling
  • Allows scheduling multiple hosts or passing additional cloud values e.g. qinq: 1 or nowipe
  • Allows setting a host model preference order, or use all if you don't care
  • Supports just listing available servers or scheduling specific servers you want
  • Supports listing your current, active assignments only
  • Generates list of scheduled hosts and login/authentication details to a local file
  • Generates helper commands for querying assignment validation status and terminating the assignment via it's assignment_id

Requirements

  • Ansible: Ensure Ansible and community collections (e.g. community.general.dict_kv) are installed from where you are running it. jq is needed for helper commands.
dnf install ansible ansible-core jq
  • QUADS Server Access: You need network access to the QUADS API server and valid credentials (SSO token or username/password).

Configuration

Important

You must configure quads_config.yml first for at least quads_api_server, quads_username, and one authentication method.

Authentication

Two authentication methods are supported. Use one of them.

SSO API Token (preferred): Obtain a qat_-prefixed token from the QUADS web portal under Profile > API Tokens. No password is needed.

Legacy username/password: Set quads_password in the config. If it's your first time, make up a password — the playbook will register you automatically.

Configuration Parameters

Parameter Type Description
quads_api_server String The FQDN or IP address of your QUADS API server (e.g., "quads.example.com").
quads_username String Your username, which is the part of your email before the @ sign (e.g., "joe").
quads_user_domain String The domain part of your email address (e.g., "example.com").
quads_api_token String SSO API token (preferred). Obtain from the QUADS web portal Profile > API Tokens. Starts with qat_.
quads_password String Legacy password for the QUADS server. Used only when quads_api_token is not set.
preferred_models List or String A list of server models to schedule, in order of preference. The playbook will try to find a match for the first model, then the second, and so on. Use "all" to select any available model without preference.

Example quads_config.yml (SSO token)

---
quads_api_server: "quads.example.com"
quads_username: "joe"
quads_user_domain: "example.com"
quads_api_token: "qat_your_token_here"

preferred_models:
  - "r650"
  - "r660"
  - "r640"

Example quads_config.yml (legacy password)

---
quads_api_server: "quads.example.com"
quads_username: "joe"
quads_user_domain: "example.com"
# quads_api_token: ""
quads_password: "make_a_password_up"

preferred_models:
  - "r650"
  - "r660"
  - "r640"
# preferred_models: "all"

Running the Playbook:

Note

You must wrap workload_name description in single quotes like the below examples.

Listing Current Assignments

ansible-playbook quads_self_schedule.yml -e "list_active_only=true"

Listing Free Servers Only

ansible-playbook quads_self_schedule.yml -e "list_servers_only=true"

Scheduling a Single Host

ansible-playbook quads_self_schedule.yml -e "workload_name='My Test Workload'"

Scheduling Three Hosts

ansible-playbook quads_self_schedule.yml -e "workload_name='My Test Workload'" -e "num_hosts='3'"

Scheduling Specific Hosts

ansible-playbook quads_self_schedule.yml \
  -e "workload_name='My Test Workload'" \
  -e "schedule_servers=host01.example.com,host2.example.com"

Schedule a Host without Wiping the Disks

ansible-playbook quads_self_schedule.yml -e "workload_name='My Test Workload'" -e "wipe=false"

Schedule a Host with QINQ 1 VLAN Mode

ansible-playbook quads_self_schedule.yml -e "workload_name='My Test Workload'" -e "qinq='1'"

Helper Files

The following helper files are also generated to assist with the self-scheduling lifecycle:

File Description
quads_credentials.yml Contains your username, password, and the API token used for the session.
scheduled_hosts_..._YYYY-MM-DD_HH-MM-SS.yml A timestamped record of the hosts that were successfully scheduled.
quads_commands_..._YYYY-MM-DD_HH-MM-SS.txt A timestamped text file with convenient curl commands to check status or terminate your assignment.

About

Self-schedule systems from QUADS using the self-scheduling API with Ansible

Topics

Resources

Stars

Watchers

Forks

Contributors