blob: 2a86269447304607868c122144c6cfeb4eef5616 [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
Dmitry Kalashnik3056fe72018-02-06 11:46:31 +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"') }}
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 Dmitriev257a9382018-02-15 04:00:46 +020028{{ SHARED.ADJUST_SL_OPTS(OVERRIDES_FILENAME='/srv/salt/reclass/classes/environment/' + ENVIRONMENT_MODEL_INVENTORY_NAME + '/overrides.yml') }}
29
Dennis Dmitriev0752b872017-10-19 17:38:48 +030030- description: "Workaround for combined roles: remove unnecessary classes"
31 cmd: |
32 set -e;
33 sed -i '/system.reclass.storage.system.physical_control_cluster/d' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/config.yml;
34 sed -i '/system.reclass.storage.system.openstack_database_cluster/d' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/config.yml;
35 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 +030036 sed -i '/system.reclass.storage.system.stacklight_telemetry_cluster/d' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/config.yml;
37 sed -i '/system.reclass.storage.system.stacklight_log_cluster/d' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/config.yml;
38
Dennis Dmitrievd96ace12018-01-26 14:46:21 +020039 . /root/venv-reclass-tools/bin/activate;
Dennis Dmitriev0752b872017-10-19 17:38:48 +030040 reclass-tools del-key parameters.reclass.storage.node.infra_kvm_node01 /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/config.yml;
41 reclass-tools del-key parameters.reclass.storage.node.infra_kvm_node02 /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/config.yml;
42 reclass-tools del-key parameters.reclass.storage.node.infra_kvm_node03 /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/config.yml;
43 reclass-tools del-key parameters.reclass.storage.node.openstack_database_node01 /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/config.yml;
44 reclass-tools del-key parameters.reclass.storage.node.openstack_database_node02 /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/config.yml;
45 reclass-tools del-key parameters.reclass.storage.node.openstack_database_node03 /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/config.yml;
46 reclass-tools del-key parameters.reclass.storage.node.openstack_message_queue_node01 /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/config.yml;
47 reclass-tools del-key parameters.reclass.storage.node.openstack_message_queue_node02 /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/config.yml;
48 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 +030049 reclass-tools del-key parameters.reclass.storage.node.stacklight_log_node01 /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/config.yml;
50 node_name: {{ HOSTNAME_CFG01 }}
51 retry: {count: 1, delay: 5}
52 skip_fail: false
53
Dennis Dmitriev411dd102017-09-15 16:04:47 +030054{{ SHARED.MACRO_GENERATE_INVENTORY() }}
55
56{{ SHARED.MACRO_NETWORKING_WORKAROUNDS() }}
57
Dennis Dmitriev0e2e9d92017-11-10 17:30:12 +020058- description: Temporary workaround for PROD-15890 for downgrade packages
59 cmd: |
60 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@linux:system' state.sls linux.system.repo;
61 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@linux:system' cmd.run "apt-get update"
62 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@linux:system' cmd.run "apt-get install -y --allow-downgrades vlan";
63 node_name: {{ HOSTNAME_CFG01 }}
64 retry: {count: 1, delay: 10}
65 skip_fail: true
66
Dennis Dmitriev411dd102017-09-15 16:04:47 +030067{{ SHARED.MACRO_BOOTSTRAP_ALL_MINIONS() }}
68
69#- description: Hack gtw node
70# cmd: salt 'gtw*' cmd.run "ip addr del {{ SHARED.IPV4_NET_CONTROL_PREFIX }}.110/24 dev ens4; ip addr flush dev ens4";
71# node_name: {{ HOSTNAME_CFG01 }}
72# retry: {count: 1, delay: 10}
73# skip_fail: false
74
75#- description: Hack cmp01 node
76# cmd: salt 'cmp01*' cmd.run "ip addr del {{ SHARED.IPV4_NET_CONTROL_PREFIX }}.105/24 dev ens4; ip addr flush dev ens4";
77# node_name: {{ HOSTNAME_CFG01 }}
78# retry: {count: 1, delay: 10}
79# skip_fail: false
80
81#- description: Hack cmp02 node
82# cmd: salt 'cmp02*' cmd.run "ip addr del {{ SHARED.IPV4_NET_CONTROL_PREFIX }}.106/24 dev ens4; ip addr flush dev ens4";
83# node_name: {{ HOSTNAME_CFG01 }}
84# retry: {count: 1, delay: 10}
85# skip_fail: false