From 846ecaa231fc22b6efe99d5257ec2113e7891424 Mon Sep 17 00:00:00 2001 From: Sven-Hendrik Haase <svenstaro@gmail.com> Date: Mon, 18 Nov 2019 07:47:44 +0100 Subject: [PATCH] Migrate public_html to homedir.archlinux.org --- archlinux.tf | 20 +++++++++++ host_vars/homedir.archlinux.org | 8 +++++ hosts | 1 + playbooks/homedir.archlinux.org.yml | 15 ++++++++ .../templates/generate-public_html.j2 | 34 +++++-------------- 5 files changed, 52 insertions(+), 26 deletions(-) create mode 100644 host_vars/homedir.archlinux.org create mode 100644 playbooks/homedir.archlinux.org.yml diff --git a/archlinux.tf b/archlinux.tf index 42ad66ef7..f1643ba3b 100644 --- a/archlinux.tf +++ b/archlinux.tf @@ -137,3 +137,23 @@ resource "hcloud_server" "mirror" { } } +resource "hcloud_rdns" "homedir" { + server_id = hcloud_server.homedir.id + ip_address = hcloud_server.homedir.ipv4_address + dns_ptr = "homedir.archlinux.org" +} + +resource "hcloud_server" "homedir" { + name = "homedir.archlinux.org" + image = data.hcloud_image.archlinux.id + server_type = "cx11" + lifecycle { + ignore_changes = [image] + } +} + +resource "hcloud_volume" "homedir" { + name = "homedir" + size = 100 + server_id = hcloud_server.homedir.id +} diff --git a/host_vars/homedir.archlinux.org b/host_vars/homedir.archlinux.org new file mode 100644 index 000000000..cd48b49b5 --- /dev/null +++ b/host_vars/homedir.archlinux.org @@ -0,0 +1,8 @@ +--- +filesystem: btrfs +zabbix_agent_templates: + - Template OS Linux + - Template App Borg Backup + - Template App HTTP Service + - Template App HTTPS Service + - Template App Nginx diff --git a/hosts b/hosts index 12b04495d..90e8afaa1 100644 --- a/hosts +++ b/hosts @@ -40,6 +40,7 @@ matrix.archlinux.org quassel.archlinux.org phrik.archlinux.org bbs.archlinux.org +homedir.archlinux.org [mysql_servers] apollo.archlinux.org diff --git a/playbooks/homedir.archlinux.org.yml b/playbooks/homedir.archlinux.org.yml new file mode 100644 index 000000000..13cee6fed --- /dev/null +++ b/playbooks/homedir.archlinux.org.yml @@ -0,0 +1,15 @@ +--- + +- name: setup homedir.archlinux.org + hosts: homedir.archlinux.org + remote_user: root + roles: + - { role: common } + - { role: tools } + - { role: sshd } + - { role: root_ssh } + - { role: certbot } + - { role: nginx } + - { role: archusers } + - { role: public_html, public_domain: "pkgbuild.com", tags: ['public_html', 'nginx'] } + - { role: borg-client, tags: ["borg"] } diff --git a/roles/public_html/templates/generate-public_html.j2 b/roles/public_html/templates/generate-public_html.j2 index 5670b4bb9..eddebc15c 100755 --- a/roles/public_html/templates/generate-public_html.j2 +++ b/roles/public_html/templates/generate-public_html.j2 @@ -7,7 +7,7 @@ cat >${target}.tmp <<END "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> - <title>{{ ansible_nodename }}</title> + <title>pkgbuild.com</title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="/static/archweb.css" media="screen" /> <link rel="icon" type="image/x-icon" href="/static/favicon.ico" /> @@ -18,36 +18,18 @@ cat >${target}.tmp <<END <div id="archnavbarlogo"> <p><a href="http://www.archlinux.org/" title="Arch news, packages, projects and more"></a></p> </div> - <div id="archnavbarmenu"> - <ul id="archnavbarlist"> - <li id="anb-home"><a href="http://www.archlinux.org/" title="Arch news, packages, projects and more">Home</a></li> - <li id="anb-packages"><a href="http://www.archlinux.org/packages/" title="Arch Package Database">Packages</a></li> - <li id="anb-forums"><a href="https://bbs.archlinux.org/" title="Community forums">Forums</a></li> - <li id="anb-wiki"><a href="https://wiki.archlinux.org/" title="Community documentation">Wiki</a></li> - <li id="anb-bugs"><a href="https://bugs.archlinux.org/" title="Report and follow bugs">Bugs</a></li> - <li id="anb-aur"><a href="https://aur.archlinux.org/" title="Arch Linux User Repository">AUR</a></li> - <li id="anb-download"><a href="http://www.archlinux.org/download/" title="Get Arch Linux">Download</a></li> - </ul> - </div> - </div><!-- #archnavbar --> + </div> <div id="content"> <div id="archdev-navbar"> </div> <div id="content-left-wrapper"> <div id="content-left"> <div id="intro" class="box"> - <h2>Build server</h2> - <p>This is an {{ ansible_processor[2] }} server with {{ ansible_memtotal_mb }} MB of memory.</p> - <p> - This machine is meant for building packages for Arch Linux distribution. - The server is paid from donations and is available to all Trusted Users and Developers. - </p> - <p>It runs Arch Linux and packages are built in clean chroots using devtools.</p> - </div><!-- #intro --> - <div id="news"> - <!-- <h3>Some text1</h3> #optional for news--> - </div> <!-- #news --> - </div><!-- #content_left --> + <h2>Public HTML server</h2> + <p>This machine allows Arch Linux staff to make files and web documents available publicly.</p> + <p>The server is paid from <a href="https://www.archlinux.org/donate/" alt="Pls donate we need bigger servers">donations</a> (â¤ï¸) and is available to all Trusted Users and Developers.</p> + </div> + </div> </div> <div id="content-right"> <div id="pkg-updates" class="widget box"> @@ -67,7 +49,7 @@ cat >>${target}.tmp <<END </div> <div id="footer"> <p> - Copyright © 2002-2016 + Copyright © 2002-{{ '%Y' | strftime }} <a href="mailto:jvinet@zeroflux.org" title="Contact Judd Vinet">Judd Vinet</a> and <a href="mailto:aaron@archlinux.org" title="Contact Aaron Griffin">Aaron Griffin</a>. </p> -- GitLab