| {% from 'cookied-model-generator/underlay.yaml' import HOSTNAME_CFG01 with context %} |
| {% from 'cookied-model-generator/underlay.yaml' import DOMAIN_NAME with context %} |
| |
| {% set LAB_CONFIG_NAME = 'heat-cicd-pike-dvr-sl' %} |
| # Name of the context file (without extension, that is fixed .yaml) used to render the Environment model |
| {% set ENVIRONMENT_MODEL_INVENTORY_NAME = os_env('ENVIRONMENT_MODEL_INVENTORY_NAME','heat-cicd-pike-dvr-sl') %} |
| # Path to the context files used to render Cluster and Environment models |
| {%- set CLUSTER_CONTEXT_NAME = 'salt-context-cookiecutter.yaml' %} |
| {%- set ENVIRONMENT_CONTEXT_NAMES = ['salt-context-environment.yaml', 'salt-context-cookiecutter.yaml'] %} |
| |
| {% import 'shared-salt.yaml' as SHARED with context %} |
| |
| {{ SHARED.MACRO_INSTALL_PACKAGES_ON_NODES(HOSTNAME_CFG01) }} |
| |
| {{ SHARED.MACRO_INSTALL_FORMULAS_FROM_UPDATE() }} |
| |
| {{ SHARED.MACRO_INSTALL_FORMULAS('\*') }} |
| |
| {{ SHARED.MACRO_GENERATE_COOKIECUTTER_MODEL() }} |
| |
| {{ SHARED.MACRO_GENERATE_AND_ENABLE_ENVIRONMENT_MODEL() }} |
| |
| {{ SHARED.MACRO_GENERATE_INVENTORY(RERUN_SALTMASTER_STATE=true) }} |
| |
| - description: "Add cpu_mode" |
| cmd: | |
| set -e; |
| set -x; |
| . /root/venv-reclass-tools/bin/activate; |
| reclass-tools add-key parameters.nova.compute.cpu_mode custom /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/compute/init.yml; |
| reclass-tools add-key parameters.nova.compute.libvirt.cpu_model kvm64 /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/compute/init.yml; |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: false |
| - description: "Switch to SSH Jenkins slaves on Salt Master" |
| cmd: | |
| set -e; |
| set -x; |
| sed -i 's/jnlp_slave_single/ssh_slave_single/g' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/config/jenkins.yml |
| . /root/venv-reclass-tools/bin/activate; |
| reclass-tools del-key parameters.jenkins.client.node.slave01.launcher.type /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/config/jenkins.yml |
| reclass-tools add-key parameters.jenkins.client.node.slave01.launcher.type ssh /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/config/jenkins.yml |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: false |
| - description: "Switch to SSH Jenkins slaves on CICD" |
| cmd: | |
| set -e; |
| set -x; |
| sed -i 's/jnlp_slave_multi/ssh_slave_multi/g' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/cicd/control/leader.yml |
| . /root/venv-reclass-tools/bin/activate; |
| reclass-tools add-key classes system.jenkins.client.ssh_node /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/cicd/control/leader.yml --merge |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: false |