Browse Source

Finish origin -> openshift rename

Jhon Honce 10 years ago
parent
commit
b1b2cbe00c

+ 15 - 0
.gitignore

@@ -0,0 +1,15 @@
+*~
+#*#
+.idea
+*.iml
+*.komodoproject
+.loadpath
+.project
+*.pyc
+.pydevproject
+*.pyo
+*.redcar*
+.*.swp
+.sass-cache
+.rvmrc
+.DS_Store

+ 10 - 8
cluster.sh

@@ -23,25 +23,27 @@ EOT
 # @formatter:on
 
 function create_cluser {
+    for (( i = 0; i < $MASTERS; i ++ )); do
+        ./cloud.rb "${PROVIDER}" launch -e "${ENV}" --type=$MASTER_PLAYBOOK
+    done
+
     for (( i = 0; i < $MINIONS; i ++ )); do
         ./cloud.rb "${PROVIDER}" launch -e "${ENV}" --type=$MINION_PLAYBOOK
     done
 
-    for (( i = 0; i < $MASTERS; i ++ )); do
-        ./cloud.rb "${PROVIDER}" launch -e "${ENV}" --type=$MASTER_PLAYBOOK
-    done
     update_cluster
-    echo -e "\nCreated ${MASTERS} ${MASTER_PLAYBOOK} masters and ${MINIONS} ${MINION_PLAYBOOK} minions using ${PROVIDER} provider\n"
+
+    echo -e "\nCreated ${MASTERS}/${MASTER_PLAYBOOK} masters and ${MINIONS}/${MINION_PLAYBOOK} minions using ${PROVIDER} provider\n"
 }
 
 function update_cluster {
-    for (( i = 0; i < $MINIONS; i ++ )); do
-        ./cloud.rb "${PROVIDER}" config -e "${ENV}" --type=$MINION_PLAYBOOK
-    done
-
     for (( i = 0; i < $MASTERS; i ++ )); do
         ./cloud.rb "${PROVIDER}" config -e "${ENV}" --type=$MASTER_PLAYBOOK
     done
+
+    for (( i = 0; i < $MINIONS; i ++ )); do
+        ./cloud.rb "${PROVIDER}" config -e "${ENV}" --type=$MINION_PLAYBOOK
+    done
 }
 
 function terminate_cluster {

playbooks/gce/origin-master/config.yml → playbooks/gce/openshift-master/config.yml


playbooks/gce/origin-minion/launch.yml → playbooks/gce/openshift-master/launch.yml


playbooks/gce/origin-master/terminate.yml → playbooks/gce/openshift-master/terminate.yml


playbooks/gce/origin-minion/vars.yml → playbooks/gce/openshift-master/vars.yml


playbooks/gce/origin-minion/config.yml → playbooks/gce/openshift-minion/config.yml


playbooks/gce/origin-master/launch.yml → playbooks/gce/openshift-minion/launch.yml


playbooks/gce/origin-minion/terminate.yml → playbooks/gce/openshift-minion/terminate.yml


playbooks/gce/origin-master/vars.yml → playbooks/gce/openshift-minion/vars.yml


roles/origin_minion/README.md → roles/openshift_master/README.md


roles/origin_master/defaults/main.yml → roles/openshift_master/defaults/main.yml


roles/origin_master/handlers/main.yml → roles/openshift_master/handlers/main.yml


roles/origin_minion/meta/main.yml → roles/openshift_master/meta/main.yml


+ 10 - 5
roles/origin_master/tasks/main.yml

@@ -1,7 +1,7 @@
 ---
 # tasks file for openshift_master
 - name: Install Origin
-  yum: pkg=openshift state=installed
+  yum: pkg=origin state=installed
 
 - name: Configure Origin settings
   lineinfile: >
@@ -14,12 +14,17 @@
   notify:
     - restart openshift-master
 
-- name: Enable OpenShift
-  service: name=openshift enabled=yes state=started
+- name: Open firewalld port for etcd embedded in OpenShift
+  firewalld: port=4001/tcp permanent=false state=enabled
+
+- name: Save firewalld port for etcd embedded in
+  firewalld: port=4001/tcp permanent=true state=enabled
 
-- name: Open firewalld port for Origin
+- name: Open firewalld port for OpenShift
   firewalld: port=8080/tcp permanent=false state=enabled
 
-- name: Save firewalld port for Origin
+- name: Save firewalld port for OpenShift
   firewalld: port=8080/tcp permanent=true state=enabled
 
+- name: Enable OpenShift
+  service: name=openshift enabled=yes state=started

roles/origin_master/vars/main.yml → roles/openshift_master/vars/main.yml


roles/origin_master/README.md → roles/openshift_minion/README.md


roles/origin_minion/defaults/main.yml → roles/openshift_minion/defaults/main.yml


roles/origin_minion/handlers/main.yml → roles/openshift_minion/handlers/main.yml


roles/origin_master/meta/main.yml → roles/openshift_minion/meta/main.yml


+ 10 - 4
roles/origin_minion/tasks/main.yml

@@ -1,7 +1,7 @@
 ---
 # tasks file for openshift_minion
 - name: Install OpenShift
-  yum: pkg=openshift state=installed
+  yum: pkg=origin state=installed
 
 - name: Configure OpenShift settings
   lineinfile: >
@@ -14,11 +14,17 @@
   notify:
     - restart openshift-minion
 
-- name: Enable OpenShift
-  service: name=openshift enabled=yes state=started
-
 - name: Open firewalld port for OpenShift
   firewalld: port=10250/tcp permanent=false state=enabled
 
 - name: Save firewalld port for OpenShift
   firewalld: port=10250/tcp permanent=true state=enabled
+
+  # POST ${master_ip}:8080/api/v1beta1/minions kind=Minion id=${node_ip} apiVersion=v1beta1 hostIP=${node_ip} >/dev/null
+
+- name: Enable OpenShift
+  service: name=openshift enabled=yes state=started
+
+- name: Register with OpenShift master
+  command: "curl -X POST -H 'Accept: application/json' -d '{\"kind\":\"Minion\", \"id\":\"{{ hostvars[inventory_hostname].ansible_eth0.ipv4.address }}\", \"apiVersion\":\"v1beta1\", \"hostIP\":\"{{ hostvars[inventory_hostname].ansible_eth0.ipv4.address }}\" }' http://{{ oo_master_ips[0] }}:8080/api/v1beta1/minions"
+  when: oo_master_ips[0] != ''

roles/origin_minion/vars/main.yml → roles/openshift_minion/vars/main.yml