2020-11-08 06:10:12 -06:00
|
|
|
#!/usr/bin/env ansible-playbook
|
|
|
|
# vim:ft=ansible:
|
|
|
|
---
|
|
|
|
- name: configure packages for apt
|
|
|
|
block:
|
|
|
|
# Manage archs
|
|
|
|
- name: enable archs
|
2022-06-16 23:45:29 -05:00
|
|
|
ansible.builtin.lineinfile: dest=/var/lib/dpkg/arch line={{ item }} create=yes mode=0644
|
2020-11-08 06:10:12 -06:00
|
|
|
loop: "{{ desktop_apt_archs }}"
|
|
|
|
# Manage keys
|
|
|
|
- name: enroll keys from keyserver
|
2022-06-16 23:45:29 -05:00
|
|
|
ansible.builtin.apt_key: keyserver=keyserver.ubuntu.com id={{ item }}
|
2020-11-08 06:10:12 -06:00
|
|
|
loop: "{{ desktop_apt_keys_keyserver + desktop_apt_keys_keyserver_extra }}"
|
|
|
|
- name: enroll keys by url
|
2022-06-16 23:45:29 -05:00
|
|
|
ansible.builtin.apt_key: url={{ item }}
|
2020-11-08 06:10:12 -06:00
|
|
|
loop: "{{ desktop_apt_keys_url + desktop_apt_keys_url_extra }}"
|
|
|
|
# Manage repos
|
|
|
|
- name: configure repos
|
2022-06-16 23:45:29 -05:00
|
|
|
ansible.builtin.apt_repository: repo={{ item }}
|
2020-11-08 06:10:12 -06:00
|
|
|
loop: "{{ desktop_apt_repos + desktop_apt_repos_extra }}"
|
|
|
|
# Manage packages
|
|
|
|
- name: configure installed packages
|
2022-06-16 23:45:29 -05:00
|
|
|
ansible.builtin.apt: name="{{ desktop_apt_packages + desktop_apt_packages_extra }}"
|
2021-06-17 16:35:11 -05:00
|
|
|
- name: configure removed packages
|
2022-06-16 23:45:29 -05:00
|
|
|
ansible.builtin.apt: name="{{ desktop_apt_packages_remove + desktop_apt_packages_remove_extra }}" state=absent
|
2020-11-08 06:10:12 -06:00
|
|
|
- name: configure out-of-repo packages
|
2022-06-16 23:45:29 -05:00
|
|
|
ansible.builtin.apt: deb="{{ item }}"
|
2020-11-08 06:10:12 -06:00
|
|
|
loop: "{{ desktop_apt_debs + desktop_apt_debs_extra }}"
|
|
|
|
when: ansible_pkg_mgr == "apt"
|
2020-12-04 09:07:56 -06:00
|
|
|
- name: configure portage
|
|
|
|
block:
|
|
|
|
# Portage is very complex, so we sync an entire known good configuration tree
|
|
|
|
# Note that this also syncs over the @ansible package set
|
|
|
|
- name: sync portage configs
|
|
|
|
synchronize: src="portage/" dest="/etc/portage/"
|
|
|
|
# This is my bootstrap script, which can cause damage if invoked by root again, so we remove it
|
|
|
|
- name: remove gentoostrap
|
2022-06-16 23:45:29 -05:00
|
|
|
ansible.builtin.file: path=/gentoostrap.sh state=absent
|
2020-12-04 09:25:52 -06:00
|
|
|
- name: remove gentoostrap package.use
|
2022-06-16 23:45:29 -05:00
|
|
|
ansible.builtin.file: path=/etc/portage/package.use/gentoostrap state=absent
|
2020-12-04 09:07:56 -06:00
|
|
|
when: ansible_os_family == "Gentoo"
|
2020-11-08 06:10:12 -06:00
|
|
|
- name: configure pip3 packages
|
2022-06-16 23:45:29 -05:00
|
|
|
ansible.builtin.pip: executable=/usr/bin/pip3 state=latest name="{{ desktop_pip3_packages + desktop_pip3_packages_extra }}"
|
2020-12-04 09:21:08 -06:00
|
|
|
when: ansible_os_family != "Gentoo"
|
2021-09-23 21:22:35 -05:00
|
|
|
- name: configure flatpak
|
|
|
|
block:
|
|
|
|
- name: configure flatpak remotes
|
|
|
|
flatpak_remote: name="{{ item.name }}" state=present flatpakrepo_url="{{ item.url }}"
|
|
|
|
with_items: "{{ desktop_flatpak_remotes + desktop_flatpak_remotes_extra }}"
|
|
|
|
- name: configure installed flatpaks
|
2021-09-23 21:31:32 -05:00
|
|
|
flatpak: name="{{ item.packages }}" state=present remote="{{ item.remote | default('flathub', true) }}"
|
|
|
|
with_items: "{{ desktop_flatpak_packages + desktop_flatpak_packages_extra }}"
|