| {% from 'virtual-mcp-trusty/underlay.yaml' import HOSTNAME_CFG01 with context %} |
| {% from 'virtual-mcp-trusty/underlay.yaml' import HOSTNAME_CTL01 with context %} |
| {% from 'virtual-mcp-trusty/underlay.yaml' import HOSTNAME_CTL02 with context %} |
| {% from 'virtual-mcp-trusty/underlay.yaml' import HOSTNAME_CTL03 with context %} |
| {% from 'virtual-mcp-trusty/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 %} |
| |
| # vkhlyunev: shared steps are constantly updating due master development so |
| # we cant use them for old release. For openstack.yaml we can use some shared |
| # steps for now but TODO: bind deployment workflow to 2018.8.0 state |
| |
| # Install OpenStack control services |
| - description: Sync time |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False -G 'oscodename:trusty' cmd.run "service ntp stop && ntpdate pool.ntp.org && service ntp start" |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: false |
| |
| {% import 'shared-openstack.yaml' as SHARED_OPENSTACK with context %} |
| |
| # Deploy nginx before openstack services (PROD-22740) |
| - 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 keystone service on primary node |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| -C 'I@keystone:server and *01*' state.sls keystone.server |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 2, delay: 15} |
| skip_fail: false |
| |
| - description: Install keystone service on other nodes |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| -C 'I@keystone:server' state.sls keystone.server |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 2, delay: 15} |
| skip_fail: false |
| |
| - description: Restart apache due to PROD-10477 |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' |
| cmd.run "service apache2 restart" |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 15} |
| skip_fail: false |
| |
| - description: Check apache status to PROD-10477 |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' |
| cmd.run "service apache2 status" |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 15} |
| skip_fail: false |
| |
| - description: Mount glusterfs.client volumes (resuires created 'keystone' system user) |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| -C 'I@keystone:server' state.sls glusterfs.client -b 1 |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: false |
| |
| - description: Update fernet keys for keystone server on the mounted glusterfs volume |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| -C 'I@keystone:server' state.sls keystone.server -b 1 |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: false |
| |
| - description: Populate keystone services/tenants/admins |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| -C 'I@keystone:client' state.sls keystone.client |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 2, delay: 5} |
| skip_fail: false |
| |
| - description: Check keystone service-list |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| -C "I@keystone:server" cmd.run ". /root/keystonercv3; |
| openstack service list" |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: false |
| |
| {{ SHARED_OPENSTACK.MACRO_INSTALL_GLANCE() }} |
| |
| - description: Install nova service on primary node |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| -C "I@nova:controller and *01*" state.sls nova.controller |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: false |
| |
| - description: Install nova service on other nodes |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| -C "I@nova:controller" state.sls nova.controller |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: false |
| |
| - description: Check nova service-list |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| -C "I@keystone:server" cmd.run ". /root/keystonercv3; |
| openstack compute service list" |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: false |
| |
| - description: Check nova list |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| -C "I@keystone:server" cmd.run ". /root/keystonercv3; |
| openstack server list" |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: false |
| |
| {{ SHARED_OPENSTACK.MACRO_INSTALL_CINDER() }} |
| |
| {{ SHARED_OPENSTACK.MACRO_INSTALL_NEUTRON() }} |
| |
| {{ SHARED_OPENSTACK.MACRO_INSTALL_HEAT() }} |
| |
| {{ SHARED_OPENSTACK.MACRO_INSTALL_HORIZON() }} |
| |
| # 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: true |
| |
| - description: Restart libvirtd on compute nodes (PROD-23034) |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' service.restart libvirtd |
| 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 |
| |
| # Upload cirros image |
| |
| - 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: Register image in glance |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| '. /root/keystonercv3; glance --timeout 120 image-create --name cirros --visibility public --disk-format qcow2 --container-format bare --progress < /root/cirros-0.3.4-i386-disk.img' |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, 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: Allow all tcp |
| # cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| # '. /root/keystonercv3; openstack security group rule create --proto tcp --dst-port 22 default' |
| # node_name: {{ HOSTNAME_CFG01 }} |
| # retry: {count: 1, delay: 30} |
| # skip_fail: false |
| # |
| #- description: Allow all icmp |
| # cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| # '. /root/keystonercv3; openstack security group rule create --proto icmp default' |
| # 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: true |
| |
| - description: Install docker.io on gtw |
| cmd: salt-call cmd.run 'apt-get install docker.io -y' |
| node_name: {{ HOSTNAME_CFG01 }} |
| 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 |