Files
ansible_role_package/tasks/main.yml
Matthew Stobbs 0ece836f39 adjust pkg list generation
- add a custom pkg definition if it exists
- if it doesn't exist, assume it's a package manager packge name
2025-01-21 16:59:02 -07:00

69 lines
1.5 KiB
YAML

---
- name: generate package installation lists
ansible.builtin.include_tasks:
file: addpkg.yml
loop: "{{ packages }}"
loop_control:
loop_var: pkg
tags:
- config
- packages
- name: upgrade linux packages
block:
- ansible.builtin.dnf:
name: "*"
state: latest
when: ansible_os_family == 'RedHat'
- ansible.builtin.apt:
name: "*"
state: latest
when: ansible_os_family == 'Debian'
become: true
when: full_upgrade
- name: Linux specific installation
block:
- ansible.builtin.dnf:
name: "{{ syspkgs }}"
state: "{{ install_state }}"
when: ansible_os_family == 'RedHat'
- ansible.builtin.apt:
name: "{{ syspkgs }}"
state: "{{ install_state }}"
when: ansible_os_family == 'Darwin'
become: true
when: ansible_system == 'Linux'
tags:
- Linux
- RedHat
- Debian
- packages
- name: Macos specific installation
block:
- community.general.homebrew:
name: "{{ syspkgs | unique }}"
state: "{{ install_state }}"
- community.general.homebrew_cask:
name: "{{ caskpkgs | unique }}"
state: "{{ install_state }}"
tags:
- packages
- Darwin
- macOS
- homebrew
- homebrew_cask
- name: install srcpkgs
ansible.builtin.include_tasks:
file: "build/{{ srcpkg }}.yml"
loop: "{{ srcpkgs }}"
loop_control:
loop_var: srcpkg
when: srcpkgs|length > 0
tags:
- packages
- source