Forge Home

service

pdk
supported
tasks
Tasks that manipulate a service

145,146 downloads

2,545 latest version

5.0 quality score

Version information

  • 2.1.0 (latest)
  • 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 Aug 25th 2021
This version is compatible with:
  • Puppet Enterprise 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x, 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x
  • Puppet >= 6.0.0 < 8.0.0
  • Debian
    ,
    CentOS
    ,
    OracleLinux
    ,
    RedHat
    ,
    Ubuntu
    ,
    windows
Tasks:
  • service

Start using this module

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

Add this module to your Puppetfile:

mod 'puppetlabs-service', '2.1.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 2.1.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 2.1.0 Aug 25th 2021

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.