|
16 | 16 | # See the License for the specific language governing permissions and |
17 | 17 | # limitations under the License. |
18 | 18 |
|
19 | | -nfs_server_hosts = %w{ |
20 | | - nfs-server-centos-stream-9 |
21 | | - nfs-server-ubuntu-2204 |
22 | | -}.include?(node['hostname']) |
23 | | - |
24 | | -if nfs_server_hosts |
25 | | - node.default['fb_iptables']['filter']['INPUT']['rules']['nfs server'] = { |
26 | | - 'rules' => [ |
27 | | - '-p tcp --dport 2049 -j ACCEPT', |
28 | | - '-p udp --dport 2049 -j ACCEPT', |
29 | | - ], |
30 | | - } |
31 | | - |
32 | | - directory '/var/nfs' do |
33 | | - owner node.root_user |
34 | | - group node.root_group |
35 | | - mode '0755' |
36 | | - end |
37 | | - |
38 | | - directory '/var/nfs/general' do |
39 | | - owner 'nobody' |
40 | | - group node.ubuntu? ? 'nogroup' : 'nobody' |
41 | | - mode '0777' |
42 | | - end |
43 | | - |
44 | | - node.default['boxcutter_nfs']['server']['exports']['/var/nfs/general'] = %w{ |
45 | | - *(rw,sync,no_subtree_check,insecure) |
46 | | - } |
47 | | - |
48 | | - include_recipe 'boxcutter_nfs::server' |
49 | | -end |
| 19 | +# nfs_server_hosts = %w{ |
| 20 | +# nfs-server-centos-stream-9 |
| 21 | +# nfs-server-ubuntu-2204 |
| 22 | +# }.include?(node['hostname']) |
| 23 | +# |
| 24 | +# if nfs_server_hosts |
| 25 | +# node.default['fb_iptables']['filter']['INPUT']['rules']['nfs server'] = { |
| 26 | +# 'rules' => [ |
| 27 | +# '-p tcp --dport 2049 -j ACCEPT', |
| 28 | +# '-p udp --dport 2049 -j ACCEPT', |
| 29 | +# ], |
| 30 | +# } |
| 31 | +# |
| 32 | +# directory '/var/nfs' do |
| 33 | +# owner node.root_user |
| 34 | +# group node.root_group |
| 35 | +# mode '0755' |
| 36 | +# end |
| 37 | +# |
| 38 | +# directory '/var/nfs/general' do |
| 39 | +# owner 'nobody' |
| 40 | +# group node.ubuntu? ? 'nogroup' : 'nobody' |
| 41 | +# mode '0777' |
| 42 | +# end |
| 43 | +# |
| 44 | +# node.default['boxcutter_nfs']['server']['exports']['/var/nfs/general'] = %w{ |
| 45 | +# *(rw,sync,no_subtree_check,insecure) |
| 46 | +# } |
| 47 | +# |
| 48 | +# include_recipe 'boxcutter_nfs::server' |
| 49 | +# end |
50 | 50 |
|
51 | 51 | nexus_hosts = %w{ |
52 | | - crake-nexus |
| 52 | + ip-10-0-1-51 |
53 | 53 | }.include?(node['hostname']) |
54 | 54 |
|
55 | 55 | if nexus_hosts |
| 56 | + # op item get 'tailscale oauth automation-sandbox-write-blue' --vault Automation-Sandbox |
| 57 | + # op item get v5zvz2gomyzhgow46esj7txneu --format json |
| 58 | + tailscale_oauth_client_id_write_blue =\ |
| 59 | + Boxcutter::OnePassword.op_read('op://Automation-Org/tailscale oauth write blue/username') |
| 60 | + tailscale_oauth_client_secret_write_blue = \ |
| 61 | + Boxcutter::OnePassword.op_read('op://Automation-Org/tailscale oauth write blue/credential') |
| 62 | + node.run_state['boxcutter_tailscale'] ||= {} |
| 63 | + node.run_state['boxcutter_tailscale']['oauth_client_id'] = tailscale_oauth_client_id_write_blue |
| 64 | + node.run_state['boxcutter_tailscale']['oauth_client_secret'] = tailscale_oauth_client_secret_write_blue |
| 65 | + node.default['boxcutter_tailscale']['enable'] = true |
| 66 | + node.default['boxcutter_tailscale']['ephemeral'] = false |
| 67 | + node.default['boxcutter_tailscale']['use_tailscale_dns'] = false |
| 68 | + node.default['boxcutter_tailscale']['shields_up'] = false |
| 69 | + node.default['boxcutter_tailscale']['hostname'] = 'aws-boxcutter-nexus' |
| 70 | + node.default['boxcutter_tailscale']['tags'] = ['chef'] |
| 71 | + include_recipe 'boxcutter_tailscale::default' |
| 72 | + |
56 | 73 | node.default['boxcutter_sonatype']['nexus_repository']['repositories'] = { |
57 | 74 | 'ros-apt-proxy' => { |
58 | 75 | 'name' => 'ros-apt-proxy', |
|
184 | 201 | }, |
185 | 202 | } |
186 | 203 |
|
187 | | - cloudflare_api_token = Boxcutter::OnePassword.op_read( |
188 | | - 'op://Automation-Org/Cloudflare API token amazing-sheila/credential', |
189 | | - ) |
| 204 | + # cloudflare_api_token = Boxcutter::OnePassword.op_read( |
| 205 | + # 'op://Automation-Org/Cloudflare API token amazing-sheila/credential', |
| 206 | + # ) |
190 | 207 |
|
191 | 208 | # Set up an HTTP-only listener for ubuntu proxies because apt doesn't work |
192 | 209 | # well with HTTPS |
193 | 210 | node.default['fb_nginx']['sites']['nexus_http'] = { |
194 | 211 | 'listen' => '80', |
195 | | - 'server_name' => 'crake-nexus.org.boxcutter.net', |
| 212 | + 'server_name' => 'aws-boxcutter-nexus.org.boxcutter.net', |
196 | 213 | 'location ~ ^/repository/' \ |
197 | 214 | '(ros-apt-proxy|' \ |
198 | 215 | 'ubuntu-archive-apt-proxy|' \ |
|
210 | 227 | }, |
211 | 228 | } |
212 | 229 |
|
213 | | - node.default['boxcutter_acme']['lego']['config'] = { |
| 230 | + node.run_state['boxcutter_acme'] ||= {} |
| 231 | + node.run_state['boxcutter_acme']['certbot'] ||= {} |
| 232 | + node.run_state['boxcutter_acme']['certbot']['cloudflare_api_token'] = \ |
| 233 | + Boxcutter::OnePassword.op_read('op://Automation-Org/Cloudflare API token amazing-sheila/credential') |
| 234 | + |
| 235 | + node.default['boxcutter_acme']['certbot']['config'] = { |
214 | 236 | 'nexus' => { |
215 | | - 'certificate_name' => 'crake-nexus.org.boxcutter.net', |
216 | | - 'data_path' => '/etc/lego', |
217 | | - 'renew_script_path' => '/opt/lego/lego_renew.sh', |
218 | | - 'renew_days' => '30', |
| 237 | + 'renew_script_path' => '/opt/certbot/bin/certbot_renew.sh', |
| 238 | + 'certbot_bin' => '/opt/certbot/venv/bin/certbot', |
| 239 | + 'domains' => ['aws-boxcutter-nexus.org.boxcutter.net', '*.aws-boxcutter-nexus.org.boxcutter.net'], |
219 | 240 | 'email' => 'letsencrypt@boxcutter.dev', |
220 | | - 'domains' => %w{ |
221 | | - crake-nexus.org.boxcutter.net |
222 | | - *.crake-nexus.org.boxcutter.net |
223 | | - }, |
224 | | - 'extra_parameters' => [ |
225 | | - '--dns=cloudflare', |
226 | | - # There are issues resolving apex domain servers over tailscale, so |
227 | | - # override the DNS resolver lego uses, in case we're running tailscale |
228 | | - '--dns.resolvers=newt.ns.cloudflare.com:53', |
229 | | - ], |
230 | | - 'extra_environment' => { |
231 | | - 'export CF_DNS_API_TOKEN' => cloudflare_api_token, |
232 | | - }, |
| 241 | + 'cloudflare_ini' => '/etc/chef/cloudflare.ini', |
| 242 | + 'extra_args' => [ |
| 243 | + '--dns-cloudflare', |
| 244 | + '--dns-cloudflare-credentials /etc/chef/cloudflare.ini', |
| 245 | + '--test-cert', |
| 246 | + ].join(' '), |
233 | 247 | }, |
234 | 248 | } |
235 | 249 |
|
236 | | - include_recipe 'boxcutter_acme::lego' |
| 250 | + # include_recipe 'boxcutter_acme::lego' |
| 251 | + # include_recipe 'boxcutter_acme::certbot' |
237 | 252 |
|
238 | 253 | node.default['fb_nginx']['enable_default_site'] = false |
239 | 254 | node.default['fb_nginx']['config']['http']['proxy_send_timeout'] = '120' |
|
246 | 261 |
|
247 | 262 | node.default['fb_nginx']['sites']['nexus'] = { |
248 | 263 | 'listen 443' => 'ssl', |
249 | | - 'server_name' => 'crake-nexus.org.boxcutter.net', |
| 264 | + 'server_name' => 'aws-nexus.org.boxcutter.net', |
250 | 265 | 'client_max_body_size' => '1G', |
251 | 266 | 'ssl_certificate' => |
252 | 267 | '/etc/lego/certificates/crake-nexus.org.boxcutter.net.crt', |
|
319 | 334 | }, |
320 | 335 | } |
321 | 336 |
|
322 | | - include_recipe 'fb_nginx' |
323 | | - |
324 | | - nexus_admin_username = Boxcutter::OnePassword.op_read( |
325 | | - 'op://Automation-Org/nexus admin blue/username', |
326 | | - ) |
327 | | - nexus_admin_password = Boxcutter::OnePassword.op_read( |
328 | | - 'op://Automation-Org/nexus admin blue/password', |
329 | | - ) |
330 | | - node.run_state['boxcutter_sonatype'] ||= {} |
331 | | - node.run_state['boxcutter_sonatype']['nexus_repository'] ||= {} |
332 | | - node.run_state['boxcutter_sonatype']['nexus_repository']['admin_username'] = nexus_admin_username |
333 | | - node.run_state['boxcutter_sonatype']['nexus_repository']['admin_password'] = nexus_admin_password |
| 337 | + # include_recipe 'fb_nginx' |
334 | 338 |
|
335 | | - include_recipe 'boxcutter_sonatype::default' |
| 339 | + # nexus_admin_username = Boxcutter::OnePassword.op_read( |
| 340 | + # 'op://Automation-Org/nexus admin blue/username', |
| 341 | + # ) |
| 342 | + # nexus_admin_password = Boxcutter::OnePassword.op_read( |
| 343 | + # 'op://Automation-Org/nexus admin blue/password', |
| 344 | + # ) |
| 345 | + # node.run_state['boxcutter_sonatype'] ||= {} |
| 346 | + # node.run_state['boxcutter_sonatype']['nexus_repository'] ||= {} |
| 347 | + # node.run_state['boxcutter_sonatype']['nexus_repository']['admin_username'] = nexus_admin_username |
| 348 | + # node.run_state['boxcutter_sonatype']['nexus_repository']['admin_password'] = nexus_admin_password |
| 349 | + # |
| 350 | + # include_recipe 'boxcutter_sonatype::default' |
336 | 351 |
|
337 | 352 | # node['boxcutter_docker']['buildkits']['x86_64_builder'] = { |
338 | 353 | # 'name' => 'x86-64-builder', |
|
0 commit comments