Skip to content

Commit 7d147f1

Browse files
committed
miscweb: Add generic fqdn vhost over 443/HTTPS
Fold miscweb-fqdn back into miscweb-sites so that we don't need another hieradata variable to specify which cert to use for this. This shouldn't change upgrade simplicity because either way we'll need a node hieradata Ref #87.
1 parent f84b4e5 commit 7d147f1

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

hieradata/environments/production/roles/miscweb.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ profile::certbot::certificates:
1818
- bugs.jqueryui.com
1919
- plugins.jquery.com
2020
profile::notifier::tls_key_name: miscweb-fqdn
21+
profile::miscweb::fqdn_certificate: miscweb-fqdn
2122
profile::miscweb::default_certificate: miscweb-sites
2223

2324
profile::miscweb::sites:

modules/profile/manifests/miscweb.pp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
String[1] $default_certificate = lookup('profile::miscweb::default_certificate'),
44
Hash[Stdlib::Fqdn, Profile::Miscweb::Site] $sites = lookup('profile::miscweb::sites'),
55
Hash[Stdlib::Fqdn, Profile::Miscweb::Redirect] $redirects = lookup('profile::miscweb::redirects'),
6+
String[1] $fqdn_certificate = lookup('profile::miscweb::fqdn_certificate'),
67
) {
78
nftables::allow { 'miscweb-https':
89
proto => 'tcp',
@@ -97,4 +98,17 @@
9798
require => Letsencrypt::Certificate[$certificate],
9899
}
99100
}
101+
102+
# Ease host upgrades by defining a generic FQDN vhost over 443/HTTPS
103+
# which we use in Fastly to connect to the origin by FQDN
104+
# https://github.com/jquery/infrastructure-puppet/issues/87
105+
$fqdn = $::facts['networking']['fqdn']
106+
$redirect = {
107+
'target' => 'https://jquery.com',
108+
'mode' => 'root',
109+
}
110+
nginx::site { 'fqdn_redirect':
111+
content => template('profile/miscweb/redirect.nginx.erb'),
112+
require => Letsencrypt::Certificate[$fqdn_certificate],
113+
}
100114
}

0 commit comments

Comments
 (0)