Dennis Dmitriev | 75776c5 | 2017-12-26 18:22:53 +0200 | [diff] [blame] | 1 | {% from 'virtual-mcp-ocata-ceph-offline/underlay.yaml' import HOSTNAME_APT01 with context %} |
| 2 | {% from 'virtual-mcp-ocata-ceph-offline/underlay.yaml' import HOSTNAME_CFG01 with context %} |
| 3 | {% from 'virtual-mcp-ocata-ceph-offline/underlay.yaml' import HOSTNAME_CTL01 with context %} |
| 4 | {% from 'virtual-mcp-ocata-ceph-offline/underlay.yaml' import HOSTNAME_CTL02 with context %} |
| 5 | {% from 'virtual-mcp-ocata-ceph-offline/underlay.yaml' import HOSTNAME_CTL03 with context %} |
| 6 | {% from 'virtual-mcp-ocata-ceph-offline/underlay.yaml' import HOSTNAME_CMP01 with context %} |
| 7 | {% from 'virtual-mcp-ocata-ceph-offline/underlay.yaml' import HOSTNAME_CMP02 with context %} |
| 8 | {% from 'virtual-mcp-ocata-ceph-offline/underlay.yaml' import HOSTNAME_GTW01 with context %} |
| 9 | {% from 'virtual-mcp-ocata-ceph-offline/underlay.yaml' import HOSTNAME_PRX01 with context %} |
| 10 | {% from 'virtual-mcp-ocata-ceph-offline/underlay.yaml' import HOSTNAME_CMN01 with context %} |
| 11 | {% from 'virtual-mcp-ocata-ceph-offline/underlay.yaml' import HOSTNAME_CMN02 with context %} |
| 12 | {% from 'virtual-mcp-ocata-ceph-offline/underlay.yaml' import HOSTNAME_CMN03 with context %} |
| 13 | {% from 'virtual-mcp-ocata-ceph-offline/underlay.yaml' import HOSTNAME_OSD01 with context %} |
| 14 | {% from 'virtual-mcp-ocata-ceph-offline/underlay.yaml' import HOSTNAME_OSD02 with context %} |
| 15 | {% from 'virtual-mcp-ocata-ceph-offline/underlay.yaml' import LAB_CONFIG_NAME with context %} |
| 16 | {% from 'virtual-mcp-ocata-ceph-offline/underlay.yaml' import DOMAIN_NAME with context %} |
| 17 | |
| 18 | {% set SALT_MODELS_REPOSITORY = os_env('SALT_MODELS_REPOSITORY','https://gerrit.mcp.mirantis.local.test/salt-models/mcp-virtual-lab') %} |
| 19 | # Other salt model repository parameters see in shared-salt.yaml |
| 20 | |
| 21 | |
| 22 | {% import 'shared-salt.yaml' as SHARED with context %} |
| 23 | {% from 'shared-salt.yaml' import IPV4_NET_CONTROL_PREFIX with context %} |
| 24 | |
| 25 | #- description: 'Generate nginx cert' |
| 26 | # cmd: | |
| 27 | # openssl req -new -newkey rsa:4096 -days 365 -nodes -x509 \ |
| 28 | # -subj "/C=US/ST=Denial/L=Springfield/O=Dis/CN=www.gerrit.com" \ |
| 29 | # -keyout ssl-nginx.key -out ssl-nginx.crt; |
| 30 | # node_name: {{ HOSTNAME_APT01 }} |
| 31 | # retry: {count: 1, delay: 5} |
| 32 | # skip_fail: false |
| 33 | |
| 34 | - description: Check nginx APT node is ready |
| 35 | cmd: systemctl status nginx; |
| 36 | node_name: {{ HOSTNAME_APT01 }} |
| 37 | retry: {count: 1, delay: 10} |
| 38 | skip_fail: false |
| 39 | |
| 40 | - description: Check dnsmasq on APT node is ready |
| 41 | cmd: systemctl status dnsmasq; |
| 42 | node_name: {{ HOSTNAME_APT01 }} |
| 43 | retry: {count: 1, delay: 10} |
| 44 | skip_fail: false |
| 45 | |
| 46 | {{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_CFG01) }} |
| 47 | {{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_CTL01) }} |
| 48 | {{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_CTL02) }} |
| 49 | {{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_CTL03) }} |
| 50 | {{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_CMP01) }} |
| 51 | {{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_CMP02) }} |
| 52 | {{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_CMN01) }} |
| 53 | {{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_CMN02) }} |
| 54 | {{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_CMN03) }} |
| 55 | {{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_OSD01) }} |
| 56 | {{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_OSD02) }} |
| 57 | {{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_GTW01) }} |
| 58 | {{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_PRX01) }} |
| 59 | |
| 60 | {{ SHARED.MACRO_INSTALL_SALT_MASTER() }} |
| 61 | |
| 62 | {{ SHARED.MACRO_CLONE_RECLASS_MODELS() }} |
| 63 | |
| 64 | - description: 'Workaround of local_repo_url - set to offline image repository structure' |
| 65 | cmd: | |
| 66 | find /srv/salt/reclass/classes/cluster -type f -exec sed -i 's/local_repo_url: .*/local_repo_url: mirror.mcp.mirantis.local.test/g' {} + |
Dennis Dmitriev | a7f3824 | 2018-01-12 16:12:02 +0200 | [diff] [blame] | 67 | find /srv/salt/reclass/classes/cluster -type f -exec sed -i 's/aptly_server_address: .*/aptly_server_address: {{ os_env('HOST_APT') }}/g' {} + |
Dennis Dmitriev | 75776c5 | 2017-12-26 18:22:53 +0200 | [diff] [blame] | 68 | node_name: {{ HOSTNAME_CFG01 }} |
| 69 | retry: {count: 1, delay: 10} |
| 70 | skip_fail: false |
| 71 | |
| 72 | {{ SHARED.MACRO_CONFIGURE_RECLASS(FORMULA_SERVICES='"linux" "reclass" "salt" "openssh" "ntp" "git" "nginx" "collectd" "sensu" "heka" "sphinx" "keystone" "mysql" "grafana" "haproxy" "rsyslog" "horizon" "prometheus" "telegraf" "elasticsearch" "powerdns"') }} |
| 73 | |
| 74 | {{ SHARED.MACRO_INSTALL_SALT_MINIONS() }} |
| 75 | |
| 76 | {{ SHARED.MACRO_RUN_SALT_MASTER_UNDERLAY_STATES() }} |
| 77 | |
| 78 | {{ SHARED.MACRO_GENERATE_INVENTORY() }} |
| 79 | |
| 80 | {{ SHARED.MACRO_BOOTSTRAP_ALL_MINIONS() }} |
| 81 | |
| 82 | - description: Hack gtw node |
| 83 | cmd: salt 'gtw*' cmd.run "ip addr del {{ IPV4_NET_CONTROL_PREFIX }}.110/24 dev ens4; ip addr flush dev ens4"; |
| 84 | node_name: {{ HOSTNAME_CFG01 }} |
| 85 | retry: {count: 1, delay: 10} |
| 86 | skip_fail: false |
| 87 | |
| 88 | - description: Hack cmp01 node |
| 89 | cmd: salt 'cmp01*' cmd.run "ip addr del {{ IPV4_NET_CONTROL_PREFIX }}.105/24 dev ens4; ip addr flush dev ens4"; |
| 90 | node_name: {{ HOSTNAME_CFG01 }} |
| 91 | retry: {count: 1, delay: 10} |
| 92 | skip_fail: false |
| 93 | |
| 94 | - description: Hack cmp02 node |
| 95 | cmd: salt 'cmp02*' cmd.run "ip addr del {{ IPV4_NET_CONTROL_PREFIX }}.106/24 dev ens4; ip addr flush dev ens4"; |
| 96 | node_name: {{ HOSTNAME_CFG01 }} |
| 97 | retry: {count: 1, delay: 10} |
| 98 | skip_fail: false |