Skip to content

Commit d4a2b3e

Browse files
authored
Use metal_stack_release_vector module (#247)
1 parent 8ea76cd commit d4a2b3e

File tree

5 files changed

+18
-42
lines changed

5 files changed

+18
-42
lines changed

compose.yaml

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ services:
1414
# - ${HOME}/git/github.com/metal-stack/helm-charts:/helm-charts:ro
1515
environment:
1616
- ANSIBLE_CONFIG=/mini-lab/ansible.cfg
17+
- ANSIBLE_INVENTORY=inventories/control-plane.yaml
1718
- KUBECONFIG=/mini-lab/.kubeconfig
1819
- K8S_AUTH_KUBECONFIG=/mini-lab/.kubeconfig
1920
- CI=${CI}
@@ -26,13 +27,9 @@ services:
2627
- /bin/bash
2728
- -ce
2829
- |
29-
ansible-playbook \
30-
-i inventories/control-plane.yaml \
31-
obtain_role_requirements.yaml
32-
ansible-galaxy install --ignore-errors -r requirements.yaml
33-
ansible-playbook \
34-
-i inventories/control-plane.yaml \
35-
deploy_control_plane.yaml --extra-vars "@.extra_vars.yaml"
30+
cosign verify --key files/cosign.pub ghcr.io/metal-stack/metal-deployment-base:${DEPLOYMENT_BASE_IMAGE_TAG}
31+
ansible -m metalstack.base.metal_stack_release_vector localhost --extra-vars "@.extra_vars.yaml"
32+
ansible-playbook deploy_control_plane.yaml --extra-vars "@.extra_vars.yaml"
3633
3734
partition:
3835
image: ghcr.io/metal-stack/metal-deployment-base:${DEPLOYMENT_BASE_IMAGE_TAG}
@@ -47,6 +44,7 @@ services:
4744
# - ${HOME}/.ansible/roles/metal-ansible-modules:/root/.ansible/roles/metal-ansible-modules:ro
4845
environment:
4946
- ANSIBLE_CONFIG=/mini-lab/ansible.cfg
47+
- ANSIBLE_INVENTORY=inventories/partition.yaml,clab-mini-lab/ansible-inventory.yml
5048
- CI=${CI}
5149
- DOCKER_HUB_USER=${DOCKER_HUB_USER}
5250
- DOCKER_HUB_TOKEN=${DOCKER_HUB_TOKEN}
@@ -56,14 +54,9 @@ services:
5654
- /bin/bash
5755
- -ce
5856
- |
59-
ansible-playbook \
60-
-i inventories/control-plane.yaml \
61-
obtain_role_requirements.yaml
62-
ansible-galaxy install --ignore-errors -r requirements.yaml
63-
ansible-playbook \
64-
-i inventories/partition.yaml \
65-
-i clab-mini-lab/ansible-inventory.yml \
66-
deploy_partition.yaml --extra-vars "@.extra_vars.yaml"
57+
cosign verify --key files/cosign.pub ghcr.io/metal-stack/metal-deployment-base:${DEPLOYMENT_BASE_IMAGE_TAG}
58+
ansible -m metalstack.base.metal_stack_release_vector localhost --extra-vars "@.extra_vars.yaml"
59+
ansible-playbook deploy_partition.yaml --extra-vars "@.extra_vars.yaml"
6760
6861
metalctl:
6962
image: ghcr.io/metal-stack/metalctl:${METALCTL_IMAGE_TAG}

env.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ yq_shell() {
88
docker run --rm -i -v ${PWD}:/workdir mikefarah/yq:3 /bin/sh -c "$@"
99
}
1010

11-
METAL_STACK_RELEASE_VERSION=$(yq_shell "yq r inventories/group_vars/all/images.yaml 'metal_stack_release_version'")
11+
METAL_STACK_RELEASE_VERSION=$(yq_shell "yq r inventories/group_vars/all/release_vector.yaml 'metal_stack_release_version'")
1212
RELEASE_YAML=$(curl -s https://raw.githubusercontent.com/metal-stack/releases/${METAL_STACK_RELEASE_VERSION}/release.yaml)
1313
METALCTL_IMAGE_TAG=$(yq_shell "echo \"${RELEASE_YAML}\" | yq r - docker-images.metal-stack.control-plane.metalctl.tag")
1414
DEPLOYMENT_BASE_IMAGE_TAG=$(yq_shell "echo \"${RELEASE_YAML}\" | yq r - docker-images.metal-stack.generic.deployment-base.tag")

files/cosign.pub

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
-----BEGIN PUBLIC KEY-----
2+
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEdeAXd2namgVNDT0APmogKGwaV+Q4
3+
rfe4uVgmsyBbb6TrhX5Py6x1PsonDahTvdVpbSGC7QGEjxIHdi8HnJ4Okg==
4+
-----END PUBLIC KEY-----

inventories/group_vars/all/images.yaml renamed to inventories/group_vars/all/release_vector.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
---
22
metal_stack_release_version: develop
33

4-
setup_yaml:
5-
- url: https://raw.githubusercontent.com/metal-stack/releases/{{ metal_stack_release_version }}/release.yaml
6-
meta_var: metal_stack_release
4+
metal_stack_release_vectors:
5+
- url: oci://ghcr.io/metal-stack/releases:{{ metal_stack_release_version }}
6+
variable_mapping_path: metal_stack_release.mapping
7+
include_role_defaults: metal-roles/common/roles/defaults
8+
oci_cosign_verify_key: "{{ lookup('file', 'cosign.pub') }}"
79

810
##
911
## for development purposes, you can override releases from our image vector here

obtain_role_requirements.yaml

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)