Allow per-group software
This commit is contained in:
@@ -3,4 +3,5 @@
|
||||
# - linux-system-roles.systemd
|
||||
|
||||
collections:
|
||||
- name: ansible.posix
|
||||
- name: ansible.posix
|
||||
- name: community.general
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
dnf_add_repositories:
|
||||
dnf_add_repos:
|
||||
- name: zsh-completions
|
||||
description: zsh-completions from openSUSE
|
||||
baseurl: https://download.opensuse.org/repositories/shells:zsh-users:zsh-completions/Fedora_Rawhide/
|
||||
@@ -46,13 +46,14 @@ dnf_install:
|
||||
- snapd
|
||||
- tailscale
|
||||
- dnf5-plugin-automatic
|
||||
- btrfs-assistant
|
||||
|
||||
# Cargo packages to install
|
||||
cargo_packages:
|
||||
- aichat
|
||||
|
||||
# Git repositories to clone
|
||||
git_repos:
|
||||
git_add_repos:
|
||||
- repo: https://git.bryanroessler.com/bryan/installJRMC.git
|
||||
dest: "{{ ansible_facts['env']['HOME'] }}/.local/bin/installJRMC"
|
||||
version: dev
|
||||
|
||||
@@ -16,6 +16,6 @@ bryanroessler.com ansible_host=bryanroessler.com ansible_user=bryan
|
||||
[testing]
|
||||
testing-remote ansible_host=192.168.122.205 ansible_user=bryan
|
||||
|
||||
[desktops:children]
|
||||
workstation
|
||||
laptop
|
||||
# [desktops:children]
|
||||
# workstation
|
||||
# laptop
|
||||
@@ -1,5 +1,12 @@
|
||||
---
|
||||
|
||||
- name: Enable COPR repositories
|
||||
community.general.copr:
|
||||
name: "{{ item.repo | default(item) }}"
|
||||
state: enabled
|
||||
loop: "{{ (dnf_add_copr | default([])) + (dnf_add_copr_group | default([])) }}"
|
||||
become: true
|
||||
|
||||
- name: Add DNF repositories
|
||||
ansible.builtin.yum_repository:
|
||||
name: "{{ item.name }}"
|
||||
@@ -8,30 +15,29 @@
|
||||
enabled: true
|
||||
gpgcheck: true
|
||||
gpgkey: "{{ item.gpgkey }}"
|
||||
loop: "{{ dnf_add_repositories }}"
|
||||
loop: "{{ (dnf_add_repos | default([])) + (dnf_add_repos_group | default([])) }}"
|
||||
become: true
|
||||
when: dnf_add_repositories is defined and dnf_add_repositories | length > 0
|
||||
|
||||
- name: Remove unwanted packages
|
||||
ansible.builtin.dnf:
|
||||
name: "{{ dnf_remove }}"
|
||||
name: "{{ (dnf_remove | default([])) + (dnf_remove_group | default([])) }}"
|
||||
state: absent
|
||||
become: true
|
||||
when: dnf_remove is defined and dnf_remove | length > 0
|
||||
when: ((dnf_remove | default([])) + (dnf_remove_group | default([]))) | length > 0
|
||||
failed_when: false
|
||||
|
||||
- name: Install DNF packages
|
||||
ansible.builtin.dnf:
|
||||
name: "{{ dnf_install }}"
|
||||
name: "{{ (dnf_install | default([])) + (dnf_install_group | default([])) }}"
|
||||
state: present
|
||||
become: true
|
||||
when: dnf_install is defined and dnf_install | length > 0
|
||||
when: ((dnf_install | default([])) + (dnf_install_group | default([]))) | length > 0
|
||||
|
||||
- name: Install cargo packages
|
||||
ansible.builtin.command:
|
||||
cmd: "cargo install {{ item }}"
|
||||
loop: "{{ cargo_packages }}"
|
||||
when: cargo_packages is defined and cargo_packages | length > 0
|
||||
loop: "{{ (cargo_packages | default([])) + (cargo_packages_group | default([])) }}"
|
||||
when: ((cargo_packages | default([])) + (cargo_packages_group | default([]))) | length > 0
|
||||
register: software_cargo_install_result
|
||||
changed_when: "'Installing' in software_cargo_install_result.stderr or 'Compiling' in software_cargo_install_result.stderr"
|
||||
failed_when: software_cargo_install_result.rc != 0 and 'already exists' not in software_cargo_install_result.stderr
|
||||
@@ -42,5 +48,4 @@
|
||||
dest: "{{ item.dest }}"
|
||||
version: "{{ item.version }}"
|
||||
update: true
|
||||
loop: "{{ git_repos }}"
|
||||
when: git_repos is defined and git_repos | length > 0
|
||||
loop: "{{ (git_add_repos | default([])) + (git_add_repos_group | default([])) }}"
|
||||
|
||||
Reference in New Issue
Block a user