Ensure `xymon` server service is enabled and started
This commit is contained in:
parent
532e37a474
commit
052c2fd7fe
|
@ -4,3 +4,4 @@
|
||||||
### Features
|
### Features
|
||||||
* Install `xymon` packages for Debian based distros.
|
* Install `xymon` packages for Debian based distros.
|
||||||
* Manage `xymon` server configuration (/etc).
|
* Manage `xymon` server configuration (/etc).
|
||||||
|
* Ensure `xymon` server service is enabled and started.
|
||||||
|
|
|
@ -17,6 +17,7 @@ Manage Xymon server installation and configuration.
|
||||||
* **xymon_server__base_packages** : List of base packages in order to provide `xymon` server [default : `xymon`].
|
* **xymon_server__base_packages** : List of base packages in order to provide `xymon` server [default : `xymon`].
|
||||||
* **xymon_server__deploy_state** : The desired state this role should achieve [default : `present`].
|
* **xymon_server__deploy_state** : The desired state this role should achieve [default : `present`].
|
||||||
* **ymon_server__etc_src** : Directory used as source to templating /etc configuration content [default : `etc/xymon`].
|
* **ymon_server__etc_src** : Directory used as source to templating /etc configuration content [default : `etc/xymon`].
|
||||||
|
* **xymon_server__service_manage** : If the Xymon server service should be managed [default : `True`].
|
||||||
|
|
||||||
## Example Playbook
|
## Example Playbook
|
||||||
|
|
||||||
|
@ -33,6 +34,7 @@ Manage Xymon server installation and configuration.
|
||||||
This role will :
|
This role will :
|
||||||
* Install needed packages to provide `xymon` server.
|
* Install needed packages to provide `xymon` server.
|
||||||
* Manage `xymon` server configuration (/etc).
|
* Manage `xymon` server configuration (/etc).
|
||||||
|
* Ensure `xymon` server service is enabled and started.
|
||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,19 @@ xymon_server__base_packages:
|
||||||
xymon_server__deploy_state: 'present'
|
xymon_server__deploy_state: 'present'
|
||||||
|
|
||||||
# ]]]
|
# ]]]
|
||||||
|
# .. envvar:: xymon_server__service_manage [[[
|
||||||
|
#
|
||||||
|
# If the Xymon server service should be managed? Possible options:
|
||||||
|
#
|
||||||
|
# ``True``
|
||||||
|
# Default. The service is started and enabled.
|
||||||
|
#
|
||||||
|
# ``False``
|
||||||
|
# The service is stopped and disabled from startup.
|
||||||
|
#
|
||||||
|
xymon_server__service_manage: True
|
||||||
|
|
||||||
|
# ]]]
|
||||||
|
|
||||||
# ]]]
|
# ]]]
|
||||||
|
|
||||||
|
|
|
@ -29,3 +29,13 @@
|
||||||
with_filetree: '{{ xymon_server__etc_src }}'
|
with_filetree: '{{ xymon_server__etc_src }}'
|
||||||
when: item.state == 'file'
|
when: item.state == 'file'
|
||||||
|
|
||||||
|
# Manage services [[[1
|
||||||
|
|
||||||
|
- name: Manage Xymon server service
|
||||||
|
service:
|
||||||
|
name: 'xymon'
|
||||||
|
state: '{{ "started" if (xymon_server__deploy_state == "present" and
|
||||||
|
(xymon_server__service_manage | d(True) | bool))
|
||||||
|
else "stopped" }}'
|
||||||
|
enabled: '{{ xymon_server__service_manage | d(True) | bool }}'
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue