Skip to content

Commit f86ff00

Browse files
committed
Introduce a Linux FHS run mode
The idea is that distro native packages can use this runmode without having to patch the code base. This is still not complete since there's no automatic detection of when to use this.
1 parent d581988 commit f86ff00

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

lib/puppet/util/run_mode.rb

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,42 @@ def gem_cmd
9595
end
9696
end
9797

98+
class LinuxFHSRunMode < RunMode
99+
def conf_dir
100+
which_dir("/etc/puppet", "~/.puppetlabs/etc/puppet")
101+
end
102+
103+
def code_dir
104+
which_dir("/etc/puppet/code", "~/.puppetlabs/etc/code")
105+
end
106+
107+
def var_dir
108+
which_dir("/var/lib/puppet", "~/.puppetlabs/opt/puppet/cache")
109+
end
110+
111+
def public_dir
112+
which_dir("/var/lib/puppet/public", "~/.puppetlabs/opt/puppet/public")
113+
end
114+
115+
def run_dir
116+
which_dir("/run/puppet", "~/.puppetlabs/var/run")
117+
end
118+
119+
def log_dir
120+
which_dir("/var/log/puppet", "~/.puppetlabs/var/log")
121+
end
122+
123+
def pkg_config_path
124+
# TODO: not always
125+
'/usr/lib64/pkgconfig'
126+
end
127+
128+
def gem_cmd
129+
# TODO: not always
130+
'/usr/bin/gem'
131+
end
132+
end
133+
98134
class WindowsRunMode < RunMode
99135
def conf_dir
100136
which_dir(File.join(windows_common_base("puppet/etc")), "~/.puppetlabs/etc/puppet")

0 commit comments

Comments
 (0)