community.general.simpleinit_msb (8.5.0) — module

Manage services on Source Mage GNU/Linux

| "added in version" 7.5.0 of community.general"

Authors: Vlad Glagolev (@vaygr)

Install collection

Install with ansible-galaxy collection install community.general:==8.5.0


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

Description

Controls services on remote hosts using C(simpleinit-msb).

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Example action to start service httpd, if not running
  community.general.simpleinit_msb:
    name: httpd
    state: started
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Example action to stop service httpd, if running
  community.general.simpleinit_msb:
    name: httpd
    state: stopped
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Example action to restart service httpd, in all cases
  community.general.simpleinit_msb:
    name: httpd
    state: restarted
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Example action to reload service httpd, in all cases
  community.general.simpleinit_msb:
    name: httpd
    state: reloaded
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Example action to enable service httpd, and not touch the running state
  community.general.simpleinit_msb:
    name: httpd
    enabled: true

Inputs

    
name:
    aliases:
    - service
    description:
    - Name of the service.
    required: true
    type: str

state:
    choices:
    - running
    - started
    - stopped
    - restarted
    - reloaded
    description:
    - V(started)/V(stopped) are idempotent actions that will not run commands unless necessary.  V(restarted)
      will always bounce the service.  V(reloaded) will always reload.
    - At least one of O(state) and O(enabled) are required.
    - Note that V(reloaded) will start the service if it is not already started, even
      if your chosen init system would not normally.
    required: false
    type: str

enabled:
    description:
    - Whether the service should start on boot.
    - At least one of O(state) and O(enabled) are required.
    required: false
    type: bool