1- ==============
1+ .. _readme :
2+
23zabbix-formula
34==============
45
5- A saltstack formula to manage Zabbix.
6+ |img_travis | |img_sr |
7+
8+ .. |img_travis | image :: https://travis-ci.com/saltstack-formulas/zabbix-formula.svg?branch=master
9+ :alt: Travis CI Build Status
10+ :scale: 100%
11+ :target: https://travis-ci.com/saltstack-formulas/zabbix-formula
12+ .. |img_sr | image :: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg
13+ :alt: Semantic Release
14+ :scale: 100%
15+ :target: https://github.com/semantic-release/semantic-release
16+
17+ A SaltStack formula to manage Zabbix.
18+
19+ .. contents :: **Table of Contents**
20+
21+ General notes
22+ -------------
23+
24+ See the full `SaltStack Formulas installation and usage instructions
25+ <https://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html> `_.
26+
27+ If you are interested in writing or contributing to formulas, please pay attention to the `Writing Formula Section
28+ <https://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html#writing-formulas> `_.
29+
30+ If you want to use this formula, please pay attention to the ``FORMULA `` file and/or ``git tag ``,
31+ which contains the currently released version. This formula is versioned according to `Semantic Versioning <http://semver.org/ >`_.
32+
33+ See `Formula Versioning Section <https://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html#versioning >`_ for more details.
34+
35+ Contributing to this repo
36+ -------------------------
37+
38+ **Commit message formatting is significant!! **
39+
40+ Please see :ref: `How to contribute <CONTRIBUTING >` for more details.
41+
42+ Overview
43+ --------
644
745This formula has been developed distributing declarations in different files to
846make it usable in most situations. It should be useful in scenarios ranging from
947a simple install of the packages (without any special configuration) to a more
1048complex set-up with different nodes for agent, server, database and frontend.
1149
1250Customization
13- =============
51+ ^^^^^^^^^^^^^
1452
1553First, **see if providing pillar data is enough for your customization needs **.
1654That's the recommended way and should be enough for most cases. See that
@@ -27,7 +65,7 @@ recommended– to use other formulas to provision other parts of a complete
2765system).
2866
2967Using RedHat EPEL repo Zabbix packages
30- ======================================
68+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3169
3270If you want to use the EPEL repo packages, as the naming conventions are
3371different, you need to tweak the default values of ``map.jinja `` to obtain the
@@ -51,7 +89,7 @@ desired results. In short:
5189 Now you just have to use ``zabbix.agent.conf `` sls file and that's it.
5290
5391Example of usage
54- ================
92+ ^^^^^^^^^^^^^^^^
5593
5694Just as an example, this is a ``top.sls `` file to install a complete modular
5795self-contained Zabbix system:
@@ -110,105 +148,151 @@ pillar files
110148 <http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html> `_ doc.
111149
112150Available states
113- ================
151+ ----------------
114152
115153.. contents ::
116154 :local:
117155
118156``zabbix.agent ``
119- ----------------
157+ ^^^^^^^^^^^^^^^^
120158
121159Installs the zabbix-agent package and starts the associated zabbix-
122160agent service.
123161
124162``zabbix.agent.conf ``
125- ---------------------
163+ ^^^^^^^^^^^^^^^^^^^^^
126164
127165Configures the zabbix-agent package.
128166
129167``zabbix.agent.repo ``
130- ---------------------
168+ ^^^^^^^^^^^^^^^^^^^^^
131169
132170Configures official Zabbix repo specifically for the agent. Actually it just
133171includes zabbix.repo and adds a requisite for the pkg state declaration
134172
135173``zabbix.frontend ``
136- -------------------
174+ ^^^^^^^^^^^^^^^^^^^
137175
138176Installs Zabbix frontend.
139177
140178``zabbix.frontend.conf ``
141- ----------------------
179+ ^^^^^^^^^^^^^^^^^^^^^^^^
142180
143181Configures the zabbix-frontend package. Actually you need to use other formulas
144182for apache/nginx and php5-fpm to complete a working setup.
145183
146184``zabbix.frontend.repo ``
147- ----------------------
185+ ^^^^^^^^^^^^^^^^^^^^^^^^
148186
149187Configures official Zabbix repo specifically for the frontend. Actually it just
150188includes zabbix.repo and adds a requisite for the pkg state declaration.
151189
152190``zabbix.mysql.conf ``
153- ----------------
191+ ^^^^^^^^^^^^^^^^^^^^^
154192
155193Creates database and mysql user for Zabbix.
156194
157195``zabbix.mysql.schema ``
158- ---------------------
196+ ^^^^^^^^^^^^^^^^^^^^^^^
159197
160198Creates mysql schema for Zabbix.
161199
162200``zabbix.pgsql.conf ``
163- ----------------
201+ ^^^^^^^^^^^^^^^^^^^^^
164202
165203Creates database and PostgreSQL user for Zabbix.
166204
167205``zabbix.pgsql.schema ``
168- ---------------------
206+ ^^^^^^^^^^^^^^^^^^^^^^^
169207
170208Creates PostgreSQL schema for Zabbix.
171209
172210``zabbix.proxy ``
173- ----------------
211+ ^^^^^^^^^^^^^^^^
174212
175213Installs the zabbix-proxy package and starts the associated zabbix-proxy service.
176214
177215``zabbix.proxy.conf ``
178- ---------------------
216+ ^^^^^^^^^^^^^^^^^^^^^
179217
180218Configures the zabbix-proxy package.
181219
182220``zabbix.proxy.repo ``
183- ---------------------
221+ ^^^^^^^^^^^^^^^^^^^^^
184222
185223Configures official Zabbix repo specifically for the proxy. Actually it just
186224includes zabbix.repo and adds a requisite for the pkg state declaration
187225
188226``zabbix.repo ``
189- ----------------
227+ ^^^^^^^^^^^^^^^
190228
191229Configures official Zabbix repo.
192230
193231``zabbix.server ``
194- -----------------
232+ ^^^^^^^^^^^^^^^^^
195233
196234Installs the zabbix-server package and starts the associated zabbix-
197235server service.
198236
199237``zabbix.server.conf ``
200- ----------------------
238+ ^^^^^^^^^^^^^^^^^^^^^^
201239
202240Configures the zabbix-server package.
203241
204242``zabbix.server.repo ``
205- ----------------------
243+ ^^^^^^^^^^^^^^^^^^^^^^
206244
207245Configures official Zabbix repo specifically for the server. Actually it just
208246includes zabbix.repo and adds a requisite for the pkg state declaration
209247
210248``zabbix.users ``
211- ----------------
249+ ^^^^^^^^^^^^^^^^
212250
213251Declares users and groups that could be needed in other formulas (e.g. in the
214252users formula to make an user pertain to the service group).
253+
254+
255+ Testing
256+ -------
257+
258+ Linux testing is done with ``kitchen-salt ``.
259+
260+ Requirements
261+ ^^^^^^^^^^^^
262+
263+ * Ruby
264+ * Docker
265+
266+ .. code-block :: bash
267+
268+ $ gem install bundler
269+ $ bundle install
270+ $ bin/kitchen test [platform]
271+
272+ Where ``[platform] `` is the platform name defined in ``kitchen.yml ``,
273+ e.g. ``debian-9-2019-2-py3 ``.
274+
275+ ``bin/kitchen converge ``
276+ ^^^^^^^^^^^^^^^^^^^^^^^^
277+
278+ Creates the docker instance and runs the ``template `` main state, ready for testing.
279+
280+ ``bin/kitchen verify ``
281+ ^^^^^^^^^^^^^^^^^^^^^^
282+
283+ Runs the ``inspec `` tests on the actual instance.
284+
285+ ``bin/kitchen destroy ``
286+ ^^^^^^^^^^^^^^^^^^^^^^^
287+
288+ Removes the docker instance.
289+
290+ ``bin/kitchen test ``
291+ ^^^^^^^^^^^^^^^^^^^^
292+
293+ Runs all of the stages above in one go: i.e. ``destroy `` + ``converge `` + ``verify `` + ``destroy ``.
294+
295+ ``bin/kitchen login ``
296+ ^^^^^^^^^^^^^^^^^^^^^
297+
298+ Gives you SSH access to the instance for manual testing.
0 commit comments