diff --git a/facts/workstation/package.yml b/facts/workstation/package.yml index 9d6c1ea..d54daff 100644 --- a/facts/workstation/package.yml +++ b/facts/workstation/package.yml @@ -4,6 +4,7 @@ - name: Facts | Workstation | Package | Pop OS set_fact: + flatpak_distro: yes sir firefox: firefox firefox_esr: firefox-esr thunderbird: thunderbird @@ -13,6 +14,7 @@ - name: Facts | Workstation | Package | Debian and Ubuntu set_fact: + flatpak_distro: yes sir firefox: firefox firefox_esr: firefox-esr thunderbird: thunderbird @@ -22,6 +24,7 @@ - name: Facts | Workstation | Package | FreeBSD set_fact: + flatpak_distro: false firefox: firefox firefox_esr: firefox-esr thunderbird: thunderbird diff --git a/facts/workstation/system.yml b/facts/workstation/system.yml deleted file mode 100644 index 8f76223..0000000 --- a/facts/workstation/system.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- -# Define file, folder, and other facts per OS. - -- name: Facts | Workstation | System | Pop OS - set_fact: - flatpak_distro: yes sir - when: ansible_distribution == "Pop!_OS" - - -- name: Facts | Workstation | System | Debian and Ubuntu - set_fact: - flatpak_distro: yes sir - when: ansible_distribution in ("Debian","Ubuntu") - - -- name: Facts | Workstation | System | FreeBSD - set_fact: - flatpak_distro: false - when: ansible_system == "FreeBSD" \ No newline at end of file diff --git a/local.yml b/local.yml index 9d13cdb..7f33bcb 100644 --- a/local.yml +++ b/local.yml @@ -15,6 +15,8 @@ tasks: - include: tasks/general/software/packages.yml + - include: tasks/general/software/services.yml + ignore_errors: yes - include: facts/general/gather.yml @@ -26,9 +28,6 @@ - include: tasks/general/cron/ansible.yml - - include: tasks/general/software/harden.yml - ignore_errors: yes - # Additional setup for systems with GUI. - name: Main | Workstation UI Setup @@ -37,10 +36,14 @@ become: true pre_tasks: - - include: facts/workstation/system.yml - include: facts/workstation/package.yml tasks: + # Set up any systems that do not come with Desktop Environments + - include: tasks/freebsd/software/gui.yml + when: ansible_system == "FreeBSD" + + # Additional tasks to configure Desktop Environments - include: tasks/linux/software/flatpaks.yml when: ansible_system == "Linux" and flatpak_distro == "yes sir" @@ -49,9 +52,6 @@ when: ansible_system == "Linux" and flatpak_distro != "yes sir" - - include: tasks/freebsd/software/gui.yml - when: ansible_system == "FreeBSD" - # Create reports to analyze security. - name: Main | Hardness Tests diff --git a/tasks/freebsd/software/gui.yml b/tasks/freebsd/software/gui.yml index 9bff58f..da6a0df 100644 --- a/tasks/freebsd/software/gui.yml +++ b/tasks/freebsd/software/gui.yml @@ -20,18 +20,31 @@ - name: Workstation | FreeBSD | GUI | Create rc.conf Entries blockinfile: path: /etc/rc.conf + marker: "# {mark} MANAGED BY ANSIBLE | GUI Components" block: | dbus_enable="YES" hald_enable="YES" gnome_enable="YES" gdm_enable="YES" - - fusefs_enable="YES" backup: yes -- name: Workstation | FreeBSD | GUI | Create fstab Entries - blockinfile: +- name: Workstation | FreeBSD | GUI | Create proc fstab Entry + lineinfile: path: /etc/fstab - block: | - proc /proc procfs rw 0 0 + regexp: '^proc' + line: proc /proc procfs rw 0 0 + state: present backup: yes + +- name: Workstation | FreeBSD | GUI | Create proc fstab Comment + lineinfile: + path: /etc/fstab + regexp: '^# MANAGED BY ANSIBLE | Leet Share' + line: '# MANAGED BY ANSIBLE | Leet Share' + state: present + insertbefore: '^proc' + +- name: Workstation | FreeBSD | GUI | Mount All + shell: mount -a + args: + warn: false diff --git a/tasks/general/acct_mgmt/mounts.yml b/tasks/general/acct_mgmt/mounts.yml index df4f42c..292f352 100644 --- a/tasks/general/acct_mgmt/mounts.yml +++ b/tasks/general/acct_mgmt/mounts.yml @@ -7,13 +7,22 @@ state: directory mode: '0755' -- name: General | Account Management | Mounts | Create fstab Entries - blockinfile: +- name: General | Account Management | Mounts | Create 1337 fstab Entry + lineinfile: path: /etc/fstab - block: | - ling@leet: /mnt/leet fuse.sshfs defaults,_netdev,allow_other,delay_connect 0 0 + regexp: '^ling@leet' + line: "ling@leet: /mnt/leet fuse.sshfs defaults,_netdev,allow_other,delay_connect 0 0" + state: present backup: yes +- name: General | Account Management | Mounts | Create 1337 fstab Comment + lineinfile: + path: /etc/fstab + regexp: '^# MANAGED BY ANSIBLE | Leet Share' + line: '# MANAGED BY ANSIBLE | Leet Share' + state: present + insertbefore: '^ling@leet' + - name: General | Account Management | Mounts | Mount All shell: mount -a args: diff --git a/tasks/general/software/harden.yml b/tasks/general/software/harden.yml deleted file mode 100644 index face1c6..0000000 --- a/tasks/general/software/harden.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- - -- name: General | Software | Harden | Remove CUPS Daemon - service: - name: "{{ cups }}" - pattern: "{{ cups_pattern }}" - state: stopped - enabled: no - -- name: General | Software | Harden | Remove CUPS-Browse Daemon - service: - name: "{{ cups_browse }}" - pattern: "{{ cups_browse_pattern }}" - state: stopped - enabled: no diff --git a/tasks/general/software/services.yml b/tasks/general/software/services.yml new file mode 100644 index 0000000..b0ffddc --- /dev/null +++ b/tasks/general/software/services.yml @@ -0,0 +1,40 @@ +--- +# Enable and disable services. + +- name: General | Software | Services | Create SSHFS rc.conf Entry (FreeBSD) + lineinfile: + path: /etc/rc.conf + regexp: '^fusefs_enable=' + line: fusefs_enable="YES" + state: present + backup: yes + when: ansible_system == "FreeBSD" + +- name: General | Software | Services | Create SSHFS rc.conf Comment (FreeBSD) + lineinfile: + path: /etc/fstab + regexp: '^# MANAGED BY ANSIBLE | SSHFS' + line: '# MANAGED BY ANSIBLE | SSHFS' + state: present + insertbefore: '^fusefs_enable=' + when: ansible_system == "FreeBSD" + +- name: General | Software | Services | Load SSHFS (FreeBSD) + shell: kldload fusefs + args: + warn: false + when: ansible_system == "FreeBSD" + +- name: General | Software | Services | Disable CUPS Daemon + service: + name: "{{ cups }}" + pattern: "{{ cups_pattern }}" + state: stopped + enabled: no + +- name: General | Software | Services | Disable CUPS-Browse Daemon + service: + name: "{{ cups_browse }}" + pattern: "{{ cups_browse_pattern }}" + state: stopped + enabled: no \ No newline at end of file