| {% from 'virtual-offline-ssl/underlay.yaml' import HOSTNAME_CFG01 with context %} |
| {% from 'virtual-offline-ssl/underlay.yaml' import HOSTNAME_CTL01 with context %} |
| {% from 'virtual-offline-ssl/underlay.yaml' import HOSTNAME_CTL02 with context %} |
| {% from 'virtual-offline-ssl/underlay.yaml' import HOSTNAME_CTL03 with context %} |
| {% from 'virtual-offline-ssl/underlay.yaml' import HOSTNAME_GTW01 with context %} |
| {% from 'shared-salt.yaml' import IPV4_NET_EXTERNAL_PREFIX with context %} |
| {% from 'shared-salt.yaml' import IPV4_NET_TENANT_PREFIX with context %} |
| |
| {% from 'virtual-offline-ssl/underlay.yaml' import LAB_CONFIG_NAME with context %} |
| {% from 'virtual-offline-ssl/underlay.yaml' import DOMAIN_NAME with context %} |
| |
| {% set REPOSITORY_SUITE = os_env('REPOSITORY_SUITE', 'proposed') %} |
| {% set DOMAIN_NAME = os_env('DOMAIN_NAME', 'virtual-offline-ssl') %} |
| {% import 'shared-backup-restore.yaml' as BACKUP with context %} |
| {% import 'shared-salt.yaml' as SHARED with context %} |
| {% import 'shared-openstack.yaml' as SHARED_OPENSTACK with context %} |
| |
| {% set DOCKER_LOCAL_REPO = os_env('DOCKER_LOCAL_REPO', 'deb [arch=amd64] http://mirror.mcp.mirantis.local.test/ubuntu-xenial/docker ' + REPOSITORY_SUITE + ' stable') %} |
| |
| |
| # Install OpenStack control services |
| |
| - description: Nginx |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| -C 'I@nginx:server' state.sls salt.minion |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: true |
| |
| - description: Deploy nginx proxy |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| -C 'I@nginx:server' state.sls nginx |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: true |
| |
| {{ SHARED_OPENSTACK.MACRO_INSTALL_KEYSTONE(USE_ORCHESTRATE=false) }} |
| |
| {{ SHARED_OPENSTACK.MACRO_INSTALL_GLANCE() }} |
| |
| {{ SHARED_OPENSTACK.MACRO_INSTALL_NOVA() }} |
| |
| {{ SHARED_OPENSTACK.MACRO_INSTALL_CINDER() }} |
| |
| {{ SHARED_OPENSTACK.MACRO_INSTALL_NEUTRON() }} |
| |
| ## isntall designate |
| #- description: Install bind |
| # cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| # -C 'I@bind:server' state.sls bind |
| # node_name: {{ HOSTNAME_CFG01 }} |
| # retry: {count: 1, delay: 5} |
| # skip_fail: false |
| # |
| #- description: Install designate |
| # cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| # -C 'I@designate:server' state.sls designate -b 1 |
| # node_name: {{ HOSTNAME_CFG01 }} |
| # retry: {count: 5, delay: 10} |
| # skip_fail: false |
| |
| {{ SHARED_OPENSTACK.MACRO_INSTALL_HEAT() }} |
| |
| # Install Telemetry services (mdb nodes) |
| - description: Install redis service |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@redis:cluster:role:master' state.sls redis && |
| salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@redis:server' state.sls redis |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: false |
| |
| - description: Install gnocchi server |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@gnocchi:server and *01*' state.sls gnocchi.server && |
| salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@gnocchi:server' state.sls gnocchi.server |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: false |
| |
| - description: Setup gnocchi client |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@gnocchi:client and *01*' state.sls gnocchi.client && |
| salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@gnocchi:client' state.sls gnocchi.client |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: false |
| |
| #- description: Install gnocchi statsd (optional) |
| # cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@gnocchi:statsd and *01*' state.sls gnocchi.statsd && |
| # salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@gnocchi:statsd' state.sls gnocchi.statsd |
| # node_name: {{ HOSTNAME_CFG01 }} |
| # retry: {count: 1, delay: 5} |
| # skip_fail: false |
| |
| - description: Install panko server |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@panko:server and *01*' state.sls panko && |
| salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@panko:server' state.sls panko |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: false |
| |
| - description: Install ceilometer server on first node |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceilometer:server and *01*' state.sls ceilometer |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 2, delay: 5} |
| skip_fail: false |
| |
| - description: Install ceilometer server on other nodes |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceilometer:server' state.sls ceilometer |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 2, delay: 5} |
| skip_fail: false |
| |
| - description: Install aodh server |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@aodh:server and *01*' state.sls aodh && |
| salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@aodh:server' state.sls aodh |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: false |
| |
| # Install OpenStack dashboard and proxy services |
| - description: Deploy horizon dashboard |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| -C 'I@horizon:server' state.sls horizon |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: true |
| |
| - description: Deploy nginx proxy |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| -C 'I@nginx:server' state.sls nginx |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: true |
| |
| - description: Install manila-api on first node |
| cmd: | |
| salt -C 'I@manila:api and *01*' state.sls manila.api; |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: false |
| |
| - description: Install manila-api on other nodes |
| cmd: | |
| salt -C 'I@manila:api and not *01*' state.sls manila.api; |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: false |
| |
| - description: Install manila-scheduler |
| cmd: | |
| salt -C 'I@manila:scheduler' state.sls manila.scheduler; |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: false |
| |
| - description: Install manila-share |
| cmd: | |
| salt -C 'I@manila:share' state.sls manila.share; |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: false |
| |
| - description: Check manila-services |
| cmd: | |
| salt 'ctl01*' cmd.run '. /root/keystonercv3; manila service-list' |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 3, delay: 5} |
| skip_fail: false |
| |
| - description: Create manila type |
| cmd: | |
| salt 'cfg01*' state.sls manila.client |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: false |
| |
| - description: Create CIFS and NFS share and check it status |
| cmd: | |
| salt 'ctl01*' cmd.run '. /root/keystonercv3; manila create CIFS 1 --share-type=default'; |
| salt 'ctl01*' cmd.run '. /root/keystonercv3; manila create NFS 1 --share-type=default'; |
| sleep 5; |
| salt 'ctl01*' cmd.run '. /root/keystonercv3; manila list'; |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: false |
| |
| # Install DogTag server service |
| - description: Install DogTag server service |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| -C 'I@dogtag:server and *01*' state.sls dogtag.server |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: false |
| |
| - description: Install DogTag server service |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| -C 'I@dogtag:server' state.sls dogtag.server |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: false |
| |
| # Install Barbican server service |
| - description: Install Barbican server service |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| -C 'I@barbican:server and *01*' state.sls barbican.server |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: false |
| |
| - description: Install Barbican server service |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| -C 'I@barbican:server' state.sls barbican.server |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: false |
| |
| - description: Install Barbican client |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| -C 'I@barbican:client' state.sls barbican.client |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: True |
| |
| # Install compute node |
| |
| - description: Apply formulas for compute node |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: true |
| |
| - description: Re-apply(as in doc) formulas for compute node |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: false |
| |
| - description: Check IP on computes |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run |
| 'ip a' |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 10, delay: 30} |
| skip_fail: false |
| |
| # Configure cinder-volume salt-call |
| #- description: Set disks 01 |
| # cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb' |
| # node_name: {{ HOSTNAME_CTL01 }} |
| # retry: {count: 1, delay: 30} |
| # skip_fail: false |
| # |
| #- description: Set disks 02 |
| # cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb' |
| # node_name: {{ HOSTNAME_CTL02 }} |
| # retry: {count: 1, delay: 30} |
| # skip_fail: false |
| # |
| #- description: Set disks 03 |
| # cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb' |
| # node_name: {{ HOSTNAME_CTL03 }} |
| # retry: {count: 1, delay: 30} |
| # skip_fail: false |
| # |
| #- description: Create partitions 01 |
| # cmd: salt-call cmd.run 'pvcreate /dev/vdb1' |
| # node_name: {{ HOSTNAME_CTL01 }} |
| # retry: {count: 1, delay: 30} |
| # skip_fail: false |
| # |
| #- description: Create partitions 02 |
| # cmd: salt-call cmd.run 'pvcreate /dev/vdb1' |
| # node_name: {{ HOSTNAME_CTL02 }} |
| # retry: {count: 1, delay: 30} |
| # skip_fail: false |
| # |
| #- description: Create partitions 03 |
| # cmd: salt-call cmd.run 'pvcreate /dev/vdb1' |
| # node_name: {{ HOSTNAME_CTL03 }} |
| # retry: {count: 1, delay: 30} |
| # skip_fail: false |
| # |
| #- description: create volume_group |
| # cmd: salt "ctl*" cmd.run 'vgcreate cinder-volumes /dev/vdb1' |
| # node_name: {{ HOSTNAME_CFG01 }} |
| # retry: {count: 1, delay: 30} |
| # skip_fail: false |
| # |
| #- description: Install cinder-volume |
| # cmd: salt 'ctl*' cmd.run 'apt-get install cinder-volume -y' |
| # node_name: {{ HOSTNAME_CFG01 }} |
| # retry: {count: 1, delay: 30} |
| # skip_fail: false |
| # |
| #- description: Install crudini |
| # cmd: salt "ctl*" cmd.run 'apt-get install crudini -y' |
| # node_name: {{ HOSTNAME_CFG01 }} |
| # retry: {count: 1, delay: 30} |
| # skip_fail: false |
| # |
| #- description: Temporary WR set enabled backends value 01 |
| # cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm' |
| # node_name: {{ HOSTNAME_CTL01 }} |
| # retry: {count: 1, delay: 30} |
| # skip_fail: false |
| # |
| #- description: Temporary WR set enabled backends value 02 |
| # cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm' |
| # node_name: {{ HOSTNAME_CTL02 }} |
| # retry: {count: 1, delay: 30} |
| # skip_fail: false |
| # |
| #- description: Temporary WR set enabled backends value 03 |
| # cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm' |
| # node_name: {{ HOSTNAME_CTL03 }} |
| # retry: {count: 1, delay: 30} |
| # skip_fail: false |
| # |
| #- description: Restart cinder volume |
| # cmd: | |
| # salt -C 'I@cinder:controller' service.restart cinder-volume; |
| # node_name: {{ HOSTNAME_CFG01 }} |
| # retry: {count: 2, delay: 5} |
| # skip_fail: false |
| # |
| - description: Upload cirros image on ctl01 |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 'wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-i386-disk.img' |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 2, delay: 30} |
| skip_fail: false |
| |
| - description: Create net04_external |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| '. /root/keystonercv3; neutron net-create net04_ext --router:external True --provider:physical_network physnet1 --provider:network_type flat' |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 30} |
| skip_fail: false |
| |
| - description: Create subnet_external |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| '. /root/keystonercv3; neutron subnet-create net04_ext {{ IPV4_NET_EXTERNAL_PREFIX }}.0/24 --name net04_ext__subnet --disable-dhcp --allocation-pool start={{ IPV4_NET_EXTERNAL_PREFIX }}.150,end={{ IPV4_NET_EXTERNAL_PREFIX }}.180 --gateway {{ IPV4_NET_EXTERNAL_PREFIX }}.1' |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 30} |
| skip_fail: false |
| |
| - description: Create net04 |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| '. /root/keystonercv3; neutron net-create net04' |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 30} |
| skip_fail: false |
| |
| - description: Create subnet_net04 |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| '. /root/keystonercv3; neutron subnet-create net04 {{ IPV4_NET_TENANT_PREFIX }}.0/24 --name net04__subnet --allocation-pool start={{ IPV4_NET_TENANT_PREFIX }}.120,end={{ IPV4_NET_TENANT_PREFIX }}.240' |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 30} |
| skip_fail: false |
| |
| - description: Create router |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| '. /root/keystonercv3; neutron router-create net04_router01' |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 30} |
| skip_fail: false |
| |
| - description: Set geteway |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| '. /root/keystonercv3; neutron router-gateway-set net04_router01 net04_ext' |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 30} |
| skip_fail: false |
| |
| - description: Add interface |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| '. /root/keystonercv3; neutron router-interface-add net04_router01 net04__subnet' |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 30} |
| skip_fail: false |
| |
| - description: sync time |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run |
| 'service ntp stop; ntpd -gq; service ntp start' |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 30} |
| skip_fail: false |
| |
| |
| - description: Enable local docker repo |
| cmd: | |
| set -e; |
| echo "{{ DOCKER_LOCAL_REPO }}" > /etc/apt/sources.list.d/mcp_docker.list; |
| apt-get clean; apt-get update; |
| node_name: {{ HOSTNAME_GTW01 }} |
| retry: {count: 1, delay: 30} |
| skip_fail: false |
| |
| - description: Install docker-ce on gtw |
| cmd: salt-call cmd.run 'apt-get install docker-ce -y' |
| node_name: {{ HOSTNAME_GTW01 }} |
| retry: {count: 1, delay: 30} |
| skip_fail: false |
| |
| - description: Enable forward policy on gtw |
| cmd: | |
| set -e; |
| iptables --policy FORWARD ACCEPT; |
| node_name: {{ HOSTNAME_GTW01 }} |
| retry: {count: 1, delay: 30} |
| skip_fail: false |
| |
| - description: create rc file on cfg |
| cmd: scp ctl01:/root/keystonercv3 /root |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 30} |
| skip_fail: false |
| |
| - description: Copy rc file |
| cmd: scp /root/keystonercv3 gtw01:/root |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 30} |
| skip_fail: false |