Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Ansible and Vagrant for Debian 12 #279

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ansible/roles/brozzler-dashboard/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
name: '{{brozzler_pip_name}}[dashboard]'
virtualenv: '{{venv_root}}/brozzler-dashboard-ve3'
virtualenv_python: python3
virtualenv_command: python3 /usr/lib/python3/dist-packages/virtualenv.py
virtualenv_command: python3 -mvirtualenv
extra_args: '--no-input --upgrade --pre --cache-dir=/tmp/pip-cache'
become: true
become_user: '{{user}}'
Expand Down
23 changes: 7 additions & 16 deletions ansible/roles/brozzler-worker/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,15 @@
---
- name: ensure canonical partner repo is in apt sources.list
apt_repository: repo='deb http://archive.canonical.com/ubuntu trusty partner'
state=present
become: true

- apt: update_cache=yes
become: true

- name: ensure required packages are installed
become: true
apt: name={{item}} state=present
with_items:
- chromium-browser
- vnc4server
- libjpeg-turbo8-dev
- chromium
- tigervnc-standalone-server
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vnc4server has a proprietary license so I switched over to tigervnc which is in the main repositories.

- libjpeg62-turbo-dev
- zlib1g-dev
- gcc
- python3-dev
- python3-dbg
- adobe-flashplugin
- xfonts-base
- fonts-arphic-bkai00mp
- fonts-arphic-bsmi00lp
Expand Down Expand Up @@ -60,7 +51,7 @@
file: path={{venv_root}}/websockify-ve3 state=directory owner={{user}}

#get python3 version for checks below
- shell: "python --version"
- shell: "python3 --version"
register: python_installed

#websockify's dependency numpy's latest version no longer supports 3.5
Expand All @@ -69,7 +60,7 @@
name: numpy==1.18.4
virtualenv: '{{venv_root}}/websockify-ve3'
virtualenv_python: python3
virtualenv_command: python3 /usr/lib/python3/dist-packages/virtualenv.py
virtualenv_command: python3 -mvirtualenv
extra_args: '--no-input --upgrade --pre --cache-dir=/tmp/pip-cache'
become: true
become_user: '{{user}}'
Expand All @@ -80,7 +71,7 @@
name: git+https://github.com/kanaka/websockify.git#egg=websockify
virtualenv: '{{venv_root}}/websockify-ve3'
virtualenv_python: python3
virtualenv_command: python3 /usr/lib/python3/dist-packages/virtualenv.py
virtualenv_command: python3 -mvirtualenv
extra_args: '--no-input --upgrade --pre --cache-dir=/tmp/pip-cache'
become: true
become_user: '{{user}}'
Expand All @@ -103,7 +94,7 @@
name: '{{brozzler_pip_name}}'
virtualenv: '{{venv_root}}/brozzler-ve3'
virtualenv_python: python3
virtualenv_command: python3 /usr/lib/python3/dist-packages/virtualenv.py
virtualenv_command: python3 -mvirtualenv
extra_args: '--no-input --upgrade --pre --cache-dir=/tmp/pip-cache'
become: true
become_user: '{{user}}'
Expand Down
6 changes: 3 additions & 3 deletions ansible/roles/brozzler-worker/templates/Xvnc-run.j2
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ logfile=/var/log/Xvnc.log
touch $logfile
chown {{user}} $logfile

exec nice setuidgid {{user}} Xvnc4 :1 -auth /tmp/Xauthority.{{user}} \
-geometry 1600x1000 -depth 24 -rfbwait 0 -nolisten tcp -rfbport 5901 \
-SecurityTypes None -pn -fp /usr/share/fonts/X11/misc/ -co /etc/X11/rgb \
exec nice setuidgid {{user}} Xvnc :1 -auth /tmp/Xauthority.{{user}} \
-geometry 1600x1000 -depth 24 -nolisten tcp -rfbport 5901 \
-SecurityTypes None -pn -fp /usr/share/fonts/X11/misc/ \
AcceptCutText=0 AcceptPointerEvents=0 AcceptKeyEvents=0 \
>> $logfile 2>&1

4 changes: 2 additions & 2 deletions ansible/roles/common/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
changed_when: false

- name: ensure service user {{user}} exists
user: name={{user}} system=yes createhome=no home=/nonexistent
user: name={{user}} system=yes createhome=yes home=/home/{{user}}
Copy link
Author

@insom insom Jun 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This user does actually have to exist, as {{user}} is used later in the warcproxy playbook. The only reason this didn't error before is because /home/vagrant is created by default by Vagrant itself. (I wasn't running inside Vagrant though, so I hit this).

shell=/usr/sbin/nologin
become: true
when: id_user|failed
when: id_user.rc != 0
Copy link
Author

@insom insom Jun 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the style suggested by the Ansible docs, although #218 suggests is failed which is nicer to read? |failed filter definitely does not work any longer.

4 changes: 2 additions & 2 deletions ansible/roles/pywb/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
version: 0.33.2
virtualenv: '{{venv_root}}/pywb-ve3'
virtualenv_python: python3
virtualenv_command: python3 /usr/lib/python3/dist-packages/virtualenv.py
virtualenv_command: python3 -mvirtualenv
extra_args: '--no-input --upgrade --pre --cache-dir=/tmp/pip-cache'
become: true
become_user: '{{user}}'
Expand All @@ -22,7 +22,7 @@
name: '{{brozzler_pip_name}}'
virtualenv: '{{venv_root}}/pywb-ve3'
virtualenv_python: python3
virtualenv_command: python3 /usr/lib/python3/dist-packages/virtualenv.py
virtualenv_command: python3 -mvirtualenv
extra_args: '--no-input --upgrade --pre --cache-dir=/tmp/pip-cache'
become: true
become_user: '{{user}}'
Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/pywb/templates/pywb-run.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ touch $logfile
chown {{user}} $logfile

exec nice setuidgid {{user}} env PYWB_CONFIG_FILE=/etc/pywb.yml \
{{venv_root}}/pywb-ve3/bin/python {{venv_root}}/pywb-ve3/bin/brozzler-wayback \
{{venv_root}}/pywb-ve3/bin/python3 {{venv_root}}/pywb-ve3/bin/brozzler-wayback \
>> $logfile 2>&1

2 changes: 1 addition & 1 deletion ansible/roles/rethinkdb/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
become: true
- name: ensure rethinkdb repo is in apt sources.list
apt_repository:
repo: 'deb https://download.rethinkdb.com/repository/ubuntu-{{ansible_lsb.codename|lower}} {{ansible_lsb.codename|lower}} main'
repo: 'deb https://download.rethinkdb.com/repository/{{ansible_distribution|lower}}-{{ansible_lsb.codename|lower}} {{ansible_lsb.codename|lower}} main'
state: present
become: true
- apt: update_cache=yes
Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/warcprox/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
virtualenv: '{{venv_root}}/warcprox-ve3'
virtualenv_python: python3
extra_args: --no-input --upgrade --pre --cache-dir=/tmp/pip-cache
virtualenv_command: python3 /usr/lib/python3/dist-packages/virtualenv.py
virtualenv_command: python3 -mvirtualenv
become: true
become_user: '{{user}}'
notify:
Expand Down
2 changes: 1 addition & 1 deletion vagrant/Vagrantfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/xenial64"
config.vm.box = "generic/debian12"
config.vm.define "10.9.9.9"
config.vm.hostname = "brzl"
config.vm.network :private_network, ip: "10.9.9.9"
Expand Down