blob: 4f2439da27dba8414530082fe46b54b2bfb450ab [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
Dennis Dmitriev01a51292018-01-18 17:41:17 +020022{{ 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"') }}
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
37 reclass-tools del-key parameters.reclass.storage.node.infra_kvm_node01 /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/config.yml;
38 reclass-tools del-key parameters.reclass.storage.node.infra_kvm_node02 /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/config.yml;
39 reclass-tools del-key parameters.reclass.storage.node.infra_kvm_node03 /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/config.yml;
40 reclass-tools del-key parameters.reclass.storage.node.openstack_database_node01 /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/config.yml;
41 reclass-tools del-key parameters.reclass.storage.node.openstack_database_node02 /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/config.yml;
42 reclass-tools del-key parameters.reclass.storage.node.openstack_database_node03 /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/config.yml;
43 reclass-tools del-key parameters.reclass.storage.node.openstack_message_queue_node01 /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/config.yml;
44 reclass-tools del-key parameters.reclass.storage.node.openstack_message_queue_node02 /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/config.yml;
45 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 +030046 reclass-tools del-key parameters.reclass.storage.node.stacklight_log_node01 /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/config.yml;
47 node_name: {{ HOSTNAME_CFG01 }}
48 retry: {count: 1, delay: 5}
49 skip_fail: false
50
Dennis Dmitriev411dd102017-09-15 16:04:47 +030051{{ SHARED.MACRO_GENERATE_INVENTORY() }}
52
53{{ SHARED.MACRO_NETWORKING_WORKAROUNDS() }}
54
Dennis Dmitriev0e2e9d92017-11-10 17:30:12 +020055- description: Temporary workaround for PROD-15890 for downgrade packages
56 cmd: |
57 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@linux:system' state.sls linux.system.repo;
58 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@linux:system' cmd.run "apt-get update"
59 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@linux:system' cmd.run "apt-get install -y --allow-downgrades vlan";
60 node_name: {{ HOSTNAME_CFG01 }}
61 retry: {count: 1, delay: 10}
62 skip_fail: true
63
Dennis Dmitriev411dd102017-09-15 16:04:47 +030064{{ SHARED.MACRO_BOOTSTRAP_ALL_MINIONS() }}
65
66#- description: Hack gtw node
67# cmd: salt 'gtw*' cmd.run "ip addr del {{ SHARED.IPV4_NET_CONTROL_PREFIX }}.110/24 dev ens4; ip addr flush dev ens4";
68# node_name: {{ HOSTNAME_CFG01 }}
69# retry: {count: 1, delay: 10}
70# skip_fail: false
71
72#- description: Hack cmp01 node
73# cmd: salt 'cmp01*' cmd.run "ip addr del {{ SHARED.IPV4_NET_CONTROL_PREFIX }}.105/24 dev ens4; ip addr flush dev ens4";
74# node_name: {{ HOSTNAME_CFG01 }}
75# retry: {count: 1, delay: 10}
76# skip_fail: false
77
78#- description: Hack cmp02 node
79# cmd: salt 'cmp02*' cmd.run "ip addr del {{ SHARED.IPV4_NET_CONTROL_PREFIX }}.106/24 dev ens4; ip addr flush dev ens4";
80# node_name: {{ HOSTNAME_CFG01 }}
81# retry: {count: 1, delay: 10}
82# skip_fail: false