matrixtest-IaC-ansible/kubenodes.yaml

26 lines
920 B
YAML

---
- name: Create kubernetes nodes os volume
openstack.cloud.volume:
state: present
size: 30
image: debian-12
is_bootable: true
state: present
name: kube{{ item }}-matrix-test-sunet-se-vol
loop: "{{ range(1,4)|list }}"
- name: OS secgroups
openstack.cloud.security_group_info:
register: secgroups
- openstack.cloud.port:
state: present
name: kube{{ item }}-matrix-test-sunet-se-port
network: public
security_groups: |
{% set secgroupallegress=secgroups.security_groups|selectattr('name', 'equalto', 'allegress')| first -%}
{% set secgroupkubenode=secgroups.security_groups|selectattr('name', 'equalto', 'kubenode')| first -%}
{% set secgroupssh=secgroups.security_groups|selectattr('name', 'equalto', 'ssh-from-jumphost')| first -%}
{{ secgroupallegress['id'] }},{{secgroupkubenode['id']}},{{secgroupssh['id']}}"
loop: "{{ range(1,4)|list }}"