community.general.openwrt_init module – Manage services on OpenWrt.
Note
This module is part of the community.general collection (version 4.8.3).
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.openwrt_init
.
Requirements
The below requirements are needed on the host that executes this module.
An OpenWrt system (with python)
Parameters
Parameter |
Comments |
---|---|
Whether the service should start on boot. At least one of state and enabled are required. Choices:
|
|
Name of the service. |
|
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. |
|
Choices:
|
Examples
- name: Start service httpd, if not running
community.general.openwrt_init:
state: started
name: httpd
- name: Stop service cron, if running
community.general.openwrt_init:
name: cron
state: stopped
- name: Reload service httpd, in all cases
community.general.openwrt_init:
name: httpd
state: reloaded
- name: Enable service httpd
community.general.openwrt_init:
name: httpd
enabled: yes
Authors
Andrew Gaffney (@agaffney)
Collection links
Issue Tracker Repository (Sources) Submit a bug report Request a feature Communication