- Docs »
- openwrt_init - Manage services on OpenWrt.
-
You are reading an unmaintained version of the Ansible documentation. Unmaintained Ansible versions can contain unfixed security vulnerabilities (CVE). Please upgrade to a maintained version. See the latest Ansible documentation.
openwrt_init - Manage services on OpenWrt.
- Controls OpenWrt services on remote hosts.
The below requirements are needed on the host that executes this module.
- An OpenWrt system (with python)
Parameter |
Choices/Defaults |
Comments |
enabled
bool |
|
Whether the service should start on boot. At least one of state and enabled are required.
|
name
required |
|
Name of the service.
aliases: service
|
pattern
|
|
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 ps command as a stand-in for a 'running' result. If the string is found, the service will be assumed to be running.
|
state
|
Choices:
- started
- stopped
- restarted
- reloaded
|
started /stopped are idempotent actions that will not run commands unless necessary. restarted will always bounce the service. reloaded will always reload.
|
Note
- One option other than name is required.
# Example action to start service httpd, if not running
- openwrt_init:
state: started
name: httpd
# Example action to stop service cron, if running
- openwrt_init:
name: cron
state: stopped
# Example action to reload service httpd, in all cases
- openwrt_init:
name: httpd
state: reloaded
# Example action to enable service httpd
- openwrt_init:
name: httpd
enabled: yes
This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.
This module is flagged as community which means that it is maintained by the Ansible Community. See Module Maintenance & Support for more info.
For a list of other modules that are also maintained by the Ansible Community, see here.
- Andrew Gaffney (@agaffney)
Hint
If you notice any issues in this documentation you can edit this document to improve it.