blob: abe211ebbf67e0d8f6dc447e8de75c5eb0047fb3 [file] [log] [blame]
Ales Komarek1b373112017-08-08 08:48:56 +02001==============
2Deploy scripts
3==============
4
5This ``deploy/scripts`` serve as shared common place to link any deployment tools.
6
7
8**bootstrap-salt.sh**
9**bootstrap-salt.ps1**
10
11Salt bootstrap scripts. Local copy of upstream `https://bootstrap.saltstack.com/`_.
12
Petr Michalecc7dabcf2017-08-30 16:30:13 +020013**bootstrap.sh**
Ales Komarek1b373112017-08-08 08:48:56 +020014
Petr Michalecc7dabcf2017-08-30 16:30:13 +020015Script 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 Komarek1b373112017-08-08 08:48:56 +020019
Petr Michalecc7dabcf2017-08-30 16:30:13 +020020TL;DR:
Ales Komarek1b373112017-08-08 08:48:56 +020021
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 Michalecc7dabcf2017-08-30 16:30:13 +020028 Creates /srv/salt/scripts/.bootstrap.sh if succesfully passed the "setup script"
Ales Komarek1b373112017-08-08 08:48:56 +020029 with the aim to avoid subsequent run's.
30
31
Petr Michalecc7dabcf2017-08-30 16:30:13 +020032**salt-master-setup.sh** (DEPRECATED, use bootstrap.sh instead)
33
34Script to install and configure salt *minion* but mostly *salt master* with *salt-formulas* common prerequisites in mind.
35Configuration driven by environment variables, see source for more details...
36
37
38**salt-master-init.sh** (DEPRECATED, use bootstrap.sh instead)
39
40Script to bootstrap *salt master* and verify the model. To install salt master uses ``salt-master-setup.sh``.
41Configuration driven by environment variables.
42
43
Ales Komarek1b373112017-08-08 08:48:56 +020044**formula-fetch.sh**
45
46Script to install formulas with dependencies.
47
48
49**salt-state-apply-trend.sh**
50
51Simple 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
55Bootstrap the Salt Master node
56==============================
57(expects salt-formulas reclass model repo)
58
59.. code-block:: bash
60
Petr Michalec4a11f9d2017-08-08 14:15:56 +020061 git clone https://github.com/salt-formulas/salt-formulas-scripts /srv/salt/scripts
Ales Komarek1b373112017-08-08 08:48:56 +020062
63 git clone <model-repository> /srv/salt/reclass
Petr Michalecc7dabcf2017-08-30 16:30:13 +020064 cd /srv/salt/reclass
Ales Komarek1b373112017-08-08 08:48:56 +020065 git submodule update --init --recursive
Petr Michalecc7dabcf2017-08-30 16:30:13 +020066
67 # OR (if system level is not add yet)
Ales Komarek1b373112017-08-08 08:48:56 +020068 git submodule add https://github.com/Mirantis/reclass-system-salt-model \
69 /srv/salt/reclass/classes/system/
70
71 cd /srv/salt/scripts
Petr Michalecc7dabcf2017-08-30 16:30:13 +020072 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 Komarek1b373112017-08-08 08:48:56 +0200111
112