Ales Komarek | 1b37311 | 2017-08-08 08:48:56 +0200 | [diff] [blame] | 1 | ============== |
| 2 | Deploy scripts |
| 3 | ============== |
| 4 | |
| 5 | This ``deploy/scripts`` serve as shared common place to link any deployment tools. |
| 6 | |
| 7 | |
| 8 | **bootstrap-salt.sh** |
| 9 | **bootstrap-salt.ps1** |
| 10 | |
| 11 | Salt bootstrap scripts. Local copy of upstream `https://bootstrap.saltstack.com/`_. |
| 12 | |
| 13 | |
| 14 | **salt-master-setup.sh** |
| 15 | |
| 16 | Script to install and configure salt *minion* but mostly *salt master* with *salt-formulas* common prerequisites in mind. |
| 17 | Configuration driven by environment variables, see source for more details... |
| 18 | |
| 19 | .. code-block:: bash |
| 20 | |
| 21 | # reclass |
| 22 | export RECLASS_ADDRESS=<repo url> ## if not already cloned in /srv/salt/reclass > |
| 23 | |
| 24 | # formula |
| 25 | export FORMULAS_BRANCH=master |
| 26 | export FORMULAS_SOURCE=git |
| 27 | |
| 28 | # system / host / salt master minion id |
| 29 | export HOSTNAME=cfg01 |
| 30 | export DOMAIN=infra.ci.local |
| 31 | #export MINION_ID |
| 32 | |
| 33 | # salt |
| 34 | export SALT_MASTER_BOOTSTRAP_MINIMIZED=False |
| 35 | export BOOTSTRAP_SALTSTACK_OPTS=" -dX stable 2016.3" |
| 36 | export EXTRA_FORMULAS="prometeus" |
| 37 | |
| 38 | # environment |
| 39 | SALT_SOURCE=${SALT_SOURCE:-pkg} |
| 40 | SALT_VERSION=${SALT_VERSION:-latest} |
| 41 | |
| 42 | |
| 43 | **salt-master-init.sh** |
| 44 | |
| 45 | Script to bootstrap *salt master* and verify the model. To install salt master uses ``salt-master-setup.sh``. |
| 46 | Configuration driven by environment variables. |
| 47 | |
| 48 | .. code-block:: bash |
| 49 | |
| 50 | cd /srv/salt/scripts |
| 51 | MASTER_HOSTNAME=cfg01.infra.ci.local ./salt-master-init.sh |
| 52 | |
| 53 | .. note: |
| 54 | Creates /srv/salt/scripts/.salt-master-setup.sh if succesfully passed the "setup script" |
| 55 | with the aim to avoid subsequent run's. |
| 56 | |
| 57 | |
| 58 | **formula-fetch.sh** |
| 59 | |
| 60 | Script to install formulas with dependencies. |
| 61 | |
| 62 | |
| 63 | **salt-state-apply-trend.sh** |
| 64 | |
| 65 | Simple script to invoking highstate on whole infrastructure with ``test=true``. Json output is aggregated with `jq` |
| 66 | (Failed/Success/Changes/Errors) and compared with previous run. |
| 67 | |
| 68 | |
| 69 | Bootstrap the Salt Master node |
| 70 | ============================== |
| 71 | (expects salt-formulas reclass model repo) |
| 72 | |
| 73 | .. code-block:: bash |
| 74 | |
Petr Michalec | 4a11f9d | 2017-08-08 14:15:56 +0200 | [diff] [blame] | 75 | git clone https://github.com/salt-formulas/salt-formulas-scripts /srv/salt/scripts |
Ales Komarek | 1b37311 | 2017-08-08 08:48:56 +0200 | [diff] [blame] | 76 | |
| 77 | git clone <model-repository> /srv/salt/reclass |
| 78 | git submodule update --init --recursive |
| 79 | # or |
| 80 | # (if system level is not add yet) |
| 81 | git submodule add https://github.com/Mirantis/reclass-system-salt-model \ |
| 82 | /srv/salt/reclass/classes/system/ |
| 83 | |
| 84 | cd /srv/salt/scripts |
| 85 | MASTER_HOSTNAME=cfg01.infra.ci.local ./salt-master-init.sh |
| 86 | |
| 87 | |