Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: modules/adblockplus/manifests/host.pp

Issue 29366814: Noissue - Fix adblockplus::host $ensure = "absent" support (Closed)
Left Patch Set: Created Dec. 5, 2016, 10:49 a.m.
Right Patch Set: Noissue - Include $ensure = "absent" example in the host class documentation Created Dec. 5, 2016, 12:03 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | modules/private-stub/hiera/hosts.yaml » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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
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
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 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld