Puppet Class: psick::hosts::file

Defined in:
manifests/hosts/file.pp

Overview

This class manages the content of the /etc/hosts file

Parameters:

  • template (String) (defaults to: 'psick/hosts/file/hosts.erb')

    The erb template to use to manage the content of /etc/hosts

  • ipaddress (Optional[Stdlib::Compat::Ip_address]) (defaults to: $::psick::primary_ip)

    The IP address to use for the node hostname

  • domain (Variant[Undef,String]) (defaults to: $::domain)

    the domain to use for the node domain name

  • hostname (String) (defaults to: $::hostname)

    The hostname to use for the node hostname

  • extra_hosts (Array) (defaults to: [])

    An array of extra lines to add (one line for array element) to /etc/hosts.

  • no_noop (Boolean) (defaults to: false)


10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'manifests/hosts/file.pp', line 10

class psick::hosts::file (
  String $template  = 'psick/hosts/file/hosts.erb',

  Optional[Stdlib::Compat::Ip_address] $ipaddress = $::psick::primary_ip,
  Variant[Undef,String] $domain = $::domain,
  String $hostname              = $::hostname,
  Array $extra_hosts            = [],

  Boolean $no_noop              = false,
) {

  if !$::psick::noop_mode and $no_noop {
    info('Forced no-noop mode.')
    noop(false)
  }

  file { '/etc/hosts':
    ensure  => file,
    content => template($template),
  }

}