W3cubDocs

/Ansible

openwrt_init - Manage services on OpenWrt.

New in version 2.3.

Synopsis

Controls OpenWrt services on remote hosts.

Requirements (on host that executes module)

  • An OpenWrt system

Options

parameter required default choices comments
enabled
no
  • yes
  • no
Whether the service should start on boot. At least one of state and enabled are required.
name
yes
Name of the service.
aliases: service
pattern
no
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
no
  • 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.

Examples

# 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

Notes

Note

One option other than name is required.

This is an Extras Module

For more information on what this means please read Extras Modules

For help in developing on modules, should you be so inclined, please read Community Information & Contributing, developing_test_pr and Developing Modules.

© 2012–2016 Michael DeHaan
© 2016 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/openwrt_init_module.html