Forge Home

service

Tasks that manipulate a service

181,454 downloads

15,188 latest version

5.0 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 3.0.0 (latest)
  • 2.3.1
  • 2.3.0
  • 2.2.0
  • 2.1.0
  • 2.0.0
  • 1.4.0
  • 1.3.0
  • 1.2.0
  • 1.1.0
  • 1.0.0
  • 0.6.0
  • 0.5.0
  • 0.4.0
  • 0.3.1
  • 0.3.0
  • 0.2.0
  • 0.1.3
released Apr 13th 2023
This version is compatible with:
  • Puppet Enterprise 2023.8.x, 2023.7.x, 2023.6.x, 2023.5.x, 2023.4.x, 2023.3.x, 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x
  • Puppet >= 7.0.0 < 9.0.0
  • , , , , , , ,
Tasks:
  • service

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'puppetlabs-service', '3.0.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add puppetlabs-service
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install puppetlabs-service --version 3.0.0

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

puppetlabs/service — version 3.0.0 Apr 13th 2023

service

Table of Contents

  1. Overview
  2. Module Description
  3. Setup
  4. Usage
  5. Reference
  6. Limitations
  7. Development

Overview

Module provides services tasks.

Module Description

The service module contains 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.

Setup

Requirements

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.

Usage

  • To view the available actions and parameters, on the command line, run puppet task show service
  • To view the completed list of services that are supported see the Puppet services documentation.
  • To run a service task, use the task command, specifying the action and the name of the service.
  • To show help for the task CLI, run puppet task run --help or bolt task run --help

Default task

  • 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

Linux task

  • 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.

Windows task

  • 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.

Reference

For information on the classes and types, see the REFERENCE.md.

Limitations

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

Development

Puppet modules on the Puppet Forge are open projects, and community contributions are essential for keeping them great. To contribute to Puppet projects, see our module contribution guide.