sgudz | f0ff030 | 2018-01-29 18:50:01 +0200 | [diff] [blame] | 1 | {% from 'cookied-bm-ocata-cicd-pipeline/underlay.yaml' import HOSTNAME_CFG01 with context %} |
| 2 | {% from 'cookied-bm-ocata-cicd-pipeline/underlay.yaml' import DOMAIN_NAME with context %} |
sgudz | 237fba0 | 2018-02-23 15:07:04 +0200 | [diff] [blame] | 3 | {% from 'cookied-bm-ocata-cicd-pipeline/underlay.yaml' import LAB_CONFIG_NAME with context %} |
sgudz | f0ff030 | 2018-01-29 18:50:01 +0200 | [diff] [blame] | 4 | |
| 5 | {% set NFV_ENABLED = os_env('NFV_ENABLED','false') %} |
| 6 | |
| 7 | {%- if NFV_ENABLED == 'true' %} |
| 8 | {%- set CLUSTER_CONTEXT_NAME = 'salt-context-cookiecutter-initial-cicd-nfv.yaml' %} |
| 9 | {%- set ENVIRONMENT_CONTEXT_NAMES = ['salt-context-environment.yaml','lab04-physical-inventory-nfv.yaml'] %} |
| 10 | {% set ENVIRONMENT_MODEL_INVENTORY_NAME = os_env('ENVIRONMENT_MODEL_INVENTORY_NAME','physical-ocata-cicd-nfv') %} |
| 11 | {%- else %} |
| 12 | {%- set CLUSTER_CONTEXT_NAME = 'salt-context-cookiecutter-initial-cicd.yaml' %} |
| 13 | {%- set ENVIRONMENT_CONTEXT_NAMES = ['salt-context-environment.yaml','lab04-physical-inventory.yaml'] %} |
| 14 | {% set ENVIRONMENT_MODEL_INVENTORY_NAME = os_env('ENVIRONMENT_MODEL_INVENTORY_NAME','physical-ocata-cicd') %} |
| 15 | {%- endif %} |
| 16 | |
| 17 | {%- set CONTROL_VLAN = os_env('CONTROL_VLAN', '2422') %} |
| 18 | {%- set TENANT_VLAN = os_env('TENANT_VLAN', '2423') %} |
| 19 | |
| 20 | |
| 21 | {% import 'shared-salt.yaml' as SHARED with context %} |
| 22 | |
| 23 | |
| 24 | {{ SHARED.MACRO_INSTALL_SALT_MASTER() }} |
| 25 | |
| 26 | {{ SHARED.MACRO_GENERATE_COOKIECUTTER_MODEL(CONTROL_VLAN=CONTROL_VLAN, TENANT_VLAN=TENANT_VLAN) }} |
| 27 | |
| 28 | {{ SHARED.MACRO_GENERATE_AND_ENABLE_ENVIRONMENT_MODEL() }} |
| 29 | |
Tatyana Leontovich | eedbd85 | 2018-07-10 11:29:38 +0300 | [diff] [blame] | 30 | {{ 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" "glusterfs" "xtrabackup" "maas" "backupninja" "jenkins" "auditd" ') }} |
sgudz | f0ff030 | 2018-01-29 18:50:01 +0200 | [diff] [blame] | 31 | |
sgudz | 1be0cef | 2018-02-23 15:42:35 +0200 | [diff] [blame] | 32 | - description: 'Workaround for typo in salt.minion.service (https://gerrit.mcp.mirantis.net/#/c/14806/)' |
| 33 | cmd: | |
| 34 | git clone https://gerrit.mcp.mirantis.net/salt-formulas/salt /tmp/salt-formula-salt; |
| 35 | pushd /tmp/salt-formula-salt; |
| 36 | git fetch https://gerrit.mcp.mirantis.net/salt-formulas/salt refs/changes/06/14806/1 && git checkout FETCH_HEAD; |
| 37 | popd; |
| 38 | cp /tmp/salt-formula-salt/salt/minion/service.sls /usr/share/salt-formulas/env/salt/minion/service.sls; |
| 39 | node_name: {{ HOSTNAME_CFG01 }} |
| 40 | retry: {count: 1, delay: 5} |
| 41 | skip_fail: false |
| 42 | |
sgudz | f0ff030 | 2018-01-29 18:50:01 +0200 | [diff] [blame] | 43 | {{ SHARED.MACRO_INSTALL_SALT_MINIONS() }} |
| 44 | |
| 45 | {{ SHARED.MACRO_RUN_SALT_MASTER_UNDERLAY_STATES() }} |
| 46 | |
| 47 | - description: "Workaround for rack01 compute generator" |
| 48 | cmd: | |
| 49 | set -e; |
| 50 | # Remove rack01 key |
| 51 | . /root/venv-reclass-tools/bin/activate; |
| 52 | reclass-tools del-key parameters.reclass.storage.node.openstack_compute_rack01 /srv/salt/reclass/classes/cluster/{{ SHARED.CLUSTER_NAME }}/infra/config.yml; |
| 53 | # Add openstack_compute_node definition from system |
| 54 | reclass-tools add-key 'classes' 'system.reclass.storage.system.openstack_compute_multi' /srv/salt/reclass/classes/cluster/{{ SHARED.CLUSTER_NAME }}/infra/config.yml --merge; |
| 55 | |
| 56 | node_name: {{ HOSTNAME_CFG01 }} |
| 57 | retry: {count: 1, delay: 10} |
| 58 | skip_fail: false |
| 59 | |
sgudz | f0ff030 | 2018-01-29 18:50:01 +0200 | [diff] [blame] | 60 | - description: "Workaround for PROD-16973" |
| 61 | cmd: | |
| 62 | set -e; |
| 63 | # Remove obsolete logging section key |
| 64 | . /root/venv-reclass-tools/bin/activate; |
| 65 | reclass-tools del-key parameters.nova.controller.logging /srv/salt/reclass/classes/system/nova/control/cluster.yml; |
| 66 | node_name: {{ HOSTNAME_CFG01 }} |
| 67 | retry: {count: 1, delay: 5} |
| 68 | skip_fail: false |
| 69 | |
| 70 | {{ SHARED.MACRO_GENERATE_INVENTORY() }} |
| 71 | |
| 72 | {{ SHARED.MACRO_NETWORKING_WORKAROUNDS() }} |
| 73 | |
| 74 | - description: Temporary workaround for removing cinder-volume from CTL nodes |
| 75 | cmd: | |
| 76 | sed -i 's/\-\ system\.cinder\.volume\.single//g' /srv/salt/reclass/classes/cluster/{{ SHARED.CLUSTER_NAME }}/openstack/control.yml; |
| 77 | sed -i 's/\-\ system\.cinder\.volume\.notification\.messagingv2//g' /srv/salt/reclass/classes/cluster/{{ SHARED.CLUSTER_NAME }}/openstack/control.yml; |
| 78 | node_name: {{ HOSTNAME_CFG01 }} |
| 79 | retry: {count: 1, delay: 5} |
| 80 | skip_fail: true |
| 81 | |
| 82 | - description: WR for mounting 1G hugepages before linux.state |
| 83 | cmd: | |
| 84 | salt 'cmp*' state.sls linux.system.hugepages; |
| 85 | salt 'cmp*' cmd.run "mount -o mode=775,pagesize=1G -t hugetlbfs Hugetlbfs-kvm /mnt/hugepages_1G"; |
| 86 | salt 'cmp*' cmd.run "echo 16 | sudo tee /sys/kernel/mm/hugepages/hugepages-1048576kB/nr_hugepages"; |
| 87 | node_name: {{ HOSTNAME_CFG01 }} |
| 88 | retry: {count: 1, delay: 10} |
| 89 | skip_fail: false |
| 90 | |
| 91 | - description: WR for correct acces to git repo from jenkins on cfg01 node |
| 92 | cmd: | |
| 93 | git clone --mirror https://github.com/Mirantis/mk-pipelines.git /home/repo/mk/mk-pipelines/; |
| 94 | git clone --mirror https://github.com/Mirantis/pipeline-library.git /home/repo/mcp-ci/pipeline-library/; |
| 95 | chown -R git:www-data /home/repo/mk/mk-pipelines/*; |
| 96 | chown -R git:www-data /home/repo/mcp-ci/pipeline-library/*; |
| 97 | |
| 98 | node_name: {{ HOSTNAME_CFG01 }} |
| 99 | retry: {count: 1, delay: 10} |
| 100 | skip_fail: false |
| 101 | |
| 102 | {{ SHARED.MACRO_BOOTSTRAP_ALL_MINIONS() }} |
| 103 | |
| 104 | ######################################### |
| 105 | # Configure all running salt minion nodes |
| 106 | ######################################### |
| 107 | |
| 108 | - description: Hack resolv.conf on VCP nodes for internal services access |
| 109 | cmd: | |
| 110 | salt --hard-crash --state-output=mixed --state-verbose=False -C '* and not kvm* and not cmp* and not gtw* and not cfg*' cmd.run "echo 'nameserver 172.18.208.44' > /etc/resolv.conf;" |
| 111 | node_name: {{ HOSTNAME_CFG01 }} |
| 112 | retry: {count: 1, delay: 5} |
| 113 | skip_fail: false |
| 114 | |
| 115 | - description: Refresh pillars on all minions |
| 116 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' saltutil.refresh_pillar |
| 117 | node_name: {{ HOSTNAME_CFG01 }} |
| 118 | retry: {count: 1, delay: 5} |
| 119 | skip_fail: false |
| 120 | |
| 121 | - description: Sync all salt resources |
| 122 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' saltutil.sync_all && sleep 5 |
| 123 | node_name: {{ HOSTNAME_CFG01 }} |
| 124 | retry: {count: 1, delay: 5} |
| 125 | skip_fail: false |
| 126 | |
| 127 | - description: Show reclass-salt --top for generated nodes |
| 128 | cmd: reclass-salt --top -u /srv/salt/reclass/nodes/_generated/ |
| 129 | node_name: {{ HOSTNAME_CFG01 }} |
| 130 | retry: {count: 1, delay: 5} |
| 131 | skip_fail: false |
Tatyana Leontovich | 4453dd6 | 2018-06-26 18:44:31 +0300 | [diff] [blame] | 132 | |
| 133 | {{SHARED.MACRO_CHECK_SALT_VERSION_SERVICES_ON_CFG()}} |
| 134 | |
| 135 | {{SHARED.MACRO_CHECK_SALT_VERSION_ON_NODES()}} |