diff options
author | Scott Dodson <sdodson@redhat.com> | 2017-09-07 16:32:56 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-07 16:32:56 -0400 |
commit | 7b1c455c01d10ab5aa804ad48a5b60ab53d6a0c8 (patch) | |
tree | b900625cbb8a97af4d2cf0d19d452bd643a9e0ec /roles/openshift_aws/tasks/security_group.yml | |
parent | dc0e3d218ba953e1bc1525ef337f99677deee6c3 (diff) | |
parent | efe86b44bce679db38cca654818dc3837bb05f6a (diff) | |
download | openshift-7b1c455c01d10ab5aa804ad48a5b60ab53d6a0c8.tar.gz openshift-7b1c455c01d10ab5aa804ad48a5b60ab53d6a0c8.tar.bz2 openshift-7b1c455c01d10ab5aa804ad48a5b60ab53d6a0c8.tar.xz openshift-7b1c455c01d10ab5aa804ad48a5b60ab53d6a0c8.zip |
Merge pull request #5211 from kwoodson/provisioning_fixes
Provisioning updates.
Diffstat (limited to 'roles/openshift_aws/tasks/security_group.yml')
-rw-r--r-- | roles/openshift_aws/tasks/security_group.yml | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/roles/openshift_aws/tasks/security_group.yml b/roles/openshift_aws/tasks/security_group.yml new file mode 100644 index 000000000..161e72fb4 --- /dev/null +++ b/roles/openshift_aws/tasks/security_group.yml @@ -0,0 +1,45 @@ +--- +- name: Fetch the VPC for the vpc.id + ec2_vpc_net_facts: + region: "{{ openshift_aws_region }}" + filters: + "tag:Name": "{{ openshift_aws_clusterid }}" + register: vpcout + +- name: Create default security group for cluster + ec2_group: + name: "{{ openshift_aws_node_security_groups.default.name }}" + description: "{{ openshift_aws_node_security_groups.default.desc }}" + region: "{{ openshift_aws_region }}" + vpc_id: "{{ vpcout.vpcs[0].id }}" + rules: "{{ openshift_aws_node_security_groups.default.rules | default(omit, True)}}" + register: sg_default_created + +- name: create the node group sgs + ec2_group: + name: "{{ item.name}}" + description: "{{ item.desc }}" + rules: "{{ item.rules if 'rules' in item else [] }}" + region: "{{ openshift_aws_region }}" + vpc_id: "{{ vpcout.vpcs[0].id }}" + register: sg_create + with_items: + - "{{ openshift_aws_node_security_groups[openshift_aws_node_group_type]}}" + +- name: create the k8s sgs for the node group + ec2_group: + name: "{{ item.name }}_k8s" + description: "{{ item.desc }} for k8s" + region: "{{ openshift_aws_region }}" + vpc_id: "{{ vpcout.vpcs[0].id }}" + register: k8s_sg_create + with_items: + - "{{ openshift_aws_node_security_groups[openshift_aws_node_group_type]}}" + +- name: tag sg groups with proper tags + ec2_tag: + tags: + KubernetesCluster: "{{ openshift_aws_clusterid }}" + resource: "{{ item.group_id }}" + region: "{{ openshift_aws_region }}" + with_items: "{{ k8s_sg_create.results }}" |