Browse Source

Merge pull request #6692 from abutcher/cluster-operator

Automatic merge from submit-queue.

Separate ELB & S3 from master node group provisioning

Moved s3 and elb provisioning out of `roles/openshift_aws/tasks/provisioning.yml` and into their own playbooks. These playbooks are now included in the provision playbook and in a WIP infrastructure playbook we intend to run up front in place of prerequisites. 

@kwoodson what are your thoughts on something like this?
OpenShift Merge Robot 7 years ago
parent
commit
ba3abc672d

+ 8 - 2
playbooks/aws/openshift-cluster/provision.yml

@@ -1,8 +1,7 @@
 ---
-- name: Setup the elb and the master node group
+- name: Alert user to variables needed
   hosts: localhost
   tasks:
-
   - name: Alert user to variables needed - clusterid
     debug:
       msg: "openshift_aws_clusterid={{ openshift_aws_clusterid | default('default') }}"
@@ -11,6 +10,13 @@
     debug:
       msg: "openshift_aws_region={{ openshift_aws_region | default('us-east-1') }}"
 
+- import_playbook: provision_s3.yml
+
+- import_playbook: provision_elb.yml
+
+- name: Create the master node group
+  hosts: localhost
+  tasks:
   - name: provision cluster
     import_role:
       name: openshift_aws

+ 9 - 0
playbooks/aws/openshift-cluster/provision_elb.yml

@@ -0,0 +1,9 @@
+---
+- name: Create elb
+  hosts: localhost
+  connection: local
+  tasks:
+  - name: provision elb
+    include_role:
+      name: openshift_aws
+      tasks_from: provision_elb.yml

+ 10 - 0
playbooks/aws/openshift-cluster/provision_s3.yml

@@ -0,0 +1,10 @@
+---
+- name: Create s3 bucket
+  hosts: localhost
+  connection: local
+  tasks:
+  - name: create s3 bucket
+    include_role:
+      name: openshift_aws
+      tasks_from: s3.yml
+    when: openshift_aws_create_s3 | default(true) | bool

+ 21 - 0
playbooks/cluster-operator/aws/infrastructure.yml

@@ -0,0 +1,21 @@
+---
+- name: Alert user to variables needed
+  hosts: localhost
+  tasks:
+  - name: Alert user to variables needed - clusterid
+    debug:
+      msg: "openshift_aws_clusterid={{ openshift_aws_clusterid | default('default') }}"
+
+  - name: Alert user to variables needed - region
+    debug:
+      msg: "openshift_aws_region={{ openshift_aws_region | default('us-east-1') }}"
+
+- import_playbook: ../../aws/openshift-cluster/provision_vpc.yml
+
+- import_playbook: ../../aws/openshift-cluster/provision_ssh_keypair.yml
+
+- import_playbook: ../../aws/openshift-cluster/provision_sec_group.yml
+
+- import_playbook: ../../aws/openshift-cluster/provision_s3.yml
+
+- import_playbook: ../../aws/openshift-cluster/provision_elb.yml

+ 1 - 0
playbooks/cluster-operator/aws/roles

@@ -0,0 +1 @@
+../../../roles

+ 0 - 17
roles/openshift_aws/tasks/provision.yml

@@ -1,23 +1,6 @@
 ---
-- when: openshift_aws_create_iam_cert | bool
-  name: create the iam_cert for elb certificate
-  include_tasks: iam_cert.yml
-
-- when: openshift_aws_create_s3 | bool
-  name: create s3 bucket for registry
-  include_tasks: s3.yml
-
 - include_tasks: vpc_and_subnet_id.yml
 
-- name: create elbs
-  include_tasks: elb.yml
-  with_dict: "{{ openshift_aws_elb_dict }}"
-  vars:
-    l_elb_security_groups: "{{ openshift_aws_elb_security_groups }}"
-    l_openshift_aws_elb_name_dict: "{{ openshift_aws_elb_name_dict }}"
-  loop_control:
-    loop_var: l_elb_dict_item
-
 - name: include scale group creation for master
   include_tasks: build_node_group.yml
   with_items: "{{ openshift_aws_master_group }}"

+ 15 - 0
roles/openshift_aws/tasks/provision_elb.yml

@@ -0,0 +1,15 @@
+---
+- when: openshift_aws_create_iam_cert | bool
+  name: create the iam_cert for elb certificate
+  include_tasks: iam_cert.yml
+
+- include_tasks: vpc_and_subnet_id.yml
+
+- name: create elbs
+  include_tasks: elb.yml
+  with_dict: "{{ openshift_aws_elb_dict }}"
+  vars:
+    l_elb_security_groups: "{{ openshift_aws_elb_security_groups }}"
+    l_openshift_aws_elb_name_dict: "{{ openshift_aws_elb_name_dict }}"
+  loop_control:
+    loop_var: l_elb_dict_item