Note
This plugin is part of the community.general collection.
To install it use: ansible-galaxy collection install community.general.
To use it in a playbook, specify: community.general.openwrt_init.
The below requirements are needed on the host that executes this module.
| Parameter | Choices/Defaults | Comments |
|---|---|---|
| enabled boolean |
| Whether the service should start on boot. At least one of state and enabled are required.
|
| name string / required | Name of the service. aliases: service | |
| pattern string | 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 string |
| started/stopped are idempotent actions that will not run commands unless necessary. restarted will always bounce the service. reloaded will always reload. |
Note
- 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
© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.10/collections/community/general/openwrt_init_module.html