community / community.general / 1.3.11 / module / openwrt_init Manage services on OpenWrt. Authors: Andrew Gaffney (@agaffney)community.general.openwrt_init (1.3.11) — module
Install with ansible-galaxy collection install community.general:==1.3.11
collections: - name: community.general version: 1.3.11
Controls OpenWrt services on remote hosts.
- 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
name: aliases: - service description: - Name of the service. required: true type: str 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. type: str 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. type: str