Skip to content

Commit

Permalink
prepare for ubuntu 24.04 (noble)
Browse files Browse the repository at this point in the history
  • Loading branch information
fspv committed Sep 8, 2024
1 parent 2a7fa39 commit c908550
Show file tree
Hide file tree
Showing 26 changed files with 152 additions and 71 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/vagrant-up.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,39 @@ jobs:
- name: Destroy vagrant common-minimal-desktop.yml
run: timeout -k 60 -s 9 60 vagrant destroy -f || true
if: always()

vagrant-user-2404:
runs-on: self-hosted

needs: vagrant-set-up
steps:
- name: Run vagrant user.yml
run: vagrant --os=bento/ubuntu-24.04 --local --playbook=user.yml --headless up

- name: Destroy vagrant user.yml
run: timeout -k 60 -s 9 60 vagrant destroy -f || true
if: always()

vagrant-common-desktop-2404:
runs-on: self-hosted

needs: vagrant-set-up
steps:
- name: Run vagrant common-desktop.yml
run: vagrant --os=bento/ubuntu-24.04 --local --headless up

- name: Destroy vagrant common-desktop.yml
run: timeout -k 60 -s 9 60 vagrant destroy -f || true
if: always()

vagrant-common-minimal-desktop-2404:
runs-on: self-hosted

needs: vagrant-set-up
steps:
- name: Run vagrant common-minimal-desktop.yml
run: vagrant --os=bento/ubuntu-24.04 --local --playbook=common-minimal-desktop.yml --headless up

- name: Destroy vagrant common-minimal-desktop.yml
run: timeout -k 60 -s 9 60 vagrant destroy -f || true
if: always()
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,11 @@ If can't connect bluetooth, run
```
systemctl --user restart wireplumber.service
```

Prepare for the new ubuntu release
==================================

1. Create ponysay backport https://github.com/fspv/ponysay-deb
2. Test all vagrant scenarios locally
3. Test if nix builds
4. wayland apps can't be tested in vagrant, so test them locally if possible
31 changes: 28 additions & 3 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ opts.each do |opt, arg|
end
end

# Example: vagrant --os=ubuntu/jammy64 --playbook=user.yml --local --headless up
# Example:
# * vagrant --os=ubuntu/jammy64 --playbook=user.yml --local --headless up
# * vagrant --os=bento/ubuntu-24.04 --playbook=common-desktop.yml --local up


Vagrant.configure("2") do |config|
Expand Down Expand Up @@ -74,7 +76,17 @@ Vagrant.configure("2") do |config|
sed 's/# //g' roles/user/defaults/main.yml > manual/common.yml
chown -R vagrant .
sudo -u vagrant ./bootstrap.sh #{playbook} LOCAL
for i in {1..3}; do
set +e
sudo -u vagrant ./bootstrap.sh #{playbook} LOCAL && break
set -e
done
if $? -ne 0; then
echo "Failed to provision"
exit 1
fi
apt-get update
apt-get upgrade -y
Expand All @@ -85,6 +97,8 @@ Vagrant.configure("2") do |config|
apt-get update
apt-get upgrade -y
cd /tmp/ && sudo -u user /home/user/.bin/init-user-env.sh
reboot
SHELL
else
Expand All @@ -109,7 +123,16 @@ Vagrant.configure("2") do |config|
sed 's/# //g' roles/user/defaults/main.yml > manual/common.yml
chown -R vagrant .
sudo -u vagrant ./bootstrap.sh #{playbook} REMOTE
for i in {1..3}; do
set +e
sudo -u vagrant ./bootstrap.sh #{playbook} REMOTE && break
set -e
done
if $? -ne 0; then
echo "Failed to provision"
exit 1
fi
apt-get update
apt-get upgrade -y
Expand All @@ -120,6 +143,8 @@ Vagrant.configure("2") do |config|
apt-get update
apt-get upgrade -y
cd /tmp/ && sudo -u user /home/user/.bin/init-user-env.sh
reboot
SHELL
end
Expand Down
2 changes: 1 addition & 1 deletion bootstrap-config.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
BOOTSTRAP_DIR="${HOME}/.local/share/bootstrap"
ANSIBLE_VENV_DIR="${BOOTSTRAP_DIR}/ansible-venv"
ANSIBLE_REPO_DIR="${BOOTSTRAP_DIR}/ansible-repo"
ANSIBLE_VERSION="2.10.7"
ANSIBLE_VERSION="9.9.0"
export PYTHONPATH=""
2 changes: 2 additions & 0 deletions roles/apparmor/meta/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dependencies:
- { role: pkgmanager }
16 changes: 16 additions & 0 deletions roles/apparmor/tasks/configs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
- name: config nix bwrap fix
copy:
content: |
abi <abi/4.0>,
include <tunables/global>
profile bwrap /nix/store/*/bin/bwrap flags=(unconfined) {
userns,
# Site-specific additions and overrides. See local/README for details.
include if exists <local/bwrap>
}
dest: /etc/apparmor.d/bwrap
owner: "root"
mode: 0666
3 changes: 3 additions & 0 deletions roles/apparmor/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- import_tasks: packages.yml
- import_tasks: configs.yml
- import_tasks: services.yml
3 changes: 3 additions & 0 deletions roles/apparmor/tasks/packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- name: package
apt:
name: apparmor
6 changes: 6 additions & 0 deletions roles/apparmor/tasks/services.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- name: service
service:
name: apparmor
enabled: yes
# restart to pick up a new config
state: restarted
4 changes: 2 additions & 2 deletions roles/apt/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ apt_repos:
- ubuntu-security
- ubuntu-updates
- ubuntu-backports
- ubuntu-partner
- ppa-pv-safronov-backports
# - ubuntu-partner
# - ppa-pv-safronov-backports
2 changes: 0 additions & 2 deletions roles/apt/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
- name: apt-get update
shell:
cmd: apt-get update
args:
warn: false
12 changes: 0 additions & 12 deletions roles/apt/tasks/packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,10 @@
apt:
name: software-properties-common

- name: package python-pycurl
apt:
name: python-pycurl
# FIXME: missing since Ubuntu jammy
ignore_errors: yes

- name: package python3-pycurl
apt:
name: python3-pycurl

- name: package python-apt
apt:
name: python-apt
# FIXME: missing since Ubuntu jammy
ignore_errors: yes

- name: package python3-apt
apt:
name: python3-apt
Expand Down
8 changes: 6 additions & 2 deletions roles/apt/tasks/repos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
- '/var/lib/apt/lists/'
tags: build-child

- name: repo remove /etc/apt/sources.list.d/ubuntu.sources
file:
path: /etc/apt/sources.list.d/ubuntu.sources
state: absent
tags: build-child

### Preferences (pins)
- name: repo ubuntu pins
template:
Expand Down Expand Up @@ -49,7 +55,5 @@
- name: repo update
shell:
cmd: apt-get update
args:
warn: false
tags:
- build-child
1 change: 0 additions & 1 deletion roles/common-tools/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ common_tools:
- lsscsi
- lsof
- vnstat
- mlocate
- bash-completion
- parted
- gdisk
Expand Down
3 changes: 2 additions & 1 deletion roles/common-tweaks/meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ dependencies:
- { role: user, when: ansible_distribution == "Ubuntu" }
- { role: pkgmanager }
- { role: tzdata }
- { role: systemd}
- { role: systemd }
- { role: apparmor }
- { role: tuxedo, when: ansible_system_vendor == "TUXEDO" }
- { role: ntp, when: ansible_distribution == "Ubuntu" }
- { role: gpg, when: ansible_distribution == "Ubuntu" }
Expand Down
3 changes: 2 additions & 1 deletion roles/desktop/meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
dependencies:
- { role: ubuntu-desktop, when: ansible_distribution == "Ubuntu" }
- { role: fedora-desktop, when: ansible_distribution == "Fedora" }
# FIXME: apt handler is getting skipped when this is enabled
# - { role: fedora-desktop, when: ansible_distribution == "Fedora" }
2 changes: 0 additions & 2 deletions roles/minimal-ubuntu-desktop/tasks/packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@
- dupload
- virt-manager
- qemu-kvm
- qemu
- dia
- vim-gtk
- gimp
- xubuntu-default-settings
6 changes: 6 additions & 0 deletions roles/ntp/tasks/packages.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# only needed before ubuntu noble, replaced by time-daemon after
- name: pkg
apt:
name: ntp
# only needed before ubuntu noble, replaced by time-daemon after
when:
- ansible_facts['os_family'] == "Debian"
- ansible_facts['distribution'] == "Ubuntu"
- ansible_facts['distribution_version'] == "22.04"
5 changes: 5 additions & 0 deletions roles/ntp/tasks/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@
name: ntp
enabled: yes
state: started
# only needed before ubuntu noble, replaced by time-daemon after
when:
- ansible_facts['os_family'] == "Debian"
- ansible_facts['distribution'] == "Ubuntu"
- ansible_facts['distribution_version'] == "22.04"
19 changes: 0 additions & 19 deletions roles/nvim/tasks/packages.yml
Original file line number Diff line number Diff line change
@@ -1,19 +0,0 @@
- name: packages
apt:
name: "{{ item }}"
with_items:
- neovim
- flake8
- mypy
- pycodestyle
- python3-pyflakes
- black
- isort
- clangd
- cppcheck
- flawfinder
- astyle
- clang-format
- clang-tidy
- uncrustify
- clangd
5 changes: 5 additions & 0 deletions roles/sway/tasks/packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@
- name: package libappindicator1
package:
name: libappindicator1
# removed since ubuntu noble
when:
- ansible_facts['os_family'] == "Debian"
- ansible_facts['distribution'] == "Ubuntu"
- ansible_facts['distribution_version'] == "22.04"

- name: package qtwayland5
package:
Expand Down
13 changes: 5 additions & 8 deletions roles/tlp/tasks/services.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
---
- name: service ondemand tlp
service:
name: ondemand
enabled: no
state: stopped
# FIXME: missing since Ubuntu jammy
ignore_errors: yes

- name: service power-profiles-daemon
service:
name: power-profiles-daemon
enabled: no
state: stopped
# only needed before ubuntu noble, replaced by time-daemon after
when:
- ansible_facts['os_family'] == "Debian"
- ansible_facts['distribution'] == "Ubuntu"
- ansible_facts['distribution_version'] == "22.04"

- name: service tlp
service:
Expand Down
2 changes: 1 addition & 1 deletion roles/tzdata/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
tzdata_timezone: "GB"
tzdata_timezone: "Europe/London"
16 changes: 8 additions & 8 deletions roles/ubuntu-desktop/meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ dependencies:
- { role: ubuntu-devserver }
- { role: minimal-ubuntu-desktop }
- { role: tlp }
- { role: chromium-browser }
- { role: skype }
- { role: discord }
- { role: obs }
- { role: keepassxc }
- { role: latex }
- { role: bitcoin-core }
- { role: slack }
# - { role: chromium-browser }
# - { role: skype }
# - { role: discord }
# - { role: obs }
# - { role: keepassxc }
# - { role: latex }
# - { role: bitcoin-core }
# - { role: slack }
14 changes: 7 additions & 7 deletions roles/ubuntu-devserver/meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ dependencies:
- { role: resolv }
- { role: docker }
- { role: openvpn }
- { role: go }
- { role: i2p }
- { role: tor }
- { role: github-cli }
- { role: go-ethereum }
# - { role: go }
# - { role: i2p }
# - { role: tor }
# - { role: github-cli }
# - { role: go-ethereum }
- { role: vagrant }
- { role: nodejs }
# - { role: nodejs }
- { role: tailscale }
- { role: rust }
# - { role: rust }
# TODO: do we really need fonts on the devserver?
- { role: fonts }
- { role: nvim }
1 change: 0 additions & 1 deletion roles/yubico/tasks/packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
package:
name:
- yubikey-manager
- yubikey-personalization-gui
- libpam-yubico
- libpam-u2f

0 comments on commit c908550

Please sign in to comment.