aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Tuomi <jan@jantuomi.fi>2026-06-06 22:52:57 +0300
committerJan Tuomi <jan@jantuomi.fi>2026-06-06 22:52:57 +0300
commitfc1d79968a811c83f83429734c9adec14c46711b (patch)
treee456fda9ec491b35b28e91e2cdcdf1beff2e91b6
parent224ef25da57b0957f190ca2e2e3bd0045792cdb8 (diff)
Work on jails
-rw-r--r--roles/host/tasks/main.yml5
-rw-r--r--roles/jail/templates/jail_conf.j21
-rw-r--r--roles/jails/02_postgres/defaults/main.yml2
-rw-r--r--roles/jails/03_irc_thelounge/defaults/main.yml2
-rw-r--r--roles/jails/04_taulubot/defaults/main.yml2
-rw-r--r--roles/jails/04_taulubot/tasks/main.yml37
-rw-r--r--roles/jails/05_homepage/defaults/main.yml2
-rw-r--r--roles/jails/06_hommabot/defaults/main.yml2
-rw-r--r--roles/jails/06_hommabot/tasks/main.yml8
-rw-r--r--roles/jails/07_aggro/defaults/main.yml2
-rw-r--r--roles/jails/08_diddle/defaults/main.yml2
-rw-r--r--roles/jails/11_spliit/defaults/main.yml2
-rw-r--r--roles/jails/14_freshrss/defaults/main.yml2
-rw-r--r--roles/jails/15_paste/defaults/main.yml2
14 files changed, 31 insertions, 40 deletions
diff --git a/roles/host/tasks/main.yml b/roles/host/tasks/main.yml
index aec0054..3608499 100644
--- a/roles/host/tasks/main.yml
+++ b/roles/host/tasks/main.yml
@@ -83,7 +83,8 @@
if [ ! -d /usr/ports/.git ]; then
git clone --depth 1 https://github.com/jantuomi/freebsd-ports.git /usr/ports
else
- git -C /usr/ports pull --ff-only
+ git -C /usr/ports fetch origin
+ git -C /usr/ports reset --hard origin/main
fi
register: _ports_fetch
changed_when: "'Already up to date' not in _ports_fetch.stdout"
@@ -148,7 +149,7 @@
label: "{{ item.name }}"
- name: Install custom ports
- shell: cd /usr/ports/{{ item }} && make install
+ shell: cd /usr/ports/{{ item }} && make install WRKDIRPREFIX=/tmp/ports DISTDIR=/tmp/distfiles
loop:
- sysutils/pylogsentinel
register: _port_install
diff --git a/roles/jail/templates/jail_conf.j2 b/roles/jail/templates/jail_conf.j2
index 7ce1b1b..68a7c21 100644
--- a/roles/jail/templates/jail_conf.j2
+++ b/roles/jail/templates/jail_conf.j2
@@ -53,6 +53,7 @@
exec.prestart += "mount -t nullfs {{ mount.src }} /usr/local/jails/containers/{{ jail.name }}{{ mount.dst }} || true";
exec.poststop += "umount /usr/local/jails/containers/{{ jail.name }}{{ mount.dst }} || true";
{% endfor %}
+ exec.prestart += "mkdir -p /usr/local/jails/containers/{{ jail.name }}/usr/ports";
exec.prestart += "mount -t nullfs -o ro /usr/ports /usr/local/jails/containers/{{ jail.name }}/usr/ports || true";
exec.poststop += "umount /usr/local/jails/containers/{{ jail.name }}/usr/ports || true";
}
diff --git a/roles/jails/02_postgres/defaults/main.yml b/roles/jails/02_postgres/defaults/main.yml
index ec54e55..c2335af 100644
--- a/roles/jails/02_postgres/defaults/main.yml
+++ b/roles/jails/02_postgres/defaults/main.yml
@@ -1,4 +1,4 @@
-userland: "14.3-RELEASE"
+userland: "15.0-RELEASE"
devfs_ruleset: 5
jail_conf_options:
diff --git a/roles/jails/03_irc_thelounge/defaults/main.yml b/roles/jails/03_irc_thelounge/defaults/main.yml
index f95b32e..0b2f809 100644
--- a/roles/jails/03_irc_thelounge/defaults/main.yml
+++ b/roles/jails/03_irc_thelounge/defaults/main.yml
@@ -1,4 +1,4 @@
-userland: "14.3-RELEASE"
+userland: "15.0-RELEASE"
pkg:
- npm
diff --git a/roles/jails/04_taulubot/defaults/main.yml b/roles/jails/04_taulubot/defaults/main.yml
index 7220635..e6b2279 100644
--- a/roles/jails/04_taulubot/defaults/main.yml
+++ b/roles/jails/04_taulubot/defaults/main.yml
@@ -1,4 +1,4 @@
-userland: "14.3-RELEASE"
+userland: "15.0-RELEASE"
pkg:
- python311
diff --git a/roles/jails/04_taulubot/tasks/main.yml b/roles/jails/04_taulubot/tasks/main.yml
index 4054161..92624ff 100644
--- a/roles/jails/04_taulubot/tasks/main.yml
+++ b/roles/jails/04_taulubot/tasks/main.yml
@@ -19,34 +19,23 @@
mode: "0600"
no_log: true
-- name: Clone taulubot
+- name: Install taulubot from port
shell: |
- GIT_SSH_COMMAND="ssh -i /root/.ssh/deploy_key -o StrictHostKeyChecking=no" git clone git@github.com:jantuomi/taulubot.git /tmp/taulubot
- cp -a /tmp/taulubot/* /tmp/taulubot/.git /tmp/taulubot/.gitignore /usr/local/taulubot/ 2>/dev/null || true
- rm -rf /tmp/taulubot
- args:
- creates: /usr/local/taulubot/.git
+ export GIT_SSH_COMMAND='ssh -i ~/.ssh/deploy_key -o StrictHostKeyChecking=no'
+ cd /usr/ports/net-im/taulubot
+ make install WRKDIRPREFIX=/tmp/ports DISTDIR=/tmp/distfiles
+ register: _taulubot_install
+ failed_when: "_taulubot_install.rc != 0"
+ changed_when: "'Installing taulubot' in _taulubot_install.stdout"
-- name: Install Python dependencies
- shell: pip install -r /usr/local/taulubot/requirements.txt
- args:
- creates: /usr/local/taulubot/.deps_installed
- register: _pip_install
-
-- name: Mark dependencies installed
- file:
- path: /usr/local/taulubot/.deps_installed
- state: touch
- when: _pip_install is changed
-
-- name: Deploy rc.d script
- template:
- src: "{{ jail_role_dir }}/templates/usr_local_etc_rc.d_taulubot"
- dest: /usr/local/etc/rc.d/taulubot
+- name: Deploy bot token file
+ copy:
+ content: "{{ taulubot_token }}"
+ dest: /usr/local/etc/taulubot.token
owner: root
group: wheel
- mode: "0755"
- notify: Restart taulubot
+ mode: "0600"
+ no_log: true
- import_role:
name: jail
diff --git a/roles/jails/05_homepage/defaults/main.yml b/roles/jails/05_homepage/defaults/main.yml
index d48c9fa..ae37077 100644
--- a/roles/jails/05_homepage/defaults/main.yml
+++ b/roles/jails/05_homepage/defaults/main.yml
@@ -1,4 +1,4 @@
-userland: "14.3-RELEASE"
+userland: "15.0-RELEASE"
pkg:
- nginx
diff --git a/roles/jails/06_hommabot/defaults/main.yml b/roles/jails/06_hommabot/defaults/main.yml
index 0b4b4f3..f2c497a 100644
--- a/roles/jails/06_hommabot/defaults/main.yml
+++ b/roles/jails/06_hommabot/defaults/main.yml
@@ -1,4 +1,4 @@
-userland: "14.3-RELEASE"
+userland: "15.0-RELEASE"
pkg:
- node
diff --git a/roles/jails/06_hommabot/tasks/main.yml b/roles/jails/06_hommabot/tasks/main.yml
index 9b1ee5f..d19beb1 100644
--- a/roles/jails/06_hommabot/tasks/main.yml
+++ b/roles/jails/06_hommabot/tasks/main.yml
@@ -3,14 +3,14 @@
tasks_from: jail_setup
- name: Install hommabot from port
- shell: cd /usr/local/my-ports/hommabot && make install
+ shell: cd /usr/ports/net-im/hommabot && make install WRKDIRPREFIX=/tmp/ports DISTDIR=/tmp/distfiles
register: _hommabot_install
- failed_when: "_hommabot_install.rc != 0 and 'already installed' not in _hommabot_install.stdout"
- changed_when: "'already installed' not in _hommabot_install.stdout"
+ failed_when: "_hommabot_install.rc != 0"
+ changed_when: "'Installing hommabot' in _hommabot_install.stdout"
- name: Deploy bot token file
copy:
- content: "{{ hommabot_token }}"
+ content: "{{ hommabot_telegram_bot_token }}"
dest: /usr/local/etc/hommabot.token
owner: root
group: wheel
diff --git a/roles/jails/07_aggro/defaults/main.yml b/roles/jails/07_aggro/defaults/main.yml
index 697ea79..5416267 100644
--- a/roles/jails/07_aggro/defaults/main.yml
+++ b/roles/jails/07_aggro/defaults/main.yml
@@ -1 +1 @@
-userland: "14.3-RELEASE"
+userland: "15.0-RELEASE"
diff --git a/roles/jails/08_diddle/defaults/main.yml b/roles/jails/08_diddle/defaults/main.yml
index 9423bd6..615d6a4 100644
--- a/roles/jails/08_diddle/defaults/main.yml
+++ b/roles/jails/08_diddle/defaults/main.yml
@@ -1,4 +1,4 @@
-userland: "14.3-RELEASE"
+userland: "15.0-RELEASE"
pkg:
- python311
diff --git a/roles/jails/11_spliit/defaults/main.yml b/roles/jails/11_spliit/defaults/main.yml
index 697ea79..5416267 100644
--- a/roles/jails/11_spliit/defaults/main.yml
+++ b/roles/jails/11_spliit/defaults/main.yml
@@ -1 +1 @@
-userland: "14.3-RELEASE"
+userland: "15.0-RELEASE"
diff --git a/roles/jails/14_freshrss/defaults/main.yml b/roles/jails/14_freshrss/defaults/main.yml
index 697ea79..5416267 100644
--- a/roles/jails/14_freshrss/defaults/main.yml
+++ b/roles/jails/14_freshrss/defaults/main.yml
@@ -1 +1 @@
-userland: "14.3-RELEASE"
+userland: "15.0-RELEASE"
diff --git a/roles/jails/15_paste/defaults/main.yml b/roles/jails/15_paste/defaults/main.yml
index 697ea79..5416267 100644
--- a/roles/jails/15_paste/defaults/main.yml
+++ b/roles/jails/15_paste/defaults/main.yml
@@ -1 +1 @@
-userland: "14.3-RELEASE"
+userland: "15.0-RELEASE"