Skip to content

Commit 2e433ba

Browse files
Update classExample.txt
1 parent 4d416a7 commit 2e433ba

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

Puppet/classExample.txt

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,33 @@ node default{
3030
}
3131
}
3232

33+
# Class example with if condition and multiple parameters
34+
class user($username, $test) {
35+
36+
user { $username:
37+
ensure => present,
38+
managehome => true,
39+
}
40+
if $test =='testing' {
41+
file { '/tmp/2.txt':
42+
content => $test,
43+
}
44+
}
45+
else
46+
{
47+
file { '/tmp/3.txt':
48+
content => $test,
49+
}
50+
51+
}
52+
}
53+
54+
node default {
55+
class { 'user':
56+
username => 'raman',
57+
test => 'notesting' ,
58+
}
59+
60+
}
61+
3362

0 commit comments

Comments
 (0)