Merge ubuntu roles

This commit is contained in:
Przemek Grondek 2024-04-19 20:55:06 +02:00
parent 5ae29af922
commit f378f95d4c
16 changed files with 112 additions and 171 deletions

View File

@ -4,8 +4,6 @@
- prepare
- systemd-boot
- ubuntu
- ubuntu-java
- ubuntu-firefox
- prusa-slicer
- dev-java
- dev-js

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

@ -14,8 +14,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"