blob: aa9b01697ea6a31d3ed4702d7d7ba86ea92356cd [file] [log] [blame]
Dennis Dmitriev411dd102017-09-15 16:04:47 +03001{% from 'cookied-mcp-ocata-dop-sl2/underlay.yaml' import HOSTNAME_CFG01 with context %}
2{% from 'cookied-mcp-ocata-dop-sl2/underlay.yaml' import LAB_CONFIG_NAME with context %}
3{% from 'cookied-mcp-ocata-dop-sl2/underlay.yaml' import DOMAIN_NAME with context %}
4
5{% set SALT_MODELS_REPOSITORY = os_env('SALT_MODELS_REPOSITORY','https://gerrit.mcp.mirantis.net/salt-models/mcp-virtual-lab') %}
6# Other salt model repository parameters see in shared-salt.yaml
7
8# Name of the context file (without extension, that is fixed .yaml) used to render the Environment model
9{% set ENVIRONMENT_MODEL_INVENTORY_NAME = os_env('ENVIRONMENT_MODEL_INVENTORY_NAME','virtual-mcp-ocata-dop-sl2') %}
10# Path to the context files used to render Cluster and Environment models
Dennis Dmitriev9f141af2017-09-28 17:21:01 +030011{%- set CLUSTER_CONTEXT_NAME = 'salt-context-cookiecutter-cicd_oss.yaml' %}
Dennis Dmitrievccdc87a2017-09-28 17:43:54 +030012{%- set ENVIRONMENT_CONTEXT_NAMES = ['salt-context-environment.yaml'] %}
Dennis Dmitriev411dd102017-09-15 16:04:47 +030013
14{% import 'shared-salt.yaml' as SHARED with context %}
15
16{{ SHARED.MACRO_INSTALL_SALT_MASTER() }}
17
Dennis Dmitriev9f141af2017-09-28 17:21:01 +030018{{ SHARED.MACRO_GENERATE_COOKIECUTTER_MODEL() }}
19
20{{ SHARED.MACRO_GENERATE_AND_ENABLE_ENVIRONMENT_MODEL() }}
Dennis Dmitriev411dd102017-09-15 16:04:47 +030021
Vladimir Jigulinf557c562018-07-30 18:30:09 +040022{{ 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" "fluentd" "logrotate"') }}
Dennis Dmitriev411dd102017-09-15 16:04:47 +030023
24{{ SHARED.MACRO_INSTALL_SALT_MINIONS() }}
25
26{{ SHARED.MACRO_RUN_SALT_MASTER_UNDERLAY_STATES() }}
27
Dennis Dmitriev0752b872017-10-19 17:38:48 +030028- description: "Workaround for combined roles: remove unnecessary classes"
29 cmd: |
30 set -e;
31 sed -i '/system.reclass.storage.system.physical_control_cluster/d' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/config.yml;
32 sed -i '/system.reclass.storage.system.openstack_database_cluster/d' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/config.yml;
33 sed -i '/system.reclass.storage.system.openstack_message_queue_cluster/d' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/config.yml;
Dennis Dmitriev0752b872017-10-19 17:38:48 +030034 sed -i '/system.reclass.storage.system.stacklight_telemetry_cluster/d' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/config.yml;
35 sed -i '/system.reclass.storage.system.stacklight_log_cluster/d' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/config.yml;
36
Dennis Dmitrievd96ace12018-01-26 14:46:21 +020037 . /root/venv-reclass-tools/bin/activate;
Dennis Dmitriev0752b872017-10-19 17:38:48 +030038 reclass-tools del-key parameters.reclass.storage.node.infra_kvm_node01 /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/config.yml;
39 reclass-tools del-key parameters.reclass.storage.node.infra_kvm_node02 /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/config.yml;
40 reclass-tools del-key parameters.reclass.storage.node.infra_kvm_node03 /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/config.yml;
41 reclass-tools del-key parameters.reclass.storage.node.openstack_database_node01 /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/config.yml;
42 reclass-tools del-key parameters.reclass.storage.node.openstack_database_node02 /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/config.yml;
43 reclass-tools del-key parameters.reclass.storage.node.openstack_database_node03 /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/config.yml;
44 reclass-tools del-key parameters.reclass.storage.node.openstack_message_queue_node01 /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/config.yml;
45 reclass-tools del-key parameters.reclass.storage.node.openstack_message_queue_node02 /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/config.yml;
46 reclass-tools del-key parameters.reclass.storage.node.openstack_message_queue_node03 /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/config.yml;
Dennis Dmitriev0752b872017-10-19 17:38:48 +030047 reclass-tools del-key parameters.reclass.storage.node.stacklight_log_node01 /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/config.yml;
48 node_name: {{ HOSTNAME_CFG01 }}
49 retry: {count: 1, delay: 5}
50 skip_fail: false
51
Dennis Dmitriev411dd102017-09-15 16:04:47 +030052{{ SHARED.MACRO_GENERATE_INVENTORY() }}
53
54{{ SHARED.MACRO_NETWORKING_WORKAROUNDS() }}
55
Dennis Dmitriev0e2e9d92017-11-10 17:30:12 +020056- description: Temporary workaround for PROD-15890 for downgrade packages
57 cmd: |
58 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@linux:system' state.sls linux.system.repo;
59 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@linux:system' cmd.run "apt-get update"
60 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@linux:system' cmd.run "apt-get install -y --allow-downgrades vlan";
61 node_name: {{ HOSTNAME_CFG01 }}
62 retry: {count: 1, delay: 10}
63 skip_fail: true
64
Dennis Dmitriev411dd102017-09-15 16:04:47 +030065{{ SHARED.MACRO_BOOTSTRAP_ALL_MINIONS() }}
66
Tatyana Leontovich4453dd62018-06-26 18:44:31 +030067{{SHARED.MACRO_CHECK_SALT_VERSION_SERVICES_ON_CFG()}}
Dennis Dmitriev411dd102017-09-15 16:04:47 +030068
Tatyana Leontovich4453dd62018-06-26 18:44:31 +030069{{SHARED.MACRO_CHECK_SALT_VERSION_ON_NODES()}}