Oleksii Butenko | f65a004 | 2018-06-27 13:38:43 +0300 | [diff] [blame] | 1 | {% from 'cookied-bm-dpdk-pipeline/underlay.yaml' import HOSTNAME_CFG01 with context %} |
| 2 | {% from 'cookied-bm-dpdk-pipeline/underlay.yaml' import HOSTNAME_CMP01 with context %} |
| 3 | {% from 'cookied-bm-dpdk-pipeline/underlay.yaml' import HOSTNAME_CMP02 with context %} |
| 4 | {% from 'cookied-bm-dpdk-pipeline/underlay.yaml' import HOSTNAME_GTW01 with context %} |
| 5 | {% from 'cookied-bm-dpdk-pipeline/underlay.yaml' import LAB_CONFIG_NAME with context %} |
| 6 | {% from 'cookied-bm-dpdk-pipeline/underlay.yaml' import DOMAIN_NAME with context %} |
| 7 | |
| 8 | {% set SALT_MODELS_REPOSITORY = os_env('SALT_MODELS_REPOSITORY','https://gerrit.mcp.mirantis.net/salt-models/mcp-baremetal-lab') %} |
| 9 | # Other salt model repository parameters see in shared-salt.yaml |
| 10 | |
| 11 | {% import 'shared-salt.yaml' as SHARED with context %} |
| 12 | |
| 13 | {{ SHARED.MACRO_INSTALL_SALT_MASTER() }} |
| 14 | |
| 15 | {{ SHARED.MACRO_CLONE_RECLASS_MODELS() }} |
| 16 | |
Dennis Dmitriev | d96773d | 2018-08-13 13:35:31 +0300 | [diff] [blame] | 17 | - description: "Workaround for PROD-22201 (remove after switching to reclass 1.5.x) - Remove linux.network.interface object from the system models and use fixed 'environment' model instead" |
| 18 | cmd: | |
| 19 | set -e; |
| 20 | apt-get -y install python-virtualenv python-pip build-essential python-dev libssl-dev; |
| 21 | [[ -d /root/venv-reclass-tools ]] || virtualenv /root/venv-reclass-tools; |
| 22 | . /root/venv-reclass-tools/bin/activate; |
| 23 | pip install git+https://github.com/dis-xcom/reclass-tools; |
| 24 | reclass-tools del-key parameters.linux.network.interface /srv/salt/reclass/classes/system/; |
| 25 | |
| 26 | node_name: {{ HOSTNAME_CFG01 }} |
| 27 | retry: {count: 1, delay: 5} |
| 28 | skip_fail: false |
| 29 | |
Vladimir Jigulin | f557c56 | 2018-07-30 18:30:09 +0400 | [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" "fluentd" "runtest" "maas" "jenkins" "glusterfs" "backupninja" "auditd" "logrotate"') }} |
Oleksii Butenko | f65a004 | 2018-06-27 13:38:43 +0300 | [diff] [blame] | 31 | |
| 32 | {{ SHARED.MACRO_INSTALL_SALT_MINIONS() }} |
| 33 | |
| 34 | {{ SHARED.MACRO_RUN_SALT_MASTER_UNDERLAY_STATES() }} |
| 35 | |
| 36 | {{ SHARED.MACRO_GENERATE_INVENTORY() }} |
| 37 | {{ SHARED.MACRO_NETWORKING_WORKAROUNDS() }} |
| 38 | node_name: {{ HOSTNAME_CFG01 }} |
| 39 | retry: {count: 1, delay: 10} |
| 40 | skip_fail: false |
| 41 | |
| 42 | - description: Temporary workaround for removing cinder-volume from CTL nodes |
| 43 | cmd: | |
| 44 | sed -i 's/\-\ system\.cinder\.volume\.single//g' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/control.yml; |
| 45 | sed -i 's/\-\ system\.cinder\.volume\.notification\.messagingv2//g' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/control.yml; |
| 46 | node_name: {{ HOSTNAME_CFG01 }} |
| 47 | retry: {count: 1, delay: 5} |
| 48 | skip_fail: true |
| 49 | |
| 50 | - description: WR for mounting 1G hugepages before linux.state |
| 51 | cmd: | |
| 52 | salt 'cmp*' state.sls linux.system.hugepages; |
| 53 | salt 'cmp*' cmd.run "mount -o mode=775,pagesize=1G -t hugetlbfs Hugetlbfs-kvm /mnt/hugepages_1G"; |
| 54 | salt 'cmp*' cmd.run "echo 16 | sudo tee /sys/kernel/mm/hugepages/hugepages-1048576kB/nr_hugepages"; |
| 55 | node_name: {{ HOSTNAME_CFG01 }} |
| 56 | retry: {count: 1, delay: 10} |
| 57 | skip_fail: false |
| 58 | |
Oleksii Butenko | f65a004 | 2018-06-27 13:38:43 +0300 | [diff] [blame] | 59 | - description: WR for correct acces to git repo from jenkins on cfg01 node |
| 60 | cmd: | |
| 61 | git clone --mirror https://github.com/Mirantis/mk-pipelines.git /home/repo/mk/mk-pipelines/; |
| 62 | git clone --mirror https://github.com/Mirantis/pipeline-library.git /home/repo/mcp-ci/pipeline-library/; |
| 63 | chown -R git:www-data /home/repo/mk/mk-pipelines/*; |
| 64 | chown -R git:www-data /home/repo/mcp-ci/pipeline-library/*; |
| 65 | |
| 66 | node_name: {{ HOSTNAME_CFG01 }} |
| 67 | retry: {count: 1, delay: 10} |
| 68 | skip_fail: false |
| 69 | |
| 70 | {{ SHARED.MACRO_BOOTSTRAP_ALL_MINIONS() }} |
| 71 | |
| 72 | ######################################### |
| 73 | # Configure all running salt minion nodes |
| 74 | ######################################### |
| 75 | |
| 76 | - description: Refresh pillars on all minions |
| 77 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' saltutil.refresh_pillar |
| 78 | node_name: {{ HOSTNAME_CFG01 }} |
| 79 | retry: {count: 1, delay: 5} |
| 80 | skip_fail: false |
| 81 | |
| 82 | - description: Sync all salt resources |
| 83 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' saltutil.sync_all && sleep 5 |
| 84 | node_name: {{ HOSTNAME_CFG01 }} |
| 85 | retry: {count: 1, delay: 5} |
| 86 | skip_fail: false |
| 87 | |
| 88 | - description: Show reclass-salt --top for generated nodes |
| 89 | cmd: reclass-salt --top -u /srv/salt/reclass/nodes/_generated/ |
| 90 | node_name: {{ HOSTNAME_CFG01 }} |
| 91 | retry: {count: 1, delay: 5} |
| 92 | skip_fail: false |
| 93 | |
| 94 | - description: Add cpm nodes to /etc/hosts |
| 95 | cmd: | |
| 96 | salt --hard-crash --state-output=mixed --state-verbose=False -C '*' cmd.run "echo '10.167.11.105 cmp01.cookied-bm-dpdk-pipeline.local cmp01' >> /etc/hosts"; |
| 97 | salt --hard-crash --state-output=mixed --state-verbose=False -C '*' cmd.run "echo '10.167.11.106 cmp02.cookied-bm-dpdk-pipeline.local cmp02' >> /etc/hosts"; |
| 98 | node_name: {{ HOSTNAME_CFG01 }} |
| 99 | retry: {count: 1, delay: 10} |
| 100 | skip_fail: true |
| 101 | |
| 102 | {{SHARED.MACRO_CHECK_SALT_VERSION_SERVICES_ON_CFG()}} |
| 103 | {{SHARED.MACRO_CHECK_SALT_VERSION_ON_NODES()}} |
| 104 | |
| 105 | - description: Temporary WR |
| 106 | cmd: | |
| 107 | ssh-keyscan cfg01 > /var/lib/jenkins/.ssh/known_hosts || true; |
| 108 | node_name: {{ HOSTNAME_CFG01 }} |
| 109 | retry: {count: 1, delay: 10} |
| 110 | skip_fail: true |
| 111 | |
| 112 | - description: Enable Jenkins |
| 113 | cmd: | |
| 114 | systemctl enable jenkins || true; |
| 115 | systemctl restart jenkins || true; |
| 116 | sleep 5; |
| 117 | node_name: {{ HOSTNAME_CFG01 }} |
| 118 | retry: {count: 1, delay: 10} |
| 119 | skip_fail: true |
| 120 | |
| 121 | - description: run jenkins.client |
| 122 | cmd: | |
| 123 | salt-call state.sls jenkins.client |
| 124 | node_name: {{ HOSTNAME_CFG01 }} |
| 125 | retry: {count: 1, delay: 10} |
| 126 | skip_fail: false |
| 127 | |