commit bf97422126b1a1b964204aa6c55c6c2b631826b2 Author: Magnus Andersson Date: Mon Jan 15 09:33:52 2024 +0100 Add security group to allow access between kubernetes nodes diff --git a/main.yaml b/main.yaml new file mode 100644 index 0000000..2c02e47 --- /dev/null +++ b/main.yaml @@ -0,0 +1,7 @@ +--- +- name: Matrix Kubernetes IaC Deployment + hosts: localhost + tasks: + - name: Setup securitygroups. + ansible.builtin.include_tasks: + - file: securitygrouptasks.yaml diff --git a/securitygrouptasks.yaml b/securitygrouptasks.yaml new file mode 100644 index 0000000..a2b7706 --- /dev/null +++ b/securitygrouptasks.yaml @@ -0,0 +1,34 @@ +--- +- name: Create kubenode securitygroup + openstack.cloud.security_group: + state: present + name: kubenode + description: Kubenode security group to allow required traffic between nodes + +- name: Create kubenode IPv4 ingress rule + openstack.cloud.security_group_rule: + security_group: kubenode + remote_group: kubenode + ether_type: IPv4 + direction: ingress + +- name: Create kubenode IPv4 egress rule + openstack.cloud.security_group_rule: + security_group: kubenode + remote_group: kubenode + ether_type: IPv4 + direction: egress + +- name: Create kubenode IPv6 ingress rule + openstack.cloud.security_group_rule: + security_group: kubenode + remote_group: kubenode + ether_type: IPv6 + direction: ingress + +- name: Create kubenode IPv6 egress rule + openstack.cloud.security_group_rule: + security_group: kubenode + remote_group: kubenode + ether_type: IPv6 + direction: egress