Add workarount to attach volumes in an determined order

This commit is contained in:
Magnus Andersson 2024-01-16 09:00:03 +01:00
parent cda4173f12
commit 2c2c0ec604
Signed by: mandersson
GPG key ID: 19CB2C58E1F19B16
2 changed files with 8 additions and 2 deletions

View file

@ -16,6 +16,7 @@ runcmd:
- [ systemctl, enable, chronyd ]
- systemctl restart chronyd
- mkdir -p /var/snap
- timeout 60 /bin/bash -c 'until ls /dev/sdb 2>/dev/null;do sleep 1;done'
- vgcreate snapvg /dev/sdb
- lvcreate -n lvol_snap -l 100%FREE snapvg
- mkfs -t xfs -n ftype=1 /dev/snapvg/lvol_snap

View file

@ -40,11 +40,16 @@
flavor: b2.c4r16
key_name: manderssonpub
boot_volume: kube{{ item }}-matrix-test-sunet-se-osvol
volumes:
- "kube{{ item }}-matrix-test-sunet-se-snapvol"
nics:
- port-name: "kube{{ item }}-matrix-test-sunet-se-port"
security_groups: "{{ kubesecgroups | join(',') }}"
userdata: |
{{ lookup('ansible.builtin.template', 'kubenodes-user.yaml.j2') | indent(4, False ) }}
loop: "{{ range(1, numnodes + 1 )|list }}"
- name: Attaches snap volume to kubernetes nodes
openstack.cloud.server_volume:
state: present
server: "kube{{ item }}.matrix-test.sunet.se"
volume: "kube{{ item }}-matrix-test-sunet-se-snapvol"
loop: "{{ range(1, numnodes + 1 )|list }}"