diff --git a/ansible/all-in-one.yaml b/ansible/all-in-one.yaml deleted file mode 100755 index d113aa15344fc40f59363c91b93f4cebf98be521..0000000000000000000000000000000000000000 --- a/ansible/all-in-one.yaml +++ /dev/null @@ -1,43 +0,0 @@ -# - hosts: localhost -# vars_files: -# - host_vars/nectar.yaml -# gather_facts: true - -# roles: -# - role: openstack-common -# - role: openstack-volume -# - role: openstack-security-group -# - role: cluster-security-group -# - role: openstack-instance - -# - hosts: instances -# vars_files: -# - host_vars/docker.yaml -# gather_facts: true - -# roles: -# - role: openstack-proxy -# - role: all-dependencies -# - role: all-mount -# - role: all-docker - -# - hosts: web -# vars_files: -# - host_vars/react.yaml -# gather_facts: true - -# roles: -# - role: react-build - -- hosts: dbs - - roles: - - role: cluster-build - -- hosts: master - - roles: - - role: slaves-cluster - - - \ No newline at end of file diff --git a/ansible/create-cluster.sh b/ansible/create-cluster.sh new file mode 100755 index 0000000000000000000000000000000000000000..2a478230e3a5ba7c84bc015f69a146f860db5643 --- /dev/null +++ b/ansible/create-cluster.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +. ./unimelb-comp90024-2020-grp-62-openrc.sh; ansible-playbook -i hosts --ask-become-pass create-cluster.yaml \ No newline at end of file diff --git a/ansible/create-cluster.yaml b/ansible/create-cluster.yaml new file mode 100644 index 0000000000000000000000000000000000000000..6931039e2e19c4f810e18e8f0ae0f7d6bd6f14f8 --- /dev/null +++ b/ansible/create-cluster.yaml @@ -0,0 +1,9 @@ +- hosts: dbs + + roles: + - role: cluster-build + +- hosts: master + + roles: + - role: slaves-cluster \ No newline at end of file diff --git a/ansible/run-all-in-one.sh b/ansible/create-instances.sh similarity index 100% rename from ansible/run-all-in-one.sh rename to ansible/create-instances.sh diff --git a/ansible/create-instances.yaml b/ansible/create-instances.yaml new file mode 100755 index 0000000000000000000000000000000000000000..8546ff28c017f58ee76479df2c71fbdb19e23f22 --- /dev/null +++ b/ansible/create-instances.yaml @@ -0,0 +1,43 @@ +- hosts: localhost + vars_files: + - host_vars/nectar.yaml + gather_facts: true + + roles: + - role: openstack-common + - role: openstack-volume + - role: openstack-security-group + - role: cluster-security-group + - role: openstack-instance + +- hosts: instances + vars_files: + - host_vars/docker.yaml + gather_facts: true + + roles: + - role: openstack-proxy + - role: all-dependencies + - role: all-mount + - role: all-docker + +- hosts: web + vars_files: + - host_vars/react.yaml + gather_facts: true + + roles: + - role: react-build + +# - hosts: dbs + +# roles: +# - role: cluster-build + +# - hosts: master + +# roles: +# - role: slaves-cluster + + + \ No newline at end of file diff --git a/ansible/host_vars/docker.yaml b/ansible/host_vars/docker.yaml index bc49a97bee1050dbc016fc78322c7770d792e5ec..2ec8ebdc48e657f9d5a0fd91e86de516fef69989 100644 --- a/ansible/host_vars/docker.yaml +++ b/ansible/host_vars/docker.yaml @@ -1,4 +1,4 @@ --- - volumes: - - device: /dev/vdb - mountpoint: /var/lib/docker \ No newline at end of file +volumes: + - device: /dev/vdb + mountpoint: /var/lib/docker \ No newline at end of file diff --git a/ansible/host_vars/nectar.yaml b/ansible/host_vars/nectar.yaml index 862de34af1552bb9fca204c8da6b63e85fc765bc..5f1114c18f69457846d8fc09d913999454f6040b 100755 --- a/ansible/host_vars/nectar.yaml +++ b/ansible/host_vars/nectar.yaml @@ -55,15 +55,15 @@ cluster_security_group: # Instance instances: - - name: db1 + - name: db-master-1 volumes: ['dbvolume1'] meta: group: master - - name: db2 + - name: db-slave-1 volumes: ['dbvolume2'] meta: group: slaves - - name: db3 + - name: db-slave-2 volumes: ['dbvolume3'] meta: group: slaves diff --git a/ansible/hosts b/ansible/hosts index 2b2170259c8d6cdf49d40c6125e739435e4ed28b..3ea6080da91dc9f09f8b132c9f5f1da6f3a47cc5 100644 --- a/ansible/hosts +++ b/ansible/hosts @@ -1,11 +1,11 @@ [web] [master] -172.26.133.128 ansible_host=172.26.133.128 +172.26.133.58 ansible_host=172.26.133.58 [slaves] -172.26.134.57 ansible_host=172.26.134.57 -172.26.133.52 ansible_host=172.26.133.52 +172.26.132.78 ansible_host=172.26.132.78 +172.26.133.15 ansible_host=172.26.133.15 [dbs:children] master diff --git a/ansible/roles/slaves-cluster/templates/set-cluster-t.sh b/ansible/roles/slaves-cluster/templates/set-cluster-t.sh index 1db0382b121c70abc364371f20658657736d0d52..624fc50f00d49706046e80733a13439533d19fd3 100644 --- a/ansible/roles/slaves-cluster/templates/set-cluster-t.sh +++ b/ansible/roles/slaves-cluster/templates/set-cluster-t.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash echo "== Set variables ==" -export declare -a nodes=(172.26.133.128 172.26.133.52 172.26.134.57) #NEED TO AUTOMATE +export declare -a nodes=(172.26.133.58 172.26.132.78 172.26.133.15) #NEED TO AUTOMATE # export declare -a nodes=($1) export user=admin export pass=admin