blob: f4a3867905978559acb36924eaa52b83229acd41 [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
Petr Michalec5e2d0b62017-08-30 16:30:44 +020025 MASTER_HOSTNAME=cfg01.infra.ci.local ./bootstrap.sh
Ales Komarek1b373112017-08-08 08:48:56 +020026
27.. note:
Petr Michalec4c981822017-08-30 16:47:08 +020028 Creates /srv/salt/scripts/.salt-master-setup.sh.passed if succesfully passed the "setup script"
29 with the aim to avoid subsequent setup.
Ales Komarek1b373112017-08-08 08:48:56 +020030
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
Petr Michalec4c981822017-08-30 16:47:08 +020075Verify
76------
77Get the *verify.sh* script from https://github.com/salt-formulas/salt-formulas/tree/master/deploy/model
78
79.. code-block:: bash
80
81 cd /srv/salt/reclass
82 MASTER_HOSTNAME=$(hostname -f) ./verify.sh
Petr Michalecc7dabcf2017-08-30 16:30:13 +020083
Petr Michalec4c981822017-08-30 16:47:08 +020084 # or individually, if minions get generated under nodes/_generated
85 ./verify.sh ctl01.k8s-cis-virtual.local
86
87
88Additional bootstrap ENV variables
89----------------------------------
90(for full list of options see the *bootstrap.sh* source)
91
92.. code-block:: bash
Petr Michalecc7dabcf2017-08-30 16:30:13 +020093
94 # reclass
95 export RECLASS_ADDRESS=<repo url> ## if not already cloned in /srv/salt/reclass >
96
97 # formula
98 export FORMULAS_BRANCH=master
99 export FORMULAS_SOURCE=git
100
101 # system / host / salt master minion id
102 export HOSTNAME=cfg01
103 export DOMAIN=infra.ci.local
104 #export MINION_ID
105
106 # salt
107 export BOOTSTRAP_SALTSTACK_OPTS=" -dX stable 2016.3"
108 export EXTRA_FORMULAS="prometeus"
109 SALT_SOURCE=${SALT_SOURCE:-pkg}
110 SALT_VERSION=${SALT_VERSION:-latest}
111
112 # bootstrap
113 export SALT_MASTER_BOOTSTRAP_MINIMIZED=False
114 export CLUSTER_NAME=<%= cluster %>
115
116 # workarounds
117 export RECLASS_IGNORE_CLASS_NOTFOUND=False
118 export EXTRA_FORMULAS="prometheus telegraph"
119
120
121
122
123
Ales Komarek1b373112017-08-08 08:48:56 +0200124
125