- Description
- Requirements
- Usage - Configuration options and additional functionality
- Reference - An under-the-hood peek at what the module is doing and how
- Limitations - OS compatibility, etc.
- Getting help - Some Helpful commands
This module provides services tasks, There are two kinds of tasks. The default task: that uses the puppet agent on the target node to manage and inspect the state of services. The linux task: that manipulates services on a linux derivative without a puppet agent installed on the target node.
This module is compatible with Puppet Enterprise and Puppet Bolt.
-
To run tasks with Puppet Enterprise, PE 2018.1 or later must be installed on the machine from which you are running task commands. Machines receiving task requests must be Puppet agents.
-
To run tasks with Puppet Bolt, Bolt 1.0 or later must be installed on the machine from which you are running task commands. Machines receiving task requests must have SSH or WinRM services enabled.
To run a service task, use the task command, specifying the action and the name of the service.
- With PE on the command line, run
puppet task run service action=<ACTION> name=<SERVICE_NAME>
. - With Bolt on the command line, run
bolt task run service action=<ACTION> name=<SERVICE_NAME>
.
For example, to check the status of the Apache httpd service, run:
- With PE, run
puppet task run service action=status name=httpd --nodes neptune
- With Bolt, run
bolt task run service action=status name=httpd --nodes neptune --modulepath ~/modules
- With PE on the command line, run
puppet task run service::linux action=<ACTION> name=<SERVICE_NAME>
. - With Bolt on the command line, run
bolt task run service::linux action=<ACTION> name=<SERVICE_NAME>
.
For example, to check the status of the Apache httpd service, run:
- With PE, run
puppet task run service::linux action=status name=httpd --nodes neptune
- With Bolt, run
bolt task run service::linux action=status name=httpd --nodes neptune --modulepath ~/modules
You can also run tasks in the PE console. See PE task documentation for complete information.
- With PE on the command line, run
puppet task run service::windows action=<ACTION> name=<SERVICE_NAME>
. - With Bolt on the command line, run
bolt task run service::windows action=<ACTION> name=<SERVICE_NAME>
.
For example, to check the status of the lmhosts service, run:
- With PE, run
puppet task run service::windows action=status name=lmhosts --nodes neptune
- With Bolt, run
bolt task run service::windows action=status name=lmhosts --nodes neptune --modulepath ~/modules
You can also run tasks in the PE console. See PE task documentation for complete information.
To view the available actions and parameters, on the command line, run puppet task show service
or see the service module page on the Forge.
For a complete list of services that are supported see the Puppet services documentation.
To run acceptance tests against Windows machines, ensure that the BEAKER_password
environment variable has been set to the password of the Administrator user of the target machine.
For an extensive list of supported operating systems, see metadata.json
To display help for the service task, run puppet task show service
To show help for the task CLI, run puppet task run --help
or bolt task run --help