From 78568ab2073d236312122d646309e51b9176b72c Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 19 Mar 2022 11:18:42 +0800 Subject: [PATCH] Modularize tasks from system/base to its own role Seems like I misunderstood what tags are for. They're not individual flags for the play, they're commonly used for excluding/including tasks at runtime (e.g., `ansible-playbook $PLAYBOOK --tags $TAGS`). When running a playbook, it will execute all tasks by default. Think of them as attaching a label and letting the user choose from the playbook run. Setting multiple tags at the playbook-level seems to be the best practice as seen from jwflory's Ansible playbooks. --- roles/system/base/tasks/main.yml | 12 ------------ .../tasks/main.yml} | 11 +++++++---- .../{base/tasks/fonts.yml => fonts/tasks/main.yml} | 0 .../{base/tasks/i18n.yml => i18n/tasks/main.yml} | 0 4 files changed, 7 insertions(+), 16 deletions(-) rename roles/system/{base/tasks/flatpak_desktop_apps.yml => flatpak/tasks/main.yml} (78%) rename roles/system/{base/tasks/fonts.yml => fonts/tasks/main.yml} (100%) rename roles/system/{base/tasks/i18n.yml => i18n/tasks/main.yml} (100%) diff --git a/roles/system/base/tasks/main.yml b/roles/system/base/tasks/main.yml index 74e4d2d..e1e7d5a 100644 --- a/roles/system/base/tasks/main.yml +++ b/roles/system/base/tasks/main.yml @@ -6,15 +6,3 @@ - name: Install additional development tools include: dev_extra.yml tags: dev_extra - -- name: Install Flatpak remotes and desktop applications (requires `flatpak`) - include: flatpak_desktop_apps.yml - tags: flatpak_desktop_apps - -- name: Install i18n-related tools - include: i18n.yml - tags: i18n - -- name: Install fonts - include: fonts.yml - tags: fonts diff --git a/roles/system/base/tasks/flatpak_desktop_apps.yml b/roles/system/flatpak/tasks/main.yml similarity index 78% rename from roles/system/base/tasks/flatpak_desktop_apps.yml rename to roles/system/flatpak/tasks/main.yml index 604960e..3bf225c 100644 --- a/roles/system/base/tasks/flatpak_desktop_apps.yml +++ b/roles/system/flatpak/tasks/main.yml @@ -6,13 +6,15 @@ flatpakrepo_url: "{{ item.repo }}" loop: - name: flathub - repo: "https://flathub.org/repo/flathub.flatpakrepo" + repo: https://flathub.org/repo/flathub.flatpakrepo - name: flathub-beta - repo: "https://flathub.org/beta-repo/flathub-beta.flatpakrepo" + repo: https://flathub.org/beta-repo/flathub-beta.flatpakrepo - name: gnome-nightly - repo: "https://nightly.gnome.org/gnome-nightly.flatpakrepo" + repo: https://nightly.gnome.org/gnome-nightly.flatpakrepo - name: kdeapps - repo: "https://distribute.kde.org/kdeapps.flatpakrepo" + repo: https://distribute.kde.org/kdeapps.flatpakrepo + - name: appcenter + repo: https://flatpak.elementary.io/repo.flatpakrepo - name: Install applications from 'flathub' Flatpak remote flatpak: @@ -20,6 +22,7 @@ name: "{{ item }}" remote: flathub loop: + - com.github.gi_lom.dialect - com.github.tchx84.Flatseal - com.github.wwmm.easyeffects - com.obsproject.Studio diff --git a/roles/system/base/tasks/fonts.yml b/roles/system/fonts/tasks/main.yml similarity index 100% rename from roles/system/base/tasks/fonts.yml rename to roles/system/fonts/tasks/main.yml diff --git a/roles/system/base/tasks/i18n.yml b/roles/system/i18n/tasks/main.yml similarity index 100% rename from roles/system/base/tasks/i18n.yml rename to roles/system/i18n/tasks/main.yml