-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbase.rb
47 lines (39 loc) · 1.12 KB
/
base.rb
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
STACK_CONFIG = {}
module LondonStepper
module Verifiers
module File
def file_contains_not(path, text)
@commands << "grep -v '#{text}' #{path}"
end
end
module Daemon
def has_daemon(name)
@commands << "test -f /etc/init.d/#{name}"
end
end
module Logrotation
def has_logrotation(name)
@commands << "test -f /etc/logrotate.d/#{name}"
end
end
module Permission
def has_permission(path, mod)
@commands << "stat #{path} | grep 'Access: (#{mod}'"
end
def has_owner(name)
@commands << "" # TODO
end
def has_group(name)
@commands << "" # TODO
end
end
end
end
Sprinkle::Verify.register(LondonStepper::Verifiers::File)
Sprinkle::Verify.register(LondonStepper::Verifiers::Daemon)
Sprinkle::Verify.register(LondonStepper::Verifiers::Logrotation)
Sprinkle::Verify.register(LondonStepper::Verifiers::Permission)
# TODO/installers:
# - touch '/tmp/hello/world/message.txt' # mkdir -p + touch
# - symlink '/tmp/hello' => '/tmp/hello.txt'
# - chmod '666', '/tmp/hello.txt'