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 | |
Petr Michalec | c7dabcf | 2017-08-30 16:30:13 +0200 | [diff] [blame^] | 13 | **bootstrap.sh** |
Ales Komarek | 1b37311 | 2017-08-08 08:48:56 +0200 | [diff] [blame] | 14 | |
Petr Michalec | c7dabcf | 2017-08-30 16:30:13 +0200 | [diff] [blame^] | 15 | Script with function library to |
| 16 | * install and configure *salt master* and *minions* |
| 17 | * bootstrap *salt master* with *salt-formulas* common prerequisites in mind |
| 18 | * validate reclass the model / pillar for all nodes |
Ales Komarek | 1b37311 | 2017-08-08 08:48:56 +0200 | [diff] [blame] | 19 | |
Petr Michalec | c7dabcf | 2017-08-30 16:30:13 +0200 | [diff] [blame^] | 20 | TL;DR: |
Ales Komarek | 1b37311 | 2017-08-08 08:48:56 +0200 | [diff] [blame] | 21 | |
| 22 | .. code-block:: bash |
| 23 | |
| 24 | cd /srv/salt/scripts |
| 25 | MASTER_HOSTNAME=cfg01.infra.ci.local ./salt-master-init.sh |
| 26 | |
| 27 | .. note: |
Petr Michalec | c7dabcf | 2017-08-30 16:30:13 +0200 | [diff] [blame^] | 28 | Creates /srv/salt/scripts/.bootstrap.sh if succesfully passed the "setup script" |
Ales Komarek | 1b37311 | 2017-08-08 08:48:56 +0200 | [diff] [blame] | 29 | with the aim to avoid subsequent run's. |
| 30 | |
| 31 | |
Petr Michalec | c7dabcf | 2017-08-30 16:30:13 +0200 | [diff] [blame^] | 32 | **salt-master-setup.sh** (DEPRECATED, use bootstrap.sh instead) |
| 33 | |
| 34 | Script to install and configure salt *minion* but mostly *salt master* with *salt-formulas* common prerequisites in mind. |
| 35 | Configuration driven by environment variables, see source for more details... |
| 36 | |
| 37 | |
| 38 | **salt-master-init.sh** (DEPRECATED, use bootstrap.sh instead) |
| 39 | |
| 40 | Script to bootstrap *salt master* and verify the model. To install salt master uses ``salt-master-setup.sh``. |
| 41 | Configuration driven by environment variables. |
| 42 | |
| 43 | |
Ales Komarek | 1b37311 | 2017-08-08 08:48:56 +0200 | [diff] [blame] | 44 | **formula-fetch.sh** |
| 45 | |
| 46 | Script to install formulas with dependencies. |
| 47 | |
| 48 | |
| 49 | **salt-state-apply-trend.sh** |
| 50 | |
| 51 | Simple script to invoking highstate on whole infrastructure with ``test=true``. Json output is aggregated with `jq` |
| 52 | (Failed/Success/Changes/Errors) and compared with previous run. |
| 53 | |
| 54 | |
| 55 | Bootstrap the Salt Master node |
| 56 | ============================== |
| 57 | (expects salt-formulas reclass model repo) |
| 58 | |
| 59 | .. code-block:: bash |
| 60 | |
Petr Michalec | 4a11f9d | 2017-08-08 14:15:56 +0200 | [diff] [blame] | 61 | 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] | 62 | |
| 63 | git clone <model-repository> /srv/salt/reclass |
Petr Michalec | c7dabcf | 2017-08-30 16:30:13 +0200 | [diff] [blame^] | 64 | cd /srv/salt/reclass |
Ales Komarek | 1b37311 | 2017-08-08 08:48:56 +0200 | [diff] [blame] | 65 | git submodule update --init --recursive |
Petr Michalec | c7dabcf | 2017-08-30 16:30:13 +0200 | [diff] [blame^] | 66 | |
| 67 | # OR (if system level is not add yet) |
Ales Komarek | 1b37311 | 2017-08-08 08:48:56 +0200 | [diff] [blame] | 68 | git submodule add https://github.com/Mirantis/reclass-system-salt-model \ |
| 69 | /srv/salt/reclass/classes/system/ |
| 70 | |
| 71 | cd /srv/salt/scripts |
Petr Michalec | c7dabcf | 2017-08-30 16:30:13 +0200 | [diff] [blame^] | 72 | MASTER_HOSTNAME=cfg01.infra.ci.local ./bootstrap.sh |
| 73 | |
| 74 | |
| 75 | Additional bootstrap ENV variables |
| 76 | ---------------------------------- |
| 77 | (for full list of options see the *bootstrap.sh* source) |
| 78 | |
| 79 | .. code-block:: bash |
| 80 | |
| 81 | # reclass |
| 82 | export RECLASS_ADDRESS=<repo url> ## if not already cloned in /srv/salt/reclass > |
| 83 | |
| 84 | # formula |
| 85 | export FORMULAS_BRANCH=master |
| 86 | export FORMULAS_SOURCE=git |
| 87 | |
| 88 | # system / host / salt master minion id |
| 89 | export HOSTNAME=cfg01 |
| 90 | export DOMAIN=infra.ci.local |
| 91 | #export MINION_ID |
| 92 | |
| 93 | # salt |
| 94 | export BOOTSTRAP_SALTSTACK_OPTS=" -dX stable 2016.3" |
| 95 | export EXTRA_FORMULAS="prometeus" |
| 96 | SALT_SOURCE=${SALT_SOURCE:-pkg} |
| 97 | SALT_VERSION=${SALT_VERSION:-latest} |
| 98 | |
| 99 | # bootstrap |
| 100 | export SALT_MASTER_BOOTSTRAP_MINIMIZED=False |
| 101 | export CLUSTER_NAME=<%= cluster %> |
| 102 | |
| 103 | # workarounds |
| 104 | export RECLASS_IGNORE_CLASS_NOTFOUND=False |
| 105 | export EXTRA_FORMULAS="prometheus telegraph" |
| 106 | |
| 107 | |
| 108 | |
| 109 | |
| 110 | |
Ales Komarek | 1b37311 | 2017-08-08 08:48:56 +0200 | [diff] [blame] | 111 | |
| 112 | |