forked from ajay-cs/code
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpuppet.txt
57 lines (36 loc) · 1.44 KB
/
puppet.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
[root@dev ~]# cat file.pp
file { '/root/file1':
ensure => 'file',
type => 'file',
}
[root@dev ~]# puppet apply file.pp
Notice: Compiled catalog for dev in environment production in 0.08 seconds
Error: Parameter type failed on File[/root/file1]: type is read-only at /root/file.pp:5
Wrapped exception:
type is read-only
##############################################################################
[root@dev ~]# cat file.pp
file { '/root/file1':
ensure => 'file',
owner => '0',
group => '0',
mode => '0644',
}
[root@dev ~]# puppet apply file.pp
Notice: Compiled catalog for dev in environment production in 0.07 seconds
Notice: /Stage[main]/Main/File[/root/file1]/ensure: created
Notice: Finished catalog run in 0.01 seconds
type => # A read-only state to check the file..
################################################################################
file { '/root/file2':
ensure => 'file',
content => inline_template("created by ajay at <%= Time.now%>\n"),
}
################################################################################
Class in puppet
################################################################################
Chef -> directory structure
###############################################################################
chef generate cookbook motd
Dir structure
##############################################################################