Defined Type: ipa::hostadd

Defined in:
manifests/hostadd.pp

Overview

Parameters:

  • host (Any) (defaults to: $name)
  • otp (Any) (defaults to: {})
  • desc (Any) (defaults to: {})
  • clientos (Any) (defaults to: {})
  • clientpf (Any) (defaults to: {})
  • locality (Any) (defaults to: {})
  • location (Any) (defaults to: {})


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'manifests/hostadd.pp', line 1

define ipa::hostadd (
  $host     = $name,
  $otp      = {},
  $desc     = {},
  $clientos = {},
  $clientpf = {},
  $locality = {},
  $location = {}
) {

  $timestamp = strftime("%a %b %d %Y %r")
  $descinfo = rstrip(join(['Added by HUIT IPA Puppet module on',$timestamp,$desc], " "))

  if $::ipa_adminhomedir and is_numeric($::ipa_adminuidnumber) {
    exec { "hostadd-${host}":
      command   => "/sbin/runuser -l admin -c \'/usr/bin/ipa host-add ${host} --locality=\"${locality}\" --location=\"${location}\" --desc=\"${descinfo}\" --platform=\"${clientpf}\" --os=\"${clientos}\" --password=${otp}\'",
      unless    => "/sbin/runuser -l admin -c \'/usr/bin/ipa host-show ${host} >/dev/null 2>&1\'",
      tries     => '60',
      try_sleep => '60'
    }
  }
}