Skip to content

Commit 0618771

Browse files
Merge pull request #1338 from dholt/feature/maas-deploy-workflow-v2
feat: MAAS deploy workflow and dynamic inventory integration
2 parents d462d56 + 13ff300 commit 0618771

5 files changed

Lines changed: 613 additions & 17 deletions

File tree

.claude/skills/test-playbooks.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
name: test-playbooks
3+
description: Test Ansible playbooks across Ubuntu versions on target machines
4+
---
5+
6+
## Prerequisites
7+
- Virtualenv activated (`source .venv/bin/activate` or `source /opt/deepops/env/bin/activate`)
8+
- Target machines provisioned and accessible via SSH
9+
- Inventory configured: either `config/inventory` (static) or `config/maas-inventory.yml` (MAAS dynamic)
10+
11+
## Steps
12+
1. Verify connectivity: `ansible -m ping all`
13+
2. Run playbook: `ansible-playbook playbooks/<playbook>.yml`
14+
3. Verify results (check playbook output, run smoke tests on targets)
15+
4. To test another OS version: reprovision targets with the new OS, re-run playbook, verify again
16+
17+
## Test Matrix
18+
| Playbook | Inventory groups needed | Test on 24.04 | Test on 22.04 |
19+
|----------|------------------------|---------------|---------------|
20+
| k8s-cluster.yml | kube_control_plane, kube_node, etcd | yes | yes |
21+
| slurm-cluster.yml | slurm-master, slurm-node | yes | yes |
22+
| ngc-ready-server.yml | (any host group) | yes | yes |
23+
24+
## MAAS Users
25+
If using MAAS dynamic inventory (`scripts/maas_inventory.py`), the deploy script automates provisioning:
26+
```bash
27+
./scripts/maas_deploy.sh --status # check VM state
28+
./scripts/maas_deploy.sh --os noble --profile k8s # deploy + tag for K8s
29+
./scripts/maas_deploy.sh --os jammy --profile slurm # deploy + tag for Slurm
30+
./scripts/maas_deploy.sh --profile k8s --tags-only # re-tag without redeploying
31+
./scripts/maas_deploy.sh --release # release VMs
32+
```
33+
Profiles assign MAAS tags that the dynamic inventory maps to Ansible groups:
34+
- **k8s**: first machine = `kube_control_plane` + `etcd`, remaining = `kube_node`
35+
- **slurm**: first machine = `slurm-master`, remaining = `slurm-node`
36+
37+
## Group Naming
38+
- K8s groups use underscores: `kube_control_plane`, `kube_node`, `k8s_cluster`
39+
- Slurm groups use hyphens: `slurm-master`, `slurm-node`, `slurm-cluster`
40+
- Old hyphenated K8s names (`kube-master`, `kube-node`) are accepted via TAG_ALIASES

ansible.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
collections_paths = ./collections
33
roles_path = ./roles/galaxy:./roles:./submodules/kubespray/roles
44
library = ./submodules/kubespray/library
5-
inventory = ./config/inventory
5+
inventory = ./config/inventory,./scripts/maas_inventory.py
66
host_key_checking = False
77
gathering = smart
88
fact_caching = jsonfile

config.example/maas-inventory.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,7 @@ ssh_user: "ubuntu"
2626
# Only needed if target machines are on a private network that requires
2727
# jumping through a bastion host. Leave commented out for direct access.
2828
#ssh_bastion: "user@bastion-host"
29+
30+
# Machines to manage (hostnames as they appear in MAAS)
31+
# Used by maas_deploy.sh for deploy/release operations
32+
#machines: "maas-worker maas-worker-2 maas-worker-3"

0 commit comments

Comments
 (0)