From 5c47f396ec327f3b779592e4fc314f05795a2bcb Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sun, 31 Jan 2021 15:38:46 -0600 Subject: [PATCH] Starting to test Ubuntu Server. Need to find a way to get it working without putting it in the hosts file. --- facts/system.yml | 8 ++++---- facts/user.yml | 9 ++------- hosts | 11 ++++------- local.yml | 20 +++++++------------- 4 files changed, 17 insertions(+), 31 deletions(-) diff --git a/facts/system.yml b/facts/system.yml index ec75fcf..a6bfe6a 100644 --- a/facts/system.yml +++ b/facts/system.yml @@ -1,7 +1,7 @@ --- # Define what the file and folder names should be on each OS. -- name: Set Pop!_OS FS Names +- name: Set Pop!_OS Desktop Facts ansible.builtin.set_fact: flatpak_distro: yes lynis_install_dir: /usr/local/lynis @@ -11,16 +11,16 @@ # TODO Needs tested -- name: Set Ubuntu FS Names +- name: Set Debian+Ubuntu Server Facts ansible.builtin.set_fact: flatpak_distro: yes lynis_install_dir: /usr/local/lynis lynis_report: /root/lynis.log sudoers_install_dir: /etc/sudoers.d/ansible - when: ansible_distribution == "Ubuntu" + when: ansible_distribution in ("Debian","Ubuntu") -- name: Set FreeBSD FS Names +- name: Set FreeBSD Facts ansible.builtin.set_fact: flatpak_distro: no lynis_install_dir: /usr/local/lynis diff --git a/facts/user.yml b/facts/user.yml index 648feab..622abf3 100644 --- a/facts/user.yml +++ b/facts/user.yml @@ -3,15 +3,10 @@ - name: Set Linux User Variables ansible.builtin.set_fact: - root: root root_group: root - ansible: ansible - when: ansible_distribution == "Pop!_OS" or - ansible_distribution == "Ubuntu" + when: ansible_system == "Linux" - name: Set FreeBSD User Variables ansible.builtin.set_fact: - root: root root_group: wheel - ansible: ansible - when: ansible_distribution == "FreeBSD" \ No newline at end of file + when: ansible_system == "FreeBSD" \ No newline at end of file diff --git a/hosts b/hosts index 2c9b7fe..033135a 100644 --- a/hosts +++ b/hosts @@ -1,12 +1,9 @@ +[all] +localhost + [workstation] x570 dell-laptop [server] -freeboy - -[dad] -not_installed_yet - -[on_a_home_network] -192.168.[0:255].[0:255] +freeboy \ No newline at end of file diff --git a/local.yml b/local.yml index 384a392..b080c54 100644 --- a/local.yml +++ b/local.yml @@ -21,7 +21,7 @@ ignore_errors: yes -# Linux Workstations +# Workstations - name: UI Setup hosts: workstation connection: local @@ -29,19 +29,13 @@ tasks: - include: tasks/flatpaks.yml - when: ansible_distribution != "FreeBSD" - and "{{ flatpak_distro }} == yes" - - -# FreeBSD Workstations -- name: FreeBSD UI Setup - hosts: workstation - connection: local - become: true - - tasks: + when: ansible_system == "Linux" and + "{{ flatpak_distro }} == yes" + - shell: echo "Not implemented yet. :(" + when: ansible_system == "Linux" and + "{{ flatpak_distro }} == no" - include: tasks/freebsd_gui.yml - when: ansible_distribution == "FreeBSD" + when: ansible_system == "FreeBSD" # Run Hardness Checks