Finished Fedora role (Package installation) and initial Gnome Settings

This commit is contained in:
Raphael 2025-04-08 17:29:32 +02:00
parent 600fe4db82
commit 5ec756aad1
13 changed files with 133 additions and 19 deletions

View file

@ -3,5 +3,5 @@
Befehl zur Ausführung: Befehl zur Ausführung:
```bash ```bash
sudo dnf install ansible && sudo ansible-pull -U https://forgejo.wern3r.de/raphael/post_install.git install.yml sudo dnf install ansible && sudo ansible-pull -U https://forgejo.wern3r.de/raphael/post_install.git -K
``` ```

View file

@ -1,18 +0,0 @@
---
- hosts: localhost
connection: local
force_handlers: true
pre_tasks:
- set_fact:
eff_uid_number: "{{ lookup('pipe', 'id -u') }}"
- block:
- debug:
msg: "This program requires root privileges"
- meta: end_play
when: eff_uid_number|int != 0
roles:
- name: fedora
when: ansible_distribution == 'Fedora'

10
local.yml Normal file
View file

@ -0,0 +1,10 @@
---
- hosts: localhost
connection: local
force_handlers: true
roles:
- name: fedora
when: ansible_distribution == 'Fedora'
- name: gnome
when: ansible_env.DESKTOP_SESSION == 'gnome'

View file

@ -1,13 +1,16 @@
--- ---
# tasks file for fedora # tasks file for fedora
# TODO: Block in roles?! um ständige becomes zu verhindern
- name: "Add rpmfustion repo gpg keys" - name: "Add rpmfustion repo gpg keys"
become: yes
ansible.builtin.rpm_key: ansible.builtin.rpm_key:
key: "{{ item }}" key: "{{ item }}"
state: present state: present
with_items: "{{ rpmfusion_keys }}" with_items: "{{ rpmfusion_keys }}"
- name: install the rpmfusion repo packages - name: install the rpmfusion repo packages
become: yes
dnf: dnf:
name: "{{ item }}" name: "{{ item }}"
state: present state: present
@ -15,6 +18,7 @@
- name: Remove unnecassary packages - name: Remove unnecassary packages
become: yes
dnf: dnf:
name: "{{ item }}" name: "{{ item }}"
state: absent state: absent
@ -22,6 +26,7 @@
- name: Install all current updates - name: Install all current updates
become: yes
dnf: dnf:
name: "*" name: "*"
state: latest state: latest
@ -29,6 +34,7 @@
- name: Install packages - name: Install packages
become: yes
dnf: dnf:
name: "{{ item }}" name: "{{ item }}"
state: present state: present

View file

@ -28,6 +28,8 @@ packages:
- flatpak - flatpak
- ptyxis - ptyxis
- exa - exa
- gnome-shell-extension-caffeine
- python-psutil
flatpaks: flatpaks:
- com.vscodium.codium - com.vscodium.codium
@ -53,4 +55,5 @@ flatpaks:
- com.mattjakeman.ExtensionManager - com.mattjakeman.ExtensionManager
- com.github.tchx84.Flatseal - com.github.tchx84.Flatseal
- dev.heppen.webapps - dev.heppen.webapps
- com.protonvpn.www

38
roles/gnome/README.md Normal file
View file

@ -0,0 +1,38 @@
Role Name
=========
A brief description of the role goes here.
Requirements
------------
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
Role Variables
--------------
A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.
Dependencies
------------
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
Example Playbook
----------------
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
- hosts: servers
roles:
- { role: username.rolename, x: 42 }
License
-------
BSD
Author Information
------------------
An optional section for the role authors to include contact information, or a website (HTML is not allowed).

View file

@ -0,0 +1,2 @@
---
# defaults file for gnome

View file

@ -0,0 +1,2 @@
---
# handlers file for gnome

52
roles/gnome/meta/main.yml Normal file
View file

@ -0,0 +1,52 @@
galaxy_info:
author: your name
description: your role description
company: your company (optional)
# If the issue tracker for your role is not on github, uncomment the
# next line and provide a value
# issue_tracker_url: http://example.com/issue/tracker
# Choose a valid license ID from https://spdx.org - some suggested licenses:
# - BSD-3-Clause (default)
# - MIT
# - GPL-2.0-or-later
# - GPL-3.0-only
# - Apache-2.0
# - CC-BY-4.0
license: license (GPL-2.0-or-later, MIT, etc)
min_ansible_version: 2.1
# If this a Container Enabled role, provide the minimum Ansible Container version.
# min_ansible_container_version:
#
# Provide a list of supported platforms, and for each platform a list of versions.
# If you don't wish to enumerate all versions for a particular platform, use 'all'.
# To view available platforms and versions (or releases), visit:
# https://galaxy.ansible.com/api/v1/platforms/
#
# platforms:
# - name: Fedora
# versions:
# - all
# - 25
# - name: SomePlatform
# versions:
# - all
# - 1.0
# - 7
# - 99.99
galaxy_tags: []
# List tags for your role here, one per line. A tag is a keyword that describes
# and categorizes the role. Users find roles by searching for tags. Be sure to
# remove the '[]' above, if you add tags to this list.
#
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
# Maximum 20 tags per role.
dependencies: []
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.

View file

@ -0,0 +1,7 @@
---
# tasks file for gnome
- name: Set Gnome Settings
dconf:
key: "{{ item.keys() | first }}"
value: "{{ item.values() | first }}"
with_items: "{{ gnome_settings }}"

View file

@ -0,0 +1,2 @@
localhost

View file

@ -0,0 +1,5 @@
---
- hosts: localhost
remote_user: root
roles:
- gnome

View file

@ -0,0 +1,5 @@
---
# vars file for gnome
gnome_settings:
- "/org/gnome/desktop/wm/preferences/button-layout": "'appmenu:close'"