Try to use set_fact for package names.
This commit is contained in:
parent
b68f002e5b
commit
8eede3226b
22
facts/package_name.yml
Normal file
22
facts/package_name.yml
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
---
|
||||||
|
# Define what the program name is on each OS so we can use package builtin. like this:
|
||||||
|
|
||||||
|
- name: Set Pop!_OS Package Names
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
package_name.firefox: firefox
|
||||||
|
package_name.thunderbird: thunderbird
|
||||||
|
when: ansible_distribution == "Pop!OS"
|
||||||
|
|
||||||
|
|
||||||
|
- name: Set Ubuntu Package Names
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
package_name.firefox: firefox
|
||||||
|
package_name.thunderbird: thunderbird
|
||||||
|
when: ansible_distribution == "Ubuntu"
|
||||||
|
|
||||||
|
|
||||||
|
- name: Set FreeBSD Package Names
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
package_name.firefox: firefox
|
||||||
|
package_name.thunderbird: thunderbird
|
||||||
|
when: ansible_distribution == "FreeBSD"
|
@ -1,16 +1,24 @@
|
|||||||
---
|
---
|
||||||
# Harmonize my systems rather than doing everything manually. :)
|
# Harmonize my systems rather than doing everything manually. :)
|
||||||
|
|
||||||
|
# Everything
|
||||||
- hosts: all
|
- hosts: all
|
||||||
connection: local
|
connection: local
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
|
pre_tasks:
|
||||||
|
- include: facts/package_name.yml
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- include: tasks/users.yml
|
- include: tasks/users.yml
|
||||||
- include: tasks/cron.yml
|
- include: tasks/cron.yml
|
||||||
- include: tasks/packages.yml
|
- include: tasks/packages.yml
|
||||||
- include: tasks/harden.yml
|
- include: tasks/harden.yml
|
||||||
|
|
||||||
|
|
||||||
|
# Desktops and laptops
|
||||||
- hosts: workstation
|
- hosts: workstation
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- include: tasks/flatpaks.yml
|
- include: tasks/flatpaks.yml
|
||||||
|
@ -13,8 +13,8 @@
|
|||||||
- name: Remove packages that may come with an OS but are being installed as Flatpak
|
- name: Remove packages that may come with an OS but are being installed as Flatpak
|
||||||
package:
|
package:
|
||||||
name:
|
name:
|
||||||
- {{ firefox[ansible_distribution] }}
|
- {{ package_name.firefox }}
|
||||||
- {{ thunderbird[ansible_distribution] }}
|
- {{ package_name.thunderbird }}
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
- name: Install Discord
|
- name: Install Discord
|
||||||
|
@ -1,14 +0,0 @@
|
|||||||
---
|
|
||||||
# Define what the program name is on each OS so we can use package builtin. like this:
|
|
||||||
|
|
||||||
# POP!_OS
|
|
||||||
firefox["Pop!_OS"]: firefox
|
|
||||||
thunderbird["Pop!_OS"]: thunderbird
|
|
||||||
|
|
||||||
# Ubuntu
|
|
||||||
firefox["Ubuntu"]: firefox
|
|
||||||
thunderbird["Ubuntu"]: thunderbird
|
|
||||||
|
|
||||||
# FreeBSD
|
|
||||||
firefox["FreeBSD"]: firefox
|
|
||||||
thunderbird["FreeBSD"]: thunderbird
|
|
Loading…
x
Reference in New Issue
Block a user