Compare commits

...

3 Commits

Author SHA1 Message Date
ee2eecf737 Remove rearrange folders 2024-04-19 20:56:52 +02:00
f378f95d4c Merge ubuntu roles 2024-04-19 20:55:06 +02:00
5ae29af922 Add systemd-boot role 2024-04-19 20:49:47 +02:00
22 changed files with 195 additions and 199 deletions

View File

@ -2,9 +2,8 @@
- hosts: localhost
roles:
- prepare
- systemd-boot
- ubuntu
- ubuntu-java
- ubuntu-firefox
- prusa-slicer
- dev-java
- dev-js

View File

@ -0,0 +1,69 @@
---
- name: "[Arch] install efi drivers for ext4"
become: yes
community.general.pacman:
update_cache: yes
name:
- efifs
- name: "[Arch] Install systemd-boot"
become: yes
shell:
cmd: |
bootctl --esp-path {{ efs }} --boot-path {{ boot }} install
- name: "[Arch] Copy ext4 driver to systemd drivers"
become: yes
copy:
remote_src: true
content: /usr/lib/efifs-x64/ext2_x64.efi
dest: "{{ efs }}/EFI/systemd/drivers/ext2_x64.efi"
- name: "[Arch] Add main entry"
become: yes
template:
src: loader/entries/arch.conf.j2
dest: "{{ boot }}/loader/entries/arch.conf"
vars:
name: ""
variant: ""
version: "linux"
- name: "[Arch] Add fallback entry"
become: yes
template:
src: loader/entries/arch.conf.j2
dest: "{{ boot }}/loader/entries/arch-fallback.conf"
vars:
name: " Fallback"
variant: "-fallback"
version: "linux"
- name: "[Arch] Check if lts kernel is installed"
stat:
path: "{{ boot }}/vmlinuz-linux-lts"
register: lts_kernel
- name: "[Arch] Add lts entry"
become: yes
template:
src: loader/entries/arch.conf.j2
dest: "{{ boot }}/loader/entries/arch-lts.conf"
vars:
name: " LTS"
variant: ""
version: "linux-lts"
when:
- lts_kernel.stat.exists
- name: "[Arch] Add lts fallback entry"
become: yes
template:
src: loader/entries/arch.conf.j2
dest: "{{ boot }}/loader/entries/arch-lts-fallback.conf"
vars:
name: " LTS Fallback"
variant: "-fallback"
version: "linux-lts"
when:
- lts_kernel.stat.exists

View File

@ -0,0 +1,3 @@
---
- import_tasks: arch.yml
when: ansible_distribution == "Archlinux"

View File

@ -0,0 +1,4 @@
title Arch Linux{{ name }}
linux /vmlinuz-{{ version }}
initrd /initramfs-{{ version }}{{ variant }}.img
options root={{ root }} cryptdevice={{ cryptdevice }} {{ options }}

View File

@ -0,0 +1,6 @@
---
root: /dev/mapper/vgubuntu-root
cryptdevice: /dev/nvme0n1p3:cryptlvm
options: rw add_efi_memmap amd_pstate=active loglevel=3
boot: /boot
efs: /boot/efi

View File

@ -1,83 +0,0 @@
- become: yes
block:
- name: Gather the package facts
ansible.builtin.package_facts:
manager: auto
- name: remove snap
community.general.snap:
name: firefox
state: absent
when:
- "'snapd' in ansible_facts.packages"
- "'firefox' in ansible_facts.packages"
- ansible_facts.packages['firefox'][0].version == "1:1snap1-0ubuntu2"
- name: remove snap
community.general.snap:
name: firefox
state: disabled
when:
- "'snapd' in ansible_facts.packages"
- "'firefox' in ansible_facts.packages"
- ansible_facts.packages['firefox'][0].version == "1:1snap1-0ubuntu2"
- name: remove apt snap wrapper version
apt:
state: absent
pkg:
- firefox
when:
- "'firefox' in ansible_facts.packages"
- ansible_facts.packages['firefox'][0].version == "1:1snap1-0ubuntu2"
- name: Add linux mint source list
ansible.builtin.apt_repository:
repo: deb http://packages.linuxmint.com vera upstream
state: present
- name: set linux mint for higher priority
copy:
src: etc/apt/preferences.d/mint-firefox
dest: /etc/apt/preferences.d/mint-firefox
- name: Remove unattended upgrades
file:
path: /etc/apt/apt.conf.d/51unattended-upgrades-firefox
state: absent
- name: Remove mozilla ppa
apt_repository:
repo: ppa:mozillateam/ppa
state: absent
- name: install equivs
become: yes
apt:
update_cache: yes
state: latest
pkg:
- equivs
- name: copy fakepackage to satisfy dependencies
copy:
src: tmp/fakepkg
dest: /tmp/fakepkg
- name: make fake ubuntu-system-adjustments package
shell:
cmd: equivs-build /tmp/fakepkg
chdir: /tmp
- name: Install a .deb package
ansible.builtin.apt:
deb: /tmp/ubuntu-system-adjustments_2021.12.16_all.deb
- name: install browser
become: yes
apt:
allow_downgrade: true
update_cache: yes
state: latest
pkg:
- firefox

View File

@ -1,6 +0,0 @@
---
- import_tasks: linux-mint.yml
when: ansible_distribution == "Ubuntu" and ansible_distribution_major_version|int >= 22
- import_tasks: update-alternatives.yml
when: ansible_distribution == "Ubuntu"

View File

@ -1,55 +0,0 @@
- become: yes
block:
- name: Gather the package facts
ansible.builtin.package_facts:
manager: auto
- name: remove snap
community.general.snap:
name: firefox
state: absent
when:
- "'snapd' in ansible_facts.packages"
- "'firefox' in ansible_facts.packages"
- ansible_facts.packages['firefox'][0].version == "1:1snap1-0ubuntu2"
- name: remove snap
community.general.snap:
name: firefox
state: disabled
when:
- "'snapd' in ansible_facts.packages"
- "'firefox' in ansible_facts.packages"
- ansible_facts.packages['firefox'][0].version == "1:1snap1-0ubuntu2"
- name: remove apt snap wrapper version
apt:
state: absent
pkg:
- firefox
when:
- "'firefox' in ansible_facts.packages"
- ansible_facts.packages['firefox'][0].version == "1:1snap1-0ubuntu2"
- name: add ppa
apt_repository:
repo: ppa:mozillateam/ppa
- name: set mozillateam higher priority
copy:
src: etc/apt/preferences.d/mozillateamppa
dest: /etc/apt/preferences.d/mozillateamppa
- name: set mozillateam for unattended upgrades
copy:
src: etc/apt/apt.conf.d/51unattended-upgrades-firefox
dest: /etc/apt/apt.conf.d/51unattended-upgrades-firefox
- name: install browser
become: yes
apt:
allow_downgrade: true
update_cache: yes
state: latest
pkg:
- firefox

View File

@ -1,6 +0,0 @@
- name: Set firefox as x-www-browser
become: yes
command: update-alternatives --set x-www-browser /usr/bin/firefox
- name: update xdg default-web-browser
command: xdg-settings set default-web-browser firefox.desktop

View File

@ -0,0 +1,45 @@
---
- become: yes
block:
- name: Gather the package facts
ansible.builtin.package_facts:
manager: auto
- name: add mint gpg key
command: apt-key adv --recv-keys --keyserver keyserver.ubuntu.com A1715D88E1DF1F24 40976EAF437D05B5 3B4FE6ACC0B21F32 A6616109451BBBF2
- name: remove snap
community.general.snap:
name: chromium
state: absent
when:
- "'snapd' in ansible_facts.packages"
- "'chromium-browser' in ansible_facts.packages"
- ansible_facts.packages['chromium-browser'][0].version == "1:85.0.4183.83-0ubuntu2.22.04.1"
- name: remove apt snap wrapper version
apt:
state: absent
pkg:
- chromium
- chromium-browser
when:
- "'chromium-browser' in ansible_facts.packages"
- ansible_facts.packages['chromium-browser'][0].version == "1:85.0.4183.83-0ubuntu2.22.04.1"
- name: add linux mint repo
apt_repository:
repo: deb http://packages.linuxmint.com vera upstream
state: present
filename: linux-mint
- name: pin linux mint version of chromium
copy:
src: etc/apt/preferences.d/mint-chromium
dest: /etc/apt/preferences.d/mint-chromium
- name: install chromium
apt:
update_cache: yes
pkg:
- chromium

View File

@ -1,45 +1,87 @@
---
- become: yes
block:
- name: Gather the package facts
ansible.builtin.package_facts:
manager: auto
- name: add mint gpg key
command: apt-key adv --recv-keys --keyserver keyserver.ubuntu.com A1715D88E1DF1F24 40976EAF437D05B5 3B4FE6ACC0B21F32 A6616109451BBBF2
- name: remove snap
community.general.snap:
name: chromium
name: firefox
state: absent
when:
- "'snapd' in ansible_facts.packages"
- "'chromium-browser' in ansible_facts.packages"
- ansible_facts.packages['chromium-browser'][0].version == "1:85.0.4183.83-0ubuntu2.22.04.1"
- "'firefox' in ansible_facts.packages"
- ansible_facts.packages['firefox'][0].version == "1:1snap1-0ubuntu2"
- name: remove snap
community.general.snap:
name: firefox
state: disabled
when:
- "'snapd' in ansible_facts.packages"
- "'firefox' in ansible_facts.packages"
- ansible_facts.packages['firefox'][0].version == "1:1snap1-0ubuntu2"
- name: remove apt snap wrapper version
apt:
state: absent
pkg:
- chromium
- chromium-browser
- firefox
when:
- "'chromium-browser' in ansible_facts.packages"
- ansible_facts.packages['chromium-browser'][0].version == "1:85.0.4183.83-0ubuntu2.22.04.1"
- "'firefox' in ansible_facts.packages"
- ansible_facts.packages['firefox'][0].version == "1:1snap1-0ubuntu2"
- name: add linux mint repo
apt_repository:
- name: Add linux mint source list
ansible.builtin.apt_repository:
repo: deb http://packages.linuxmint.com vera upstream
state: present
filename: linux-mint
- name: pin linux mint version of chromium
- name: set linux mint for higher priority
copy:
src: etc/apt/preferences.d/mint-chromium
dest: /etc/apt/preferences.d/mint-chromium
src: etc/apt/preferences.d/mint-firefox
dest: /etc/apt/preferences.d/mint-firefox
- name: install chromium
- name: Remove unattended upgrades
file:
path: /etc/apt/apt.conf.d/51unattended-upgrades-firefox
state: absent
- name: Remove mozilla ppa
apt_repository:
repo: ppa:mozillateam/ppa
state: absent
- name: install equivs
apt:
update_cache: yes
state: latest
pkg:
- chromium
- equivs
- name: copy fakepackage to satisfy dependencies
copy:
src: tmp/fakepkg
dest: /tmp/fakepkg
- name: make fake ubuntu-system-adjustments package
shell:
cmd: equivs-build /tmp/fakepkg
chdir: /tmp
- name: Install a .deb package
ansible.builtin.apt:
deb: /tmp/ubuntu-system-adjustments_2021.12.16_all.deb
- name: install browser
apt:
allow_downgrade: true
update_cache: yes
state: latest
pkg:
- firefox
- name: Set firefox as x-www-browser
command: update-alternatives --set x-www-browser /usr/bin/firefox
- name: update xdg default-web-browser
command: xdg-settings set default-web-browser firefox.desktop

View File

@ -1,7 +1,4 @@
---
- import_tasks: rearrange-folders.yml
when: ansible_distribution == "Ubuntu"
- import_tasks: cleanup.yml
when: ansible_distribution == "Ubuntu"
@ -14,8 +11,14 @@
- import_tasks: unsnap.yml
when: ansible_distribution == "Ubuntu"
- import_tasks: chromium.yml
when: ansible_distribution == "Ubuntu"
- import_tasks: firefox.yml
when: ansible_distribution == "Ubuntu"
- import_tasks: dconf.yml
when: ansible_distribution == "Ubuntu"
- import_tasks: openjdk.yml
when: ansible_distribution == "Ubuntu"

View File

@ -1,8 +0,0 @@
- name: "Lookup for {{ item }} directory"
stat:
path: "{{ desktop.old_source_dir }}/{{ item }}"
register: old_directory
- name: "Move {{ desktop.old_source_dir }}/{{ item }} to {{ desktop.apps_source_dir }}/{{ item }}"
command: mv {{ desktop.old_source_dir }}/{{ item }} {{ desktop.apps_source_dir }}/{{ item }}
when:
- old_directory.stat.exists

View File

@ -1,17 +0,0 @@
- name: create directory
file:
state: directory
path: "{{ desktop.apps_source_dir }}"
- include_tasks: rearrange-folders-loop.yml
loop:
- asusctl
- dotfiles
- dwm
- dwm-nest
- ego
- dwmstatus
- polybar
- streamdeck
- stterm
- supergfxctl