community.openwrt.service module – Manage services on OpenWrt targets
Note
This module is part of the community.openwrt collection (version 0.5.0).
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.openwrt.
To use it in a playbook, specify: community.openwrt.service.
Synopsis
The community.openwrt.service module controls services on OpenWrt using init scripts.
It can start, stop, restart, reload services and manage their enabled state.
Note
This module has a corresponding action plugin.
Parameters
Parameter |
Comments |
|---|---|
Whether the service should start on boot. Choices:
|
|
Name of the service. Corresponds to the init script name in |
|
Pattern to search for in the process table to determine if the service is running. If specified, this pattern is used with |
|
Desired state of the service. Choices:
|
Attributes
Attribute |
Support |
Description |
|---|---|---|
Support: full |
Can run in |
|
Support: none |
Returns details on what has changed (or possibly needs changing in |
|
Platform: OpenWrt |
Target platform for this module. |
Examples
- name: Start the network service
community.openwrt.service:
name: network
state: started
- name: Stop the firewall service
community.openwrt.service:
name: firewall
state: stopped
- name: Restart the dnsmasq service
community.openwrt.service:
name: dnsmasq
state: restarted
- name: Enable a service to start on boot
community.openwrt.service:
name: uhttpd
enabled: true
- name: Disable a service from starting on boot
community.openwrt.service:
name: telnet
enabled: false
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
The name of the service. Returned: always Sample: |
|