LEFT | RIGHT |
1 # == Type: adblockplus::host | 1 # == Type: adblockplus::host |
2 # | 2 # |
3 # Manage host information for any node within the Adblock Plus infrastructure. | 3 # Manage host information for any node within the Adblock Plus infrastructure. |
4 # | 4 # |
5 # === Parameters: | 5 # === Parameters: |
6 # | 6 # |
7 # [*ensure*] | 7 # [*ensure*] |
8 # Whether to ensure any host-related resources being 'present' or 'absent'. | 8 # Whether to ensure any host-related resources being 'present' or 'absent'. |
9 # Note that implicit realization of embedded resources only takes place if | 9 # Note that implicit realization of embedded resources only takes place if |
10 # $ensure is 'absent'. | 10 # $ensure is 'absent'. |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 # | 47 # |
48 # # Global realization, i.e. when creating a node all others can access | 48 # # Global realization, i.e. when creating a node all others can access |
49 # realize(Host<|tag == 'adblockplus::host'|>) | 49 # realize(Host<|tag == 'adblockplus::host'|>) |
50 # realize(Sshkey<|tag == 'adblockplus::host'|>) | 50 # realize(Sshkey<|tag == 'adblockplus::host'|>) |
51 # | 51 # |
52 # # Addressing (meta-) parameters for re-using their values | 52 # # Addressing (meta-) parameters for re-using their values |
53 # $fqdn = getparam(Adblockplus::Host['node1'], 'fqdn') | 53 # $fqdn = getparam(Adblockplus::Host['node1'], 'fqdn') |
54 # $primary_ip = getparam(Host['node1'], 'ip') | 54 # $primary_ip = getparam(Host['node1'], 'ip') |
55 # $key_type = getparam(Sshkey['node1'], 'type') | 55 # $key_type = getparam(Sshkey['node1'], 'type') |
56 # | 56 # |
| 57 # # Resources associated with 'absent' hosts are always realized |
| 58 # adblockplus::host {'node0': |
| 59 # ensure => 'absent', |
| 60 # } |
| 61 # |
57 define adblockplus::host ( | 62 define adblockplus::host ( |
58 $ensure = 'present', | 63 $ensure = 'present', |
59 $fqdn = "$name.$adblockplus::authority", | 64 $fqdn = "$name.$adblockplus::authority", |
60 $groups = [], | 65 $groups = [], |
61 $ips = [], | 66 $ips = [], |
62 $public_key = undef, | 67 $public_key = undef, |
63 $role = undef, | 68 $role = undef, |
64 ) { | 69 ) { |
65 | 70 |
66 include adblockplus | 71 include adblockplus |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 | 106 |
102 if $ensure == 'absent' { | 107 if $ensure == 'absent' { |
103 realize(Host[$title]) | 108 realize(Host[$title]) |
104 realize(Sshkey[$title]) | 109 realize(Sshkey[$title]) |
105 } | 110 } |
106 | 111 |
107 if $::role != undef and manifest_exists("adblockplus::host::$::role") { | 112 if $::role != undef and manifest_exists("adblockplus::host::$::role") { |
108 ensure_resource("adblockplus::host::$::role", $title, {name => $name}) | 113 ensure_resource("adblockplus::host::$::role", $title, {name => $name}) |
109 } | 114 } |
110 } | 115 } |
LEFT | RIGHT |