community.general.simpleinit_msb module – Manage services on Source Mage GNU/Linux

Note

This module is part of the community.general collection (version 9.4.0).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install community.general.

To use it in a playbook, specify: community.general.simpleinit_msb.

New in community.general 7.5.0

Synopsis

  • Controls services on remote hosts using simpleinit-msb.

Parameters

Parameter

Comments

enabled

boolean

Whether the service should start on boot.

At least one of state and enabled are required.

Choices:

  • false

  • true

name

aliases: service

string / required

Name of the service.

state

string

started/stopped are idempotent actions that will not run commands unless necessary. restarted will always bounce the service. reloaded will always reload.

At least one of state and enabled are required.

Note that reloaded will start the service if it is not already started, even if your chosen init system would not normally.

Choices:

  • "running"

  • "started"

  • "stopped"

  • "restarted"

  • "reloaded"

Attributes

Attribute

Support

Description

check_mode

Support: full

Can run in check_mode and return changed status prediction without modifying target.

diff_mode

Support: none

Will return details on what has changed (or possibly needs changing in check_mode), when in diff mode.

Notes

Note

  • This module needs ansible-core 2.15.5 or newer. Older versions have a broken and insufficient daemonize functionality.

Examples

- name: Example action to start service httpd, if not running
  community.general.simpleinit_msb:
    name: httpd
    state: started

- name: Example action to stop service httpd, if running
  community.general.simpleinit_msb:
    name: httpd
    state: stopped

- name: Example action to restart service httpd, in all cases
  community.general.simpleinit_msb:
    name: httpd
    state: restarted

- name: Example action to reload service httpd, in all cases
  community.general.simpleinit_msb:
    name: httpd
    state: reloaded

- name: Example action to enable service httpd, and not touch the running state
  community.general.simpleinit_msb:
    name: httpd
    enabled: true

Authors

  • Vlad Glagolev (@vaygr)