diff --git a/facts/package_name.yml b/facts/package_names.yml similarity index 100% rename from facts/package_name.yml rename to facts/package_names.yml diff --git a/facts/service_names.yml b/facts/service_names.yml new file mode 100644 index 0000000..bb1b8d4 --- /dev/null +++ b/facts/service_names.yml @@ -0,0 +1,28 @@ +--- +# Define what the program name is on each OS so we can use package builtin. like this: + +- name: Set Pop!_OS Service Names + ansible.builtin.set_fact: + cups: cups + cups_pattern: cupsd + cups_browse: cups-browsed + cups_browse_pattern: cups-browsed + when: ansible_distribution == "Pop!_OS" + + +- name: Set Ubuntu Service Names + ansible.builtin.set_fact: + cups: cups + cups_pattern: cupsd + cups_browse: cups-browsed + cups_browse_pattern: cups-browsed + when: ansible_distribution == "Ubuntu" + + +- name: Set FreeBSD Service Names + ansible.builtin.set_fact: + cups: cups + cups_pattern: cupsd + cups_browse: cups-browsed + cups_browse_pattern: cups-browsed + when: ansible_distribution == "FreeBSD" \ No newline at end of file diff --git a/local.yml b/local.yml index e4d994b..48fec43 100644 --- a/local.yml +++ b/local.yml @@ -7,7 +7,8 @@ become: true pre_tasks: - - include: facts/package_name.yml + - include: facts/package_names.yml + - include: facts/service_names.yml tasks: - include: tasks/users.yml diff --git a/tasks/flatpaks.yml b/tasks/flatpaks.yml index c8cc2a0..172f2db 100644 --- a/tasks/flatpaks.yml +++ b/tasks/flatpaks.yml @@ -10,13 +10,7 @@ method: system flatpakrepo_url: https://dl.flathub.org/repo/flathub.flatpakrepo -- name: Remove packages that may come with an OS but are being installed as Flatpak - package: - name: - - "{{ firefox }}" - - "{{ thunderbird }}" - state: absent - +# Hop into installs - name: Install Discord flatpak: name: com.discordapp.Discord @@ -33,3 +27,10 @@ flatpak: name: org.mozilla.Thunderbird +# Remove any applicable repo software +- name: Remove packages that may come with an OS but were just installed as Flatpak + package: + name: + - "{{ firefox }}" + - "{{ thunderbird }}" + state: absent \ No newline at end of file diff --git a/tasks/harden.yml b/tasks/harden.yml index 53f4c4d..050186a 100644 --- a/tasks/harden.yml +++ b/tasks/harden.yml @@ -1,13 +1,13 @@ - name: Remove CUPS Daemon service: - name: cups - pattern: cupsd + name: "{{ cups }}" + pattern: "{{ cups_pattern }}" state: stopped enabled: no - name: Remove CUPS-Browse Daemon service: - name: cups-browsed - pattern: cups-browsed + name: "{{ cups_browse }}" + pattern: "{{ cups_browse_pattern }}" state: stopped enabled: no