matrixtest-IaC-ansible/kubenodes.yaml

36 lines
1.2 KiB
YAML
Raw Normal View History

2024-01-15 09:21:45 +00:00
---
- name: Create os volume for kubernetes nodes
2024-01-15 09:21:45 +00:00
openstack.cloud.volume:
state: present
size: 30
image: debian-12
is_bootable: true
state: present
name: kube{{ item }}-matrix-test-sunet-se-osvol
loop: "{{ range(1,4)|list }}"
- name: Create snap volume for kubernetes nodes
openstack.cloud.volume:
state: present
size: 20
image: debian-12
is_bootable: true
state: present
name: kube{{ item }}-matrix-test-sunet-se-snapvol
2024-01-15 09:21:45 +00:00
loop: "{{ range(1,4)|list }}"
2024-01-15 14:17:06 +00:00
- 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
2024-01-15 14:45:19 +00:00
security_groups: |-
{%- set secgroupallegress=secgroups.security_groups|selectattr('name', 'equalto', 'allegress')| first -%}
2024-01-15 14:17:06 +00:00
{% set secgroupkubenode=secgroups.security_groups|selectattr('name', 'equalto', 'kubenode')| first -%}
{% set secgroupssh=secgroups.security_groups|selectattr('name', 'equalto', 'ssh-from-jumphost')| first -%}
2024-01-15 14:45:19 +00:00
{{ secgroupallegress['id'] }},{{secgroupkubenode['id']}},{{secgroupssh['id'] -}}
2024-01-15 14:17:06 +00:00
loop: "{{ range(1,4)|list }}"