diff --git a/Vagrantfile b/Vagrantfile index e570201c..1a24ac07 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -1,22 +1,21 @@ #!/usr/bin/env ruby - SERVERS = [ - "backup-server", + {:name => "backup-server", :codename => "noble"}, {:name => "bugs", :codename => "jammy", :ports => [8080]}, - "buildbot", + {:name => "buildbot", :codename => "noble"}, "cdn-logs", - {:name => "codespeed", :codename => "jammy"}, - {:name => "consul", :codename => "jammy"}, - "docs", - "downloads", - "hg", - {:name => "loadbalancer", :ports => [20000, 20001, 20002, 20003, 20004, 20005, 20010]}, - "mail", + {:name => "codespeed", :codename => "noble"}, + {:name => "consul", :codename => "noble"}, + {:name => "docs", :codename => "noble"}, + {:name => "downloads", :codename => "noble"}, + {:name => "hg", :codename => "noble"}, + {:name => "loadbalancer", :codename => "noble", :ports => [20000, 20001, 20002, 20003, 20004, 20005, 20010]}, + {:name => "mail", :codename => "noble"}, "moin", - "planet", - "pypy-web", - "pythontest", + {:name => "planet", :codename => "noble"}, + {:name => "pypy-web", :codename => "noble"}, + {:name => "pythontest", :codename => "noble"}, ] SUBNET1 = "192.168.50" @@ -40,7 +39,7 @@ Vagrant.configure("2") do |config| config.vm.define "salt-master" do |s_config| s_config.vm.provider "docker" do |docker, override| docker.build_dir = "dockerfiles" - docker.dockerfile = "Dockerfile.jammy" + docker.dockerfile = "Dockerfile.noble" end s_config.vm.hostname = "salt-master.vagrant.psf.io" diff --git a/salt/base/config/sources.list.jinja b/salt/base/config/sources.list.jinja index 5146671e..a0bb4474 100644 --- a/salt/base/config/sources.list.jinja +++ b/salt/base/config/sources.list.jinja @@ -4,6 +4,8 @@ {% set base_repo = "us.archive.ubuntu.com/ubuntu/" %} {% endif %} +{# 24.04 Noble is the first to use /etc/apt/sources.list.d/ubuntu.list instead of 'sources.list' #} +{% if grains["oscodename"] != "noble" %} ###### Ubuntu Main Repos deb http://{{ base_repo }} {{ grains["oscodename"] }} main restricted universe deb-src http://{{ base_repo }} {{ grains["oscodename"] }} main restricted universe @@ -13,3 +15,4 @@ deb http://{{ base_repo }} {{ grains["oscodename"] }}-security main restricted u deb http://{{ base_repo }} {{ grains["oscodename"] }}-updates main restricted universe deb-src http://{{ base_repo }} {{ grains["oscodename"] }}-security main restricted universe deb-src http://{{ base_repo }} {{ grains["oscodename"] }}-updates main restricted universe +{% endif %} \ No newline at end of file diff --git a/salt/base/repo.sls b/salt/base/repo.sls index fc8665e7..a646f554 100644 --- a/salt/base/repo.sls +++ b/salt/base/repo.sls @@ -1,4 +1,4 @@ -{% if grains["oscodename"] in ["jammy", "focal"] %} +{% if grains["oscodename"] in ["jammy", "noble"] %} psfkey: file.managed: - name: /etc/apt/keyrings/packagecloud.asc diff --git a/salt/buildbot/init.sls b/salt/buildbot/init.sls index 26292f66..f548c28a 100644 --- a/salt/buildbot/init.sls +++ b/salt/buildbot/init.sls @@ -49,6 +49,16 @@ buildbot-user: - user: buildbot-user - file: /srv +{# vagrant up fails due to this file not existing (see: https://github.com/python/psf-salt/pull/367#issuecomment-2218636563) #} +/srv/buildbot/master/twistd.log: + file.managed: + - user: buildbot + - group: buildbot + - mode: "0644" + - replace: False + - require: + - git: /srv/buildbot + update-master: cmd.run: - runas: buildbot diff --git a/salt/haproxy/config/haproxy.cfg.jinja b/salt/haproxy/config/haproxy.cfg.jinja index 00f24836..cc51f668 100644 --- a/salt/haproxy/config/haproxy.cfg.jinja +++ b/salt/haproxy/config/haproxy.cfg.jinja @@ -65,7 +65,6 @@ defaults balance roundrobin timeout connect 5000 - timeout client 50000 timeout server 50000 monitor-uri /_haproxy_status @@ -121,7 +120,6 @@ frontend main capture request header X-Forwarded-For len 64 acl letsencrypt-well-known-acl path_beg /.well-known/acme-challenge/ - use_backend letsencrypt-well-known if letsencrypt-well-known-acl # Determine if this request has TLS on the client side or not. acl is_tls dst_port 19001 @@ -141,6 +139,8 @@ frontend main # Redirect all HTTP traffic to HTTPS redirect code 301 scheme https if !is_tls !letsencrypt-well-known-acl + use_backend letsencrypt-well-known if letsencrypt-well-known-acl + # Dispatch to the redirect backend for any redirects we have, we're going # to do this here after the HTTP -> HTTPS redirect even though this will # result in an extra redirect because we want to give this domain a chance @@ -214,7 +214,25 @@ backend redirect {% for service, config in haproxy.services.items() %} backend {{ service }} {% if config.get("check") -%} + {% if grains["oscodename"] != "noble" -%} option httpchk {{ config.check }} + {%- else -%} + # Noble Config using the newer http-check syntax + # We need to split the check into parts to handle the extra things + # ...maybe there is a better way to do this? + {% set check_parts = config.check.split(' ', 2) -%} + {% set method = check_parts[0] -%} + {% set path = check_parts[1] -%} + {% if check_parts|length > 2 -%} + {% set extra = check_parts[2].split('\r\n') -%} + {% set version = extra[0] -%} + {% set headers = extra[1:] -%} + {% endif -%} + http-check send meth {{ method }} uri {{ path }} ver {{ version }} + {%- for header in headers %} + http-check send hdr {{ header.replace(':\\ ', ': ') }} + {%- endfor %} + {%- endif %} {%- endif %} # http://gnuterrypratchett.com/ diff --git a/salt/hg/config/repos.conf b/salt/hg/config/repos.conf index 52c4b52c..9ce46f3e 100644 --- a/salt/hg/config/repos.conf +++ b/salt/hg/config/repos.conf @@ -6,7 +6,7 @@ git = 1 showfunc = 1 [web] -llow_archive = gz, zip, bz2 +allow_archive = gz, zip, bz2 collapse = True contact = - descend = True @@ -15,5 +15,5 @@ logourl = https://hg.python.org pygments_style = default style = hgpythonorg -[extensions] -hgext.highlight = +; [extensions] +; hgext.highlight = diff --git a/salt/hg/files/hg/wsgi/python.wsgi b/salt/hg/files/hg/wsgi/python.wsgi index b1eb056d..5632caaf 100644 --- a/salt/hg/files/hg/wsgi/python.wsgi +++ b/salt/hg/files/hg/wsgi/python.wsgi @@ -3,4 +3,4 @@ from mercurial import encoding CONFIG = '/srv/hg/repos.conf' encoding.encoding = 'utf-8' -application = hgwebdir(CONFIG) +application = hgwebdir(CONFIG.encode()) diff --git a/salt/hg/init.sls b/salt/hg/init.sls index fe4cc1de..ad2e9b38 100644 --- a/salt/hg/init.sls +++ b/salt/hg/init.sls @@ -158,7 +158,7 @@ apache2: pkg.installed: - pkgs: - apache2 - - libapache2-mod-wsgi + - libapache2-mod-wsgi-py3 service.running: - enable: True - reload: True