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