Project

General

Profile

Settingsyml » History » Version 25

Dominic Cleal, 11/13/2012 11:46 AM
sudo rules change before/after Puppet 3.0, see PR 16 on puppet-puppet

1 1 Paul Kelly
h1. Settings
2
3 9 Ohad Levy
The configuration for Smart-Proxy is held in the @/etc/foreman-proxy/settings.yml@ or @config/settings.yml@ file.
4 1 Paul Kelly
5 3 Paul Kelly
h2. YAML start
6
7 2 Paul Kelly
The first non-comment line of this file must be three dashes.
8
9 1 Paul Kelly
<pre>
10
---
11 2 Paul Kelly
</pre>
12 1 Paul Kelly
13 3 Paul Kelly
h2. SSL configuration
14 1 Paul Kelly
15 3 Paul Kelly
The existence of all the three ssl key entries below enables the use of an SSL connections.
16
17
NOTE that both client certificates need to be signed by the same CA, which must be in the *ssl_ca_file*, in order for this to work
18 5 Jochen Schalanda
see [[SSL]] for more information
19 2 Paul Kelly
20 1 Paul Kelly
<pre>
21
:ssl_certificate: ssl/certs/fqdn.pem
22
:ssl_ca_file: ssl/certs/ca.pem
23
:ssl_private_key: ssl/private_keys/fqdn.key
24
</pre>
25 2 Paul Kelly
26
This is the list of hosts from which the smart proxy will accept connections. If this list is empty then every verified SSL connection is allowed to access the API.
27
<pre>
28 1 Paul Kelly
:trusted_hosts:
29
- foreman.prod.domain
30
- foreman.dev.domain
31
</pre>
32
33 3 Paul Kelly
h2. Instance attributes
34
35 5 Jochen Schalanda
If this entry is present and not false then Smart-Proxy will attempt to disconnect itself from the controlling terminal and daemonize itself.
36 2 Paul Kelly
<pre>
37 1 Paul Kelly
:daemon: true
38
</pre>
39 2 Paul Kelly
40
The port listened to by the proxy. If this is not present then the default Sinatra port of 4567 is used.
41
42
<pre>
43 1 Paul Kelly
:port: 8443
44
</pre>
45
46 3 Paul Kelly
h2. TFTP section
47
48 5 Jochen Schalanda
Activate the TFTP management module within the Smart-Proxy instance. 
49 3 Paul Kelly
50 4 Paul Kelly
The *tftproot* value is directory into which tftp files are copied and then served from. The tftp daemon will also be expected to chroot to this location. This component is only supported in the Unix environment
51 3 Paul Kelly
<pre>
52 1 Paul Kelly
:tftp: true
53 6 Ohad Levy
:tftproot: /var/lib/tftpboot
54 13 Ohad Levy
:tftp_servername: name of your tftp server (used for next server value in your dhcp reservation) - defaults to the host name of your proxy.
55 3 Paul Kelly
</pre>
56 1 Paul Kelly
57 6 Ohad Levy
*NOTE*: the foreman proxy user must have read/write access to the _tftpboot/pxelinux.cfg_ and _tftpboot/boot_ directories.
58
59 3 Paul Kelly
h2. DNS section
60 1 Paul Kelly
61 5 Jochen Schalanda
Activate the DNS management module within the Smart-Proxy instance. 
62 3 Paul Kelly
63
The DNS module can manipulate any DNS server that complies with the ISC Dynamic DNS Update standard and can therefore be used to manage both Microsoft and Bind servers.
64
65
The *dns_key* is used to validate the client request. If it is not present then the update operation is performed without peer verification, (not recommended.)
66 5 Jochen Schalanda
The *dns_server* option is used if the Smart-Proxy is not located on the same physical host as the DNS server. If it is not specified then localhost is presumed.
67 3 Paul Kelly
<pre>
68 1 Paul Kelly
:dns: true
69
:dns_key: /home/proxy/keys/Kapi.+157+47848.private
70 3 Paul Kelly
:dns_server: dnsserver.site.domain.com
71
</pre>
72 1 Paul Kelly
73 6 Ohad Levy
*NOTE*: if you use a key, make sure that the foreman proxy account can read that file.
74
75 3 Paul Kelly
h2. DHCP section
76
77 5 Jochen Schalanda
Activate the DHCP management module within the Smart-Proxy instance. 
78 3 Paul Kelly
79 4 Paul Kelly
<pre>
80 1 Paul Kelly
:dhcp: true
81 4 Paul Kelly
</pre>
82 5 Jochen Schalanda
If the DHCP server is ISC compliant then set *dhcp_vendor* to *isc*. In this case Smart-Proxy must run on the same host as the DHCP server. 
83
If the proxy is managing a Microsoft DHCP server then set *dhcp_vendor* to *native_ms*. Smart-Proxy must then be run on an NT server so as to access the Microsoft native tools, though it does not have to be the same machine as the DHCP server. More details can be found at [[Foreman:Foreman Architecture]].
84 4 Paul Kelly
<pre>
85 1 Paul Kelly
:dhcp_vendor: isc
86 4 Paul Kelly
</pre>
87 5 Jochen Schalanda
The DHCP component needs access to the DHCP configuration file as well as the currently allocated leases. The section below shows these values for a RedHat client. In the case of a Smart-Proxy hosted on an Ubuntu machine then these values would be more appropriate: */etc/dhcp3/dhcpd.conf* and */var/lib/dhcp3/dhcpd.leases*
88 4 Paul Kelly
<pre>
89 1 Paul Kelly
:dhcp_config: etc/dhcpd.conf
90
:dhcp_leases: etc/dhcpd.leases
91 4 Paul Kelly
</pre>
92 1 Paul Kelly
93 6 Ohad Levy
*NOTE*: Make sure that the foreman proxy account can read both ISC configuration files.
94
95 16 Paul Kelly
If your *native_ms* implementation is slow then you can request that the smart proxy only operate on a subset of the subnets managed by the dhcp server.
96
<pre>
97
:dhcp_subnets: [192.168.1.0/255.255.255.0, 192.168.11.0/255.255.255.0]
98
</pre>
99 14 Marcello de Sousa
If you secured your DHCP with an "omapi_key", add the entries:
100
<pre>
101
:dhcp_key_name: omapi_key
102
:dhcp_key_secret: XXXXXXXX
103
</pre>
104
105 1 Paul Kelly
h2. Puppet Certificate Authority section
106
107 5 Jochen Schalanda
Activate the Puppet CA management module within the Smart-Proxy instance. 
108 1 Paul Kelly
109 5 Jochen Schalanda
This should only be enabled in the Smart-Proxy that is hosted on the machine responsible for providing certificates to your puppet clients. You would expect to see a directory */var/lib/puppet/ssl/ca* on such a host.
110 4 Paul Kelly
<pre>
111
:puppetca: true
112 1 Paul Kelly
</pre>
113
114 10 Mark Bainter
If your puppet SSL directory is located elsewhere, you'll need to set 'ssldir' as well.
115
<pre>
116 12 Ohad Levy
:ssldir: /etc/puppet/ssl
117 10 Mark Bainter
</pre>
118
119 21 Ohad Levy
<pre>
120
:puppetdir: /etc/puppet
121
</pre>
122
123 18 Anthony Newman
The proxy requires write access to the puppet autosign.conf file, which is usually owner and group puppet, and has mode 0644 according to the puppet defaults.
124
125
Ensure the foreman-proxy user is added to the puppet group ( e.g. `gpasswd -a foreman-proxy puppet` or `usermod -aG puppet foreman-proxy`)
126
127
puppet.conf:
128
<pre>
129
[master]
130 22 Markus Heberling
autosign = $confdir/autosign.conf {owner = service, group = service, mode = 664 }
131 18 Anthony Newman
</pre>
132
133
134 6 Ohad Levy
Sudo access to the proxy is required - in your sudoers file ensure you have the following lines:
135
136 25 Dominic Cleal
For older puppet (pre-3.0) with separate sub-commands available:
137 18 Anthony Newman
138 1 Paul Kelly
<pre>
139 18 Anthony Newman
foreman-proxy ALL = NOPASSWD: /usr/sbin/puppetca *
140 6 Ohad Levy
Defaults:foreman-proxy !requiretty
141 1 Paul Kelly
</pre>
142 18 Anthony Newman
143 25 Dominic Cleal
For newer monolithic puppet without separate commands (3.0-onwards)
144 18 Anthony Newman
145
<pre>
146
foreman-proxy ALL = NOPASSWD: /usr/bin/puppet cert *
147
Defaults:foreman-proxy !requiretty
148
</pre>
149
150 6 Ohad Levy
151 1 Paul Kelly
h2. Puppet section
152
153 5 Jochen Schalanda
Activate the puppet management module within the Smart-Proxy instance. 
154 1 Paul Kelly
155 5 Jochen Schalanda
This should only be enabled in the Smart-Proxy that is hosted on the machine capable of executing *puppetrun*. This will be a puppetmaster.
156 20 Florian Rosenegger
This can also be set to true if you need to import puppet classes from the puppetmaster. Without this the import will not be possible
157 1 Paul Kelly
158
<pre>
159
:puppet: true
160 6 Ohad Levy
</pre>
161 20 Florian Rosenegger
162
<pre>
163
:puppet_conf: /etc/puppet/puppet.conf
164
# Defaults to %25INSTALL_DIR%25/.puppet/puppet.conf
165
</pre>
166
167 6 Ohad Levy
Sudo access to the proxy is required - in your sudoers file ensure you have the following lines:
168
169 19 Sander Hoentjen
<pre>
170 20 Florian Rosenegger
Defaults:foreman-proxy !requiretty
171 1 Paul Kelly
foreman-proxy ALL = NOPASSWD: /usr/bin/puppetrun
172 15 Corey Osman
</pre>
173
If running puppet version 2.6+ you will need to use the following  (use /opt/puppet/bin/puppet for Puppet Enterprise)
174 19 Sander Hoentjen
<pre>
175 20 Florian Rosenegger
Defaults:foreman-proxy !requiretty
176 4 Paul Kelly
foreman-proxy ALL = NOPASSWD: /usr/bin/puppet
177 15 Corey Osman
</pre>
178 17 Ohad Levy
179 24 Wlodzimierz Kowalski
*EDIT* In my case the account which was triggering puppetrun was not foreman-proxy but *foreman* itself. It took me some time to figure out why puppetruns are not triggered.
180 23 Wlodzimierz Kowalski
181 4 Paul Kelly
h2. Logging
182
183 5 Jochen Schalanda
The proxy's output is captured to the the *log_file* and may be filtered via the usual unix syslog levels:
184
185 8 Mark Bainter
* @WARN@
186
* @DEBUG@
187
* @ERROR@
188
* @FATAL@
189
* @INFO@
190
* @UNKNOWN@
191 5 Jochen Schalanda
192
See Ruby's "Logger class":http://www.ruby-doc.org/stdlib/libdoc/logger/rdoc/classes/Logger.html for details.
193 4 Paul Kelly
194
<pre>
195 1 Paul Kelly
:log_file: /tmp/proxy.log
196 7 Mark Bainter
:log_level: DEBUG
197 1 Paul Kelly
</pre>