Chad has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/356499 )
Change subject: Gerrit: Add non-masters to have public DNS entries ...................................................................... Gerrit: Add non-masters to have public DNS entries This way, you can have public & private slaves. Public slaves get nice DNS entries that aren't the standard hostname Change-Id: I4ce94cb92d959d2598b2e338a11f0f5a1b4a239d --- M hieradata/role/common/gerrit/server.yaml M modules/gerrit/manifests/init.pp M modules/gerrit/manifests/proxy.pp M modules/gerrit/templates/gerrit.wikimedia.org.erb M modules/profile/manifests/gerrit/server.pp 5 files changed, 27 insertions(+), 15 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/99/356499/1 diff --git a/hieradata/role/common/gerrit/server.yaml b/hieradata/role/common/gerrit/server.yaml index 4b42a98..5af2d48 100644 --- a/hieradata/role/common/gerrit/server.yaml +++ b/hieradata/role/common/gerrit/server.yaml @@ -6,6 +6,8 @@ value: standard gerrit::server::host: 'gerrit.wikimedia.org' +gerrit::server::slave_hosts: + - 'gerrit.wikimedia.org' gerrit::server::master_host: 'cobalt.wikimedia.org' gerrit::server::bacula: 'srv-gerrit-git' diff --git a/modules/gerrit/manifests/init.pp b/modules/gerrit/manifests/init.pp index 5339aca..47a157a 100644 --- a/modules/gerrit/manifests/init.pp +++ b/modules/gerrit/manifests/init.pp @@ -1,6 +1,7 @@ # Manifest to setup a Gerrit instance class gerrit( $host, + $slave_hosts = [], $slave = false, ) { @@ -8,11 +9,12 @@ slave => $slave, } - if !$slave { - class { '::gerrit::proxy': - require => Class['gerrit::jetty'], - } + class { '::gerrit::proxy': + require => Class['gerrit::jetty'], + slave_hosts => $slave_hosts, + } + if !$slave { class { '::gerrit::crons': require => Class['gerrit::jetty'], } diff --git a/modules/gerrit/manifests/proxy.pp b/modules/gerrit/manifests/proxy.pp index b055e5c..ea32251 100644 --- a/modules/gerrit/manifests/proxy.pp +++ b/modules/gerrit/manifests/proxy.pp @@ -1,5 +1,6 @@ class gerrit::proxy( $host = $::gerrit::host, + $slave_hosts = [], $maint_mode = false, ) { diff --git a/modules/gerrit/templates/gerrit.wikimedia.org.erb b/modules/gerrit/templates/gerrit.wikimedia.org.erb index 1a564c7..7e829e8 100644 --- a/modules/gerrit/templates/gerrit.wikimedia.org.erb +++ b/modules/gerrit/templates/gerrit.wikimedia.org.erb @@ -11,6 +11,9 @@ <VirtualHost *:80> ServerAdmin n...@wikimedia.org ServerName <%= @host %> + <%- if @slave_hosts -%> + ServerAlias <%= Array(@slave_hosts).join(' ') %> + <%- else -%> DocumentRoot /var/www <Directory /> @@ -41,6 +44,10 @@ <VirtualHost *:443> ServerAdmin n...@wikimedia.org ServerName <%= @host %> + <%- if @slave_hosts -%> + ServerAlias <%= Array(@slave_hosts).join(' ') %> + <%- else -%> + # https://httpoxy.org/ RequestHeader unset Proxy early diff --git a/modules/profile/manifests/gerrit/server.pp b/modules/profile/manifests/gerrit/server.pp index 7ef290b..9a4e064 100644 --- a/modules/profile/manifests/gerrit/server.pp +++ b/modules/profile/manifests/gerrit/server.pp @@ -5,6 +5,7 @@ $ipv4 = hiera('gerrit::service::ipv4'), $ipv6 = hiera('gerrit::service::ipv6'), $host = hiera('gerrit::server::host'), + $slave_hosts = hiera('gerrit::server::slave_hosts'), $master_host = hiera('gerrit::server::master_host'), $bacula = hiera('gerrit::server::bacula'), $gerrit_servers = join(hiera('gerrit::servers'), ' ') @@ -46,16 +47,14 @@ srange => "(@resolve((${gerrit_servers})) @resolve((${gerrit_servers}), AAAA))", } - if !$slave { - ferm::service { 'gerrit_http': - proto => 'tcp', - port => 'http', - } + ferm::service { 'gerrit_http': + proto => 'tcp', + port => 'http', + } - ferm::service { 'gerrit_https': - proto => 'tcp', - port => 'https', - } + ferm::service { 'gerrit_https': + proto => 'tcp', + port => 'https', } if $bacula != undef and !$slave { @@ -63,7 +62,8 @@ } class { '::gerrit': - host => $host, - slave => $slave, + host => $host, + slave => $slave, + slave_hosts => $slave_hosts, } } -- To view, visit https://gerrit.wikimedia.org/r/356499 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4ce94cb92d959d2598b2e338a11f0f5a1b4a239d Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Chad <ch...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits