Cleaned the logging and added test for Fedora Silverblue
This commit is contained in:
parent
d280e4eabd
commit
14143019e1
3 changed files with 15 additions and 28 deletions
|
|
@ -24,7 +24,9 @@
|
||||||
|
|
||||||
roles:
|
roles:
|
||||||
- name: fedora
|
- name: fedora
|
||||||
when: ansible_distribution == 'Fedora'
|
when:
|
||||||
|
- ansible_distribution == 'Fedora'
|
||||||
|
- ansible_pkg_mgr == 'dnf5'
|
||||||
- name: gnome
|
- name: gnome
|
||||||
when: ansible_env.DESKTOP_SESSION == 'gnome'
|
when: ansible_env.DESKTOP_SESSION == 'gnome'
|
||||||
- name: dotfiles
|
- name: dotfiles
|
||||||
|
|
|
||||||
|
|
@ -6,61 +6,49 @@
|
||||||
block:
|
block:
|
||||||
- name: "Add rpmfustion repo gpg keys"
|
- name: "Add rpmfustion repo gpg keys"
|
||||||
ansible.builtin.rpm_key:
|
ansible.builtin.rpm_key:
|
||||||
key: "{{ rpmfusion_keys }}"
|
key: "{{ fedora_rpmfusion_keys }}"
|
||||||
state: present
|
state: present
|
||||||
register: rpmfusion_keys_errors
|
|
||||||
|
|
||||||
- name: "Install the rpmfusion repo packages"
|
- name: "Install the rpmfusion repo packages"
|
||||||
ansible.builtin.dnf:
|
ansible.builtin.dnf:
|
||||||
name: "{{ rpmfusion_repos }}"
|
name: "{{ fedora_rpmfusion_repos }}"
|
||||||
state: present
|
state: present
|
||||||
register: rpmfusion_repo_errors
|
|
||||||
|
|
||||||
rescue:
|
rescue:
|
||||||
- name: "Log errors"
|
- name: "Log errors"
|
||||||
ansible.builtin.lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
dest: "{{ log_path }}"
|
dest: "{{ log_path }}"
|
||||||
line: >-
|
line: >-
|
||||||
[ERR] {{ item.msg }}
|
[ERR] Error while adding rpmfusion repos
|
||||||
with_items:
|
|
||||||
- "{{ rpmfusion_keys_errors }}"
|
|
||||||
- "{{ rpmfusion_repo_errors }}"
|
|
||||||
|
|
||||||
- name: "Remove and install dnf software"
|
- name: "Remove and install dnf software"
|
||||||
become: true
|
become: true
|
||||||
block:
|
block:
|
||||||
- name: "Remove unnecassary packages"
|
- name: "Remove unnecassary packages"
|
||||||
ansible.builtin.dnf:
|
ansible.builtin.dnf:
|
||||||
name: "{{ rem_packages }}"
|
name: "{{ fedora_rem_packages }}"
|
||||||
state: absent
|
state: absent
|
||||||
register: dnf_uninstall_errors
|
|
||||||
|
|
||||||
|
|
||||||
- name: "Install all current updates"
|
- name: "Install all current updates"
|
||||||
ansible.builtin.dnf:
|
ansible.builtin.dnf:
|
||||||
name: "*"
|
name: "*"
|
||||||
state: latest
|
state: latest
|
||||||
register: dnf_update_errors
|
|
||||||
|
|
||||||
- name: "Install packages"
|
- name: "Install packages"
|
||||||
ansible.builtin.dnf:
|
ansible.builtin.dnf:
|
||||||
name: "{{ packages }}"
|
name: "{{ fedora_packages }}"
|
||||||
state: present
|
state: present
|
||||||
register: dnf_install_errors
|
|
||||||
|
|
||||||
rescue:
|
rescue:
|
||||||
- name: "Log errors"
|
- name: "Log errors"
|
||||||
ansible.builtin.lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
dest: "{{ log_path }}"
|
dest: "{{ log_path }}"
|
||||||
line: >-
|
line: >-
|
||||||
[ERR] {{ item }}
|
[ERR] Error while removing, updating or installing software.
|
||||||
with_items:
|
|
||||||
- "{{ dnf_uninstall_errors }}"
|
|
||||||
- "{{ dnf_update_errors }}"
|
|
||||||
- "{{ dnf_install_errors.failures }}"
|
|
||||||
|
|
||||||
|
|
||||||
- name: "Install Flatpaks"
|
- name: "Install Flatpaks"
|
||||||
flatpak:
|
flatpak:
|
||||||
name: "{{ flatpaks }}"
|
name: "{{ fedora_flatpaks }}"
|
||||||
state: present
|
state: present
|
||||||
|
|
|
||||||
|
|
@ -1,25 +1,22 @@
|
||||||
---
|
---
|
||||||
# vars file for fedora
|
# vars file for fedora
|
||||||
|
|
||||||
rpmfusion_keys_errors: ""
|
fedora_rpmfusion_keys:
|
||||||
rpmfusion_repo_errors: ""
|
|
||||||
|
|
||||||
rpmfusion_keys:
|
|
||||||
- "https://rpmfusion.org/keys?action=AttachFile&do=get&target=RPM-GPG-KEY-rpmfusion-free-fedora-2020"
|
- "https://rpmfusion.org/keys?action=AttachFile&do=get&target=RPM-GPG-KEY-rpmfusion-free-fedora-2020"
|
||||||
- "https://rpmfusion.org/keys?action=AttachFile&do=get&target=RPM-GPG-KEY-rpmfusion-nonfree-fedora-2020"
|
- "https://rpmfusion.org/keys?action=AttachFile&do=get&target=RPM-GPG-KEY-rpmfusion-nonfree-fedora-2020"
|
||||||
|
|
||||||
rpmfusion_repos:
|
fedora_rpmfusion_repos:
|
||||||
- http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-{{ ansible_distribution_major_version }}.noarch.rpm
|
- http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-{{ ansible_distribution_major_version }}.noarch.rpm
|
||||||
- http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-{{ ansible_distribution_major_version }}.noarch.rpm
|
- http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-{{ ansible_distribution_major_version }}.noarch.rpm
|
||||||
|
|
||||||
rem_packages:
|
fedora_rem_packages:
|
||||||
- gnome-tour
|
- gnome-tour
|
||||||
- mediawriter
|
- mediawriter
|
||||||
- totem
|
- totem
|
||||||
# - libreoffice*
|
# - libreoffice*
|
||||||
- rhythmbox
|
- rhythmbox
|
||||||
|
|
||||||
packages:
|
fedora_packages:
|
||||||
- vim
|
- vim
|
||||||
- helix
|
- helix
|
||||||
- flatpak
|
- flatpak
|
||||||
|
|
@ -35,7 +32,7 @@ packages:
|
||||||
- python-psutil
|
- python-psutil
|
||||||
- tldr
|
- tldr
|
||||||
|
|
||||||
flatpaks:
|
fedora_flatpaks:
|
||||||
- com.vscodium.codium
|
- com.vscodium.codium
|
||||||
- com.nextcloud.desktopclient.nextcloud
|
- com.nextcloud.desktopclient.nextcloud
|
||||||
- com.logseq.Logseq
|
- com.logseq.Logseq
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue