matrixtest-IaC-ansible/kubenodes.yaml

26 lines
923 B
YAML
Raw Normal View History

2024-01-15 09:21:45 +00:00
---
- 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 }}"
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 }}"