Commit Graph

153 Commits

Author SHA1 Message Date
fnux bf90e55137 Merge branch 'master' into 'dma-type'
# Conflicts:
#   scripts/run-shellcheck.sh
2021-01-12 07:10:10 +01:00
Dennis Camera f9f5c578f7 [type/__dma*] Fix shellcheck errors 2021-01-11 12:16:09 +01:00
fnux 9f4a85901e
Import html/man doc generation logic from upstream cdist 2021-01-04 11:08:55 +01:00
Dennis Camera 487574c865 [type/__dma] Convert AWK to loop over same file twice 2020-11-16 14:15:52 +01:00
Dennis Camera 0932c9ccde [type/{__dma,__dma_auth,__mail_alias}] Quote things properly 2020-11-16 14:10:52 +01:00
Dennis Camera 7e20d13b9f [type/__mail_alias] Use explicit line variables in update_aliases.awk 2020-11-16 13:58:05 +01:00
Dennis Camera 04076a75eb [type/__mail_alias] man.rst: Make bugs a list 2020-11-16 13:57:34 +01:00
fnux 2e02c413b6 Merge branch 'netbox' into 'master'
__netbox type

See merge request ungleich-public/cdist-contrib!12
2020-11-04 09:24:18 +01:00
matze 87e115da98 __netbox: some manpage fixes
Mostly invalid links ..
2020-10-25 19:13:10 +01:00
matze c1d5d5b088 __netbox: remove dependency to package virtualenv
This is not required any more because it was completly replaced by
`python3-venv`. The venv handling is already given to `__pyvenv`.
2020-10-24 08:52:43 +02:00
matze 46bff41f6d __netbox{,_uwsgi}: updated manpages
Mostly added notes of what does not work that well.
2020-10-17 11:22:47 +02:00
matze 558021d2ee __netbox: reorder generated code for shorter transition
Now, the venv and pip things are done before the program files are
replaced, which should minimize the outage where the application is not
available.
2020-10-17 11:08:11 +02:00
matze 9def5700c8 __netbox: replace redis DEFAULT_TIMEOUT with RQ_DEFAULT_TIMEOUT
The first one was deprecated by the second one.
2020-10-17 10:21:52 +02:00
matze 144cae3b79 __netbox: use __pyenv and remove obsolete netbox stop
Now, the python venv is now created via `pyvenv` or `python3 -m venv`
instead of the legacy `virtualenv`. For this, not all python processes
from the venv need to be stopped.

Migration from previous versions of this type may be difficult, but
solvable if the venv will be recreated.
2020-10-17 10:16:25 +02:00
matze 72f2996c50 __netbox*: fix shellcheck SC2162 2020-10-11 16:56:54 +02:00
matze 32c95ccb22 __netbox: don't call `pip3 uninstall` if nothing available
To avoid an error from pip, it will be checked if there are packages to
uninstall. This is better than just doing `|| true`.
2020-10-11 16:50:22 +02:00
matze 13e97d171b __netbox*: added systemd socket support
The Gunicorn type now supports systemd sockets only. With uWSGI, you can
choose between it and the native sockets based on the parameters chosen.
This is done because it could not be implemented to have multiple
protocols with the systemd sockets (so you may choose).

The systemd socket unit file is generally available, so both types use
the same script to generate the socket unit file.
2020-10-11 16:39:19 +02:00
matze 3b780c4794 __netbox: fixup small bugs and venv process killing
Changed flag (force to ignore a non-existant directory), typo and
swapped arguments are done. Also, the process to stop all processes from
the virtal environment has changed: Now, it stops all potential services
and ignore errors (because a service doesn't exist).

After that, it sends a kill signal to all processes and then gracefully
wait since there is no option to do that with systemd.
2020-10-08 19:54:48 +02:00
matze 0b3bc14530 __netbox: adjusted command flags
Mostly added -q to the pip calls. Also forced the temp directory removal.
2020-10-06 17:29:31 +02:00
matze 8f1b56026c __netbox: force link creation for config files
This adds the force flag to `ln` to avoid aborts cause the link already
exists and so forth. It also adds robustness to the execution.
2020-10-05 19:02:05 +02:00
matze 0c85b2d3fd __netbox: uninstall not anymore required packages
This code tries to remove packages not needed anymore. As it presumably
not removing dependencies, it's not that perfect pice of script.
2020-10-05 18:26:47 +02:00
matze 14f7cf8839 __netbox: set --data-root default value
The default value is set to preserve all data saved by netbox. As
explained in the manpage, it sets the directory for all data directories
to `~netbox/data/` (would resolve to `/opt/netbox/data/`), so upgrades
will not remove this data.
2020-10-04 17:40:01 +02:00
Dennis Camera f76bcd3574 [type/__dma_auth] Update man.rst 2020-10-01 17:21:19 +02:00
Dennis Camera 1c9ab6e07b [type/__dma] Update man.rst 2020-10-01 17:18:01 +02:00
Dennis Camera f202d11124 [type/__mail_alias] Fix continuation line processing 2020-10-01 13:54:46 +02:00
Dennis Camera c6b795b3f9 [type/__mail_alias] Update man.rst and make --alias required 2020-10-01 13:31:00 +02:00
Dennis Camera 231f96de18 Error if expected environment variables are unset 2020-10-01 13:31:00 +02:00
matze 050812305b __netbox: add mange.py calls recommended from upstream
Calls where added because there are used upstream in the
`upgrade.sh`-Script, too.

Upgrade-Script:
  https://github.com/netbox-community/netbox/blob/develop/upgrade.sh
2020-09-28 20:04:22 +02:00
matze b55186544f __netbox: adding seperate /opt/netbox/cdist/ directory
Adding a place to keep all configuration stuff for cdist seperated from
the installation directory. For safety reasons.
2020-09-28 19:49:29 +02:00
Dennis Camera 2270c32ddb [type/__dma] Add missing license headers 2020-09-28 17:30:53 +02:00
Dennis Camera b48b48e404 [type/__mail_alias] Externalise AWK update script to separate file 2020-09-28 17:29:41 +02:00
Dennis Camera 6ae0808560 [type/__dma] Externalise AWK update script to separate file 2020-09-28 16:54:21 +02:00
Marko Seric 3feaea1d96 [type/__dma_auth] Externalise AWK update script to separate file 2020-09-28 16:43:31 +02:00
Dennis Camera d693bf5f90 Move auth_conf explorer from __dma_auth to __dma 2020-09-28 16:34:12 +02:00
Dennis Camera 445bc75deb [type/__dma_auth] Drop --server parameter
Currently, dma does not differentiate between login users on the SMTP server.
It will pick whatever entry it finds first
(https://github.com/corecode/dma/blob/v0.13/net.c#L531).
As a result, the --server parameter only adds confusion.
2020-09-28 15:35:58 +02:00
matze e800f42a6d __netbox: consistency with __systemd_unit --restart
This commit brings consistency into the --restart parameter for systemd
units. All units except the netbox wrapper service will be restarted on
unit change.
2020-09-09 20:33:20 +02:00
matze dd167f075d __netbox*: fix service restart order
Cause of corrupt databases if the services are restarted incorrectly,
the order and dependencies are adjusted. Now, the `netbox-rq` service
will be included in restarts of `netbox` and required for the WSGI
servers that it must running.

For these changes, the restart command of `__netbox` was adjusted. The
other ones where edited too, to use the same command.

All services now require redis and postgresql to be started before them
to prevent any start order issues.

If someone asked for what the RQ worker is required, see here:
 https://netbox.readthedocs.io/en/stable/additional-features/webhooks/#webhook-processing
2020-09-09 19:08:46 +02:00
matze 5d437839f6 __netbox: replaced secret key character set
The used character set should now only contain characters used by the
`netbox/generate_secret_key.py` program. Finially got correct escaping.
2020-09-08 19:52:03 +02:00
matze 549feb87f9 __netbox: fix --update-notify
Template script for the `configuration.py` interpreted the boolean flag
incorrectly and did the thing the user do not wanted.
2020-09-08 19:20:22 +02:00
matze 398a3da10e __netbox: fix gerneration random generated secret key
Because `/dev/random` was used, the `cdist config` could hang a long
time to get real random values. The pseudo-generated values through
`/dev/urandom` are fully enought for the secret key.
2020-09-08 18:10:15 +02:00
matze 3389752dec __netbox: fix detection of the secret-key to use
Mixed up a parameter. Should be correct now.
2020-09-07 17:23:22 +02:00
matze eed3515424 __netbox: add --ldap-staff-group parameter
Required to get "admin access".
2020-09-07 17:10:59 +02:00
matze 0afc7136f8 __netbox_uwsgi: fix if only --bind-to given
If the here-document is empty because no file could be found, an empty
line will be read. The new line of code will skip in those cases.
2020-09-06 18:39:07 +02:00
matze c9e4e8d7dc __netbox_{gunicorn,uwsgi}: add state parameter
Adds the --state parameter to both types. With it, the transition
between both types can be done smothly.
2020-09-06 13:44:03 +02:00
matze 3b07a660b3 __netbox_uwsgi: add hint to the --serve-static parameter 2020-09-05 22:55:43 +02:00
matze b10f6b71d0 __netbox: avoid useless generated code-remote
Because `set -e` got printed all the time, the type __netbox always had
some generated code for the remote side. This line was removed because
this is already done by cdist when executing the code-remote script.

Rather, the exit-on-error option was set to some scirpts (two ..).
2020-09-05 22:34:14 +02:00
matze 9d330a91bc __netbox_{gunicorn,uwsgi}: add netbox ownership to config file 2020-09-05 22:27:42 +02:00
matze 090a8f015e __netbox_uwsgi: fix uwsgi netbox service file
Revert working directory changes as the configuration file still needs
to be accessable. An absolute path would work, too, but it is not the
preferred way.

To still work with the python wsgi application, `--chdir` is used.
2020-09-05 22:08:37 +02:00
matze ffba3ae776 __netbox_uwsgi: add --serve-static parameter
New option to directly serve static content via uWSGI.
2020-09-05 22:01:15 +02:00
matze 5a403de057 __netbox_uwsgi: fix shellcheck
Fixed shellcheck cause of the find command. This required a bigger
change due to variables and subshell. Now, input is used through a
here-document.
2020-09-05 19:09:34 +02:00