]> git.openstreetmap.org Git - chef.git/commitdiff
Switch birthday20 to a static container
authorGrant Slater <github@firefishy.com>
Sun, 15 Sep 2024 03:14:09 +0000 (04:14 +0100)
committerGrant Slater <github@firefishy.com>
Sun, 15 Sep 2024 03:17:31 +0000 (04:17 +0100)
.github/workflows/test-kitchen.yml
.kitchen.yml
cookbooks/blog/recipes/birthday.rb [deleted file]
cookbooks/blog/templates/default/backup-birthday20.cron.erb [deleted file]
cookbooks/foundation/recipes/birthday.rb [new file with mode: 0644]
roles/birthday20.rb [deleted file]
roles/fume.rb
roles/naga.rb

index 7e738b38bc1c5c7e964a7e83d4946d1644ba76dd..c079240ccc6993fd2e106b18bd3cf9d90f0098d2 100644 (file)
@@ -43,6 +43,7 @@ jobs:
           - elasticsearch
           - exim
           - fail2ban
+          - foundation-birthday
           - foundation-board
           - foundation-dwg
           - foundation-mastodon
index 805d15b74f2579a538b4417118abc128026316a5..0af8c80de62de90e1df5ccd2585191c9e946e4db 100644 (file)
@@ -163,6 +163,9 @@ suites:
   - name: fail2ban
     run_list:
       - recipe[fail2ban::default]
+  - name: foundation-birthday
+    run_list:
+      - recipe[foundation::birthday]
   - name: foundation-board
     run_list:
       - recipe[foundation::board]
diff --git a/cookbooks/blog/recipes/birthday.rb b/cookbooks/blog/recipes/birthday.rb
deleted file mode 100644 (file)
index f581c86..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-#
-# Cookbook:: blog
-# Recipe:: birthday
-#
-# Copyright:: 2024, OpenStreetMap Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     https://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-include_recipe "wordpress"
-
-passwords = data_bag_item("birthday20", "passwords")
-# wp2fa_encrypt_keys = data_bag_item("birthday20", "wp2fa_encrypt_keys")
-
-directory "/srv/birthday20.openstreetmap.org" do
-  owner "wordpress"
-  group "wordpress"
-  mode "755"
-end
-
-# wordpress_site "birthday20.openstreetmap.org" do
-#   aliases ["birthday20.osm.org", "birthday20.openstreetmap.com",
-#            "birthday20.openstreetmap.net", "birthday20.openstreetmaps.org"]
-#   directory "/srv/birthday20.openstreetmap.org/wp"
-#   database_name "osm-birthday20"
-#   database_user "osm-birthday20-user"
-#   database_password passwords["osm-birthday20-user"]
-#   wp2fa_encrypt_key wp2fa_encrypt_keys["key"]
-#   fpm_prometheus_port 11403
-# end
-
-# wordpress_plugin "birthday20.openstreetmap.org-shareadraft" do
-#   action :delete
-#   plugin "shareadraft"
-#   site "birthday20.openstreetmap.org"
-# end
-
-# wordpress_plugin "birthday20.openstreetmap.org-public-post-preview" do
-#   plugin "public-post-preview"
-#   site "birthday20.openstreetmap.org"
-# end
-
-template "/etc/cron.daily/birthday20-backup" do
-  source "backup-birthday20.cron.erb"
-  owner "root"
-  group "root"
-  mode "750"
-  variables :passwords => passwords
-end
-
-ssl_certificate "birthday20.openstreetmap.org" do
-  domains ["birthday20.openstreetmap.org", "birthday20.osm.org", "birthday20.openstreetmap.com",
-           "birthday20.openstreetmap.net", "birthday20.openstreetmaps.org"]
-end
diff --git a/cookbooks/blog/templates/default/backup-birthday20.cron.erb b/cookbooks/blog/templates/default/backup-birthday20.cron.erb
deleted file mode 100644 (file)
index fbc633f..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/sh
-
-# DO NOT EDIT - This file is being maintained by Chef
-
-T=$(mktemp -d -t -p /var/tmp osm-birthday20.XXXXXXXXXX)
-D=$(date +%Y-%m-%d)
-B=osm-birthday20-$D.tar.gz
-
-mkdir $T/osm-birthday20-$D
-echo '[mysqldump]' > $T/mysqldump.opts
-echo 'user=osm-birthday20-user' >> $T/mysqldump.opts
-echo 'password=<%= @passwords["osm-birthday20-user"] %>' >> $T/mysqldump.opts
-mysqldump --defaults-file=$T/mysqldump.opts --opt --no-tablespaces osm-birthday20 > $T/osm-birthday20-$D/osm-birthday20.sql
-ln -s /srv/birthday20.openstreetmap.org $T/osm-birthday20-$D/www
-
-export RSYNC_RSH="ssh -ax"
-
-nice tar --create --dereference --directory=$T --warning=no-file-changed osm-birthday20-$D | nice gzip --rsyncable -9 > $T/$B
-nice rsync --preallocate --fuzzy $T/$B backup.openstreetmap.org::backup
-
-rm -rf $T
diff --git a/cookbooks/foundation/recipes/birthday.rb b/cookbooks/foundation/recipes/birthday.rb
new file mode 100644 (file)
index 0000000..3f70775
--- /dev/null
@@ -0,0 +1,26 @@
+#
+# Cookbook:: foundation
+# Recipe:: birthday
+#
+# Copyright:: 2024, OpenStreetMap Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+include_recipe "podman::apache"
+
+podman_site "birthday20.openstreetmap.org" do
+  image "ghcr.io/openstreetmap/birthday20-website:latest"
+  aliases ["birthday20.osm.org", "birthday20.openstreetmap.com",
+           "birthday20.openstreetmap.net", "birthday20.openstreetmaps.org"]
+end
diff --git a/roles/birthday20.rb b/roles/birthday20.rb
deleted file mode 100644 (file)
index a1b9191..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-name "birthday20"
-description "Role applied to birthday20 servers"
-
-default_attributes(
-  :accounts => {
-    :users => {
-      :mikel => { :status => :administrator },
-      :wordpress => {
-        :status => :role,
-        :members => [:mikel]
-      }
-    },
-  }
-)
-
-run_list(
-  "recipe[blog::birthday]"
-)
index 6af2333b4d6de6ef766451a3a56843c001eacd31..5b4c5a670ac12ea6d5d06a36866e2c5be272fe44 100644 (file)
@@ -33,6 +33,5 @@ default_attributes(
 
 run_list(
   "role[equinix-dub]",
-  "role[blog-staging]",
-  "role[birthday20]"
+  "role[blog-staging]"
 )
index 4026bcac7e0ec874c1153b8935c559f60666c874..da7d39cd81d1ac5366e52a3d3b8c34ab58be68bf 100644 (file)
@@ -39,6 +39,7 @@ run_list(
   "role[irc]",
   "role[blogs]",
   "role[switch2osm]",
+  "recipe[foundation::birthday]",
   "recipe[foundation::mastodon]",
   "recipe[foundation::owg]",
   "recipe[foundation::welcome]",