ansible.builtin.openwrt_init (v2.9.27) — module

Manage services on OpenWrt.

| "added in version" 2.3 of ansible.builtin"

Authors: Andrew Gaffney (@agaffney)

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.9.27

Description

Controls OpenWrt services on remote hosts.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Example action to start service httpd, if not running
- openwrt_init:
    state: started
    name: httpd
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Example action to stop service cron, if running
- openwrt_init:
    name: cron
    state: stopped
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Example action to reload service httpd, in all cases
- openwrt_init:
    name: httpd
    state: reloaded
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Example action to enable service httpd
- openwrt_init:
    name: httpd
    enabled: yes

Inputs

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

state:
    choices:
    - started
    - stopped
    - restarted
    - reloaded
    description:
    - C(started)/C(stopped) are idempotent actions that will not run commands unless necessary.
      C(restarted) will always bounce the service. C(reloaded) will always reload.

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

pattern:
    description:
    - If the service does not respond to the 'running' command, name a substring to look
      for as would be found in the output of the I(ps) command as a stand-in for a 'running'
      result.  If the string is found, the service will be assumed to be running.