diff options
Diffstat (limited to 'openstack-ansible')
-rw-r--r-- | openstack-ansible/file/opnfv-setup-openstack.yml | 36 | ||||
-rw-r--r-- | openstack-ansible/playbooks/inventory | 4 | ||||
-rw-r--r-- | openstack-ansible/playbooks/jumphost_configuration.yml | 10 | ||||
-rwxr-xr-x | openstack-ansible/scripts/osa_deploy.sh | 26 | ||||
-rw-r--r-- | openstack-ansible/var/ubuntu.yml | 6 |
5 files changed, 61 insertions, 21 deletions
diff --git a/openstack-ansible/file/opnfv-setup-openstack.yml b/openstack-ansible/file/opnfv-setup-openstack.yml new file mode 100644 index 00000000..b3deba08 --- /dev/null +++ b/openstack-ansible/file/opnfv-setup-openstack.yml @@ -0,0 +1,36 @@ +--- +# Copyright 2014, Rackspace US, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +- include: os-keystone-install.yml +- include: os-barbican-install.yml +- include: os-glance-install.yml +- include: os-cinder-install.yml +- include: os-nova-install.yml +- include: os-neutron-install.yml +- include: os-heat-install.yml +- include: os-horizon-install.yml +- include: os-ceilometer-install.yml +- include: os-aodh-install.yml +- include: os-designate-install.yml +#NOTE(stevelle) Ensure Gnocchi identities exist before Swift +- include: os-gnocchi-install.yml + when: + - gnocchi_storage_driver is defined + - gnocchi_storage_driver == 'swift' + vars: + gnocchi_identity_only: True +- include: os-swift-install.yml +- include: os-gnocchi-install.yml +- include: os-ironic-install.yml diff --git a/openstack-ansible/playbooks/inventory b/openstack-ansible/playbooks/inventory index f53da530..d3768f51 100644 --- a/openstack-ansible/playbooks/inventory +++ b/openstack-ansible/playbooks/inventory @@ -1,5 +1,5 @@ -[jumphost] -jumphost ansible_ssh_host=192.168.122.2 +[xcimaster] +xcimaster ansible_ssh_host=192.168.122.2 [controller] controller00 ansible_ssh_host=192.168.122.3 diff --git a/openstack-ansible/playbooks/jumphost_configuration.yml b/openstack-ansible/playbooks/jumphost_configuration.yml index 74e97cdd..b6c79a41 100644 --- a/openstack-ansible/playbooks/jumphost_configuration.yml +++ b/openstack-ansible/playbooks/jumphost_configuration.yml @@ -1,5 +1,5 @@ --- -- hosts: jumphost +- hosts: xcimaster remote_user: root vars_files: - ../var/ubuntu.yml @@ -13,7 +13,11 @@ - name: remove the directory shell: "rm -rf {{OSA_PATH}} {{OSA_ETC_PATH}}" - name: git openstack ansible - shell: "git clone {{OSA_URL}} {{OSA_PATH}} -b {{OSA_BRANCH}}" + shell: "git clone {{OSA_URL}} {{OSA_PATH}} -b {{OPENSTACK_BRANCH}}" + - name: copy opnfv-setup-openstack.yml to /opt/openstack-ansible/playbooks + copy: + src: ../file/opnfv-setup-openstack.yml + dest: "{{OSA_PATH}}/playbooks/opnfv-setup-openstack.yml" - name: copy /opt/openstack-ansible/etc/openstack_deploy to /etc/openstack_deploy shell: "/bin/cp -rf {{OSA_PATH}}/etc/openstack_deploy {{OSA_ETC_PATH}}" - name: bootstrap @@ -50,4 +54,4 @@ remote_user: root tasks: - name: Generate authorized_keys - shell: "/bin/cat /jumphost/root/.ssh/id_rsa.pub >> ../file/authorized_keys" + shell: "/bin/cat /xcimaster/root/.ssh/id_rsa.pub >> ../file/authorized_keys" diff --git a/openstack-ansible/scripts/osa_deploy.sh b/openstack-ansible/scripts/osa_deploy.sh index 79625d21..afc8368b 100755 --- a/openstack-ansible/scripts/osa_deploy.sh +++ b/openstack-ansible/scripts/osa_deploy.sh @@ -3,27 +3,27 @@ export OSA_PATH=/opt/openstack-ansible export LOG_PATH=$OSA_PATH/log export PLAYBOOK_PATH=$OSA_PATH/playbooks -export OSA_BRANCH=${OSA_BRANCH:-"master"} -JUMPHOST_IP="192.168.122.2" +export OPENSTACK_BRANCH=${OPENSTACK_BRANCH:-"master"} +XCIMASTER_IP="192.168.122.2" sudo /bin/rm -rf $LOG_PATH sudo /bin/mkdir -p $LOG_PATH sudo /bin/cp /root/.ssh/id_rsa.pub ../file/authorized_keys -sudo echo -e '\n'>>../file/authorized_keys +echo -e '\n' | sudo tee --append ../file/authorized_keys cd ../playbooks/ # this will prepare the jump host # git clone the Openstack-Ansible, bootstrap and configure network -sudo ansible-playbook -i inventory jumphost_configuration.yml -vvv +sudo -E ansible-playbook -i inventory jumphost_configuration.yml # this will prepare the target host # such as configure network and NFS -sudo ansible-playbook -i inventory targethost_configuration.yml +sudo -E ansible-playbook -i inventory targethost_configuration.yml # using OpenStack-Ansible deploy the OpenStack echo "set UP Host !" -sudo /bin/sh -c "ssh root@$JUMPHOST_IP openstack-ansible \ +sudo -E /bin/sh -c "ssh root@$XCIMASTER_IP openstack-ansible \ $PLAYBOOK_PATH/setup-hosts.yml" | \ tee $LOG_PATH/setup-host.log @@ -39,7 +39,7 @@ else fi echo "Set UP Infrastructure !" -sudo /bin/sh -c "ssh root@$JUMPHOST_IP openstack-ansible \ +sudo -E /bin/sh -c "ssh root@$XCIMASTER_IP openstack-ansible \ $PLAYBOOK_PATH/setup-infrastructure.yml" | \ tee $LOG_PATH/setup-infrastructure.log @@ -52,7 +52,7 @@ else echo "setup infrastructure successfully!" fi -sudo /bin/sh -c "ssh root@$JUMPHOST_IP ansible -i $PLAYBOOK_PATH/inventory/ \ +sudo -E /bin/sh -c "ssh root@$XCIMASTER_IP ansible -i $PLAYBOOK_PATH/inventory/ \ galera_container -m shell \ -a "mysql -h localhost -e 'show status like \"%wsrep_cluster_%\";'"" \ | tee $LOG_PATH/galera.log @@ -66,12 +66,12 @@ else fi echo "Set UP OpenStack !" -sudo /bin/sh -c "ssh root@$JUMPHOST_IP openstack-ansible \ - $PLAYBOOK_PATH/setup-openstack.yml" | \ - tee $LOG_PATH/setup-openstack.log +sudo -E /bin/sh -c "ssh root@$XCIMASTER_IP openstack-ansible \ + $PLAYBOOK_PATH/opnfv-setup-openstack.yml" | \ + tee $LOG_PATH/opnfv-setup-openstack.log -grep "failed=1" $LOG_PATH/setup-openstack.log>/dev/null \ - || grep "unreachable=1" $LOG_PATH/setup-openstack.log>/dev/null +grep "failed=1" $LOG_PATH/opnfv-setup-openstack.log>/dev/null \ + || grep "unreachable=1" $LOG_PATH/opnfv-setup-openstack.log>/dev/null if [ $? -eq 0 ]; then echo "failed setup openstack!" exit 1 diff --git a/openstack-ansible/var/ubuntu.yml b/openstack-ansible/var/ubuntu.yml index 9464384b..321a7c4e 100644 --- a/openstack-ansible/var/ubuntu.yml +++ b/openstack-ansible/var/ubuntu.yml @@ -2,7 +2,7 @@ OSA_URL: https://git.openstack.org/openstack/openstack-ansible OSA_PATH: /opt/openstack-ansible OSA_ETC_PATH: /etc/openstack_deploy -OSA_BRANCH: "{{ lookup('env','OSA_BRANCH') }}" +OPENSTACK_BRANCH: "{{ lookup('env','OPENSTACK_BRANCH') }}" -JUMPHOST_IP: 192.168.122.2 -host_info: {'jumphost':{'MGMT_IP': '172.29.236.10','VLAN_IP': '192.168.122.2', 'STORAGE_IP': '172.29.244.10'},'controller00':{'MGMT_IP': '172.29.236.11','VLAN_IP': '192.168.122.3', 'STORAGE_IP': '172.29.244.11'},'controller01':{'MGMT_IP': '172.29.236.12','VLAN_IP': '192.168.122.4', 'STORAGE_IP': '172.29.244.12'},'controller02':{'MGMT_IP': '172.29.236.13','VLAN_IP': '192.168.122.5', 'STORAGE_IP': '172.29.240.13'},'compute00':{'MGMT_IP': '172.29.236.14','VLAN_IP': '192.168.122.6','VLAN_IP_SECOND': '173.29.241.1','VXLAN_IP': '172.29.240.14', 'STORAGE_IP': '172.29.244.14'},'compute01':{'MGMT_IP': '172.29.236.15','VLAN_IP': '192.168.122.7','VLAN_IP_SECOND': '173.29.241.2','VXLAN_IP': '172.29.240.15', 'STORAGE_IP': '172.29.244.15'}} +XCIMASTER_IP: 192.168.122.2 +host_info: {'xcimaster':{'MGMT_IP': '172.29.236.10','VLAN_IP': '192.168.122.2', 'STORAGE_IP': '172.29.244.10'},'controller00':{'MGMT_IP': '172.29.236.11','VLAN_IP': '192.168.122.3', 'STORAGE_IP': '172.29.244.11'},'controller01':{'MGMT_IP': '172.29.236.12','VLAN_IP': '192.168.122.4', 'STORAGE_IP': '172.29.244.12'},'controller02':{'MGMT_IP': '172.29.236.13','VLAN_IP': '192.168.122.5', 'STORAGE_IP': '172.29.240.13'},'compute00':{'MGMT_IP': '172.29.236.14','VLAN_IP': '192.168.122.6','VLAN_IP_SECOND': '173.29.241.1','VXLAN_IP': '172.29.240.14', 'STORAGE_IP': '172.29.244.14'},'compute01':{'MGMT_IP': '172.29.236.15','VLAN_IP': '192.168.122.7','VLAN_IP_SECOND': '173.29.241.2','VXLAN_IP': '172.29.240.15', 'STORAGE_IP': '172.29.244.15'}} |