| #!/bin/bash -xe |
| |
| MCP_VERSION=${MCP_VERSION:-proposed} |
| APT_MIRANTIS_SALT_REPO=${APT_MIRANTIS_SALT_REPO:-"http://mirror.mirantis.com/${MCP_VERSION}/salt-formulas/xenial xenial main"} |
| SALT_OPTS="-t 10 --retcode-passthrough --no-color" |
| |
| echo "deb [arch=amd64] ${APT_MIRANTIS_SALT_REPO}" > /etc/apt/sources.list.d/mcp_salt.list |
| apt-get update |
| apt-get install salt-formula* -y |
| |
| # Wait for salt-master and salt-minion to wake up after restart |
| # since we just perform 'reboot.sh' |
| salt-call --timeout=120 test.ping |
| |
| salt-call ${SALT_OPTS} saltutil.clear_cache |
| salt-call ${SALT_OPTS} saltutil.refresh_pillar |
| salt-call ${SALT_OPTS} saltutil.sync_all |
| salt-call ${SALT_OPTS} reclass.validate_pillar |
| |
| salt-call ${SALT_OPTS} state.sls linux.system.repo,linux.system.package,linux.system.user,linux.system.directory,linux.system.file,linux.system.config |
| salt-call ${SALT_OPTS} state.sls linux.network |
| salt-call ${SALT_OPTS} state.sls salt.minion.ca |
| |
| salt-call ${SALT_OPTS} state.sls salt |
| salt-call ${SALT_OPTS} state.sls docker.host |
| |
| salt-call ${SALT_OPTS} state.sls openssh |
| salt-call ${SALT_OPTS} state.sls git.server |
| |
| # install only MAAS packages, don't configure anything. |
| # Configuration will be processed during cfg01 initialization. |
| # Those step, required to have clean MAAS configuration - w\o auto import and etc. |
| salt-call ${SALT_OPTS} state.sls_id maas_cluster_packages maas |
| salt-call ${SALT_OPTS} state.sls_id maas_region_packages maas |
| |
| # Flags for cloud-init script |
| touch /opt/jenkins_in_docker /opt/postgresql_in_docker |
| |
| # Duplicate of ubuntu_info.sh |
| mkdir -p /var/log/bootstrap_logs/ ; pushd /var/log/bootstrap_logs/ |
| # Drop some reclass info,if available |
| if [[ $(which salt-key) ]] ; then |
| for node in $(salt-key -l acc | grep -v 'Accepted Keys:') ; do |
| salt ${node} pillar.data --out=json > ${node}.pillardata.json || true |
| reclass -n ${node} -o json > ${node}.reclass.json || true |
| done |
| fi |
| popd |