blob: 5e78659568785395f46f801b613cda13dde8b8c9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
Puppet::Type.type(:append_line).provide(:ruby) do
def exists?
File.readlines(resource[:path]).find do |line|
line.chomp == resource[:line].chomp
end
end
def create
File.open(resource[:path], 'a') do |fh|
fh.puts resource[:line]
end
end
end
|