# Puppet Class: puppet_cd::server::service

Inherits:
  puppet_cd::params

Defined in:
  manifests/server/service.pp

## Summary

Class manages the puppet server service for the puppet_cd module.

## Overview

puppet_cd::server::service.pp Module name: puppet_cd Author: Arne Teuke (arne_teuke@confdroid)

    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    # File 'manifests/server/service.pp', line 6

    class puppet_cd::server::service (

    ) inherits puppet_cd::params {
      require puppet_cd::main::files

      # manage agent service on all nodes
      service { $pt_agent_service:
        ensure     => running,
        hasstatus  => true,
        hasrestart => true,
        enable     => true,
      }

      # manage puppet server service
      if $fqdn == $pt_pm_fqdn {
        require puppet_cd::firewall::iptables
        require puppet_cd::main::user

        service { $pt_server_service:
          ensure     => running,
          hasstatus  => true,
          hasrestart => true,
          enable     => true,
        }
      }

      # manage puppetdb service
      if $fqdn == $pt_db_fqdn {
        require puppet_cd::firewall::iptables

        service { $pt_db_service:
          ensure     => running,
          hasstatus  => true,
          hasrestart => true,
          enable     => true,
        }
      }
    }