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

Side by Side Diff: modules/adblockplus/manifests/host.pp

Issue 29370632: NoIssue - Refactor ensure_*state functions (Closed)
Patch Set: Created Jan. 3, 2017, 2:25 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 @sshkey {$title: 102 @sshkey {$title:
103 ensure => $sshkey_ensure, 103 ensure => $sshkey_ensure,
104 host_aliases => $ips, 104 host_aliases => $ips,
105 key => $sshkey_key, 105 key => $sshkey_key,
106 name => $fqdn, 106 name => $fqdn,
107 require => File['/etc/ssh/ssh_known_hosts'], 107 require => File['/etc/ssh/ssh_known_hosts'],
108 tag => ['adblockplus::host'], 108 tag => ['adblockplus::host'],
109 type => $sshkey_type, 109 type => $sshkey_type,
110 } 110 }
111 111
112 if $ensure == 'absent' { 112 if !ensure_state($ensure) {
113 realize(Host[$title]) 113 realize(Host[$title])
114 realize(Sshkey[$title]) 114 realize(Sshkey[$title])
115 } 115 }
116 116
117 if $::role != undef and manifest_exists("adblockplus::host::$::role") { 117 if $::role != undef and manifest_exists("adblockplus::host::$::role") {
118 ensure_resource("adblockplus::host::$::role", $title, {name => $name}) 118 ensure_resource("adblockplus::host::$::role", $title, {name => $name})
119 } 119 }
120 } 120 }
OLDNEW
« no previous file with comments | « modules/adblockplus/lib/puppet/parser/functions/ensure_symlink_state.rb ('k') | modules/adblockplus/manifests/puppet.pp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld