Remove Share Drives (#28)

* Add another requirement for Debian to download key.

* Add setup script instead of using scm.hyperling.com.

* Fix setup permissions.

* Starting effort to remove share drives from script. Downsizing homelab.

* Remove files which are no longer useful without mounts.

* Allow initializing on alternate branches.

* Fix Lynis and NMap log locations.

* Remove deleted files from main.

* Fix nmap filename.

* Remove _name from report variables.
This commit is contained in:
2022-08-23 19:22:27 -05:00
committed by GitHub
parent cb9ae5eb18
commit 3109891a7e
17 changed files with 63 additions and 405 deletions

View File

@ -1,16 +0,0 @@
---
# SSH keys for day-to-day system usage.
# Debian's ansible is too old to use this.
#- name: Create Root's SSH Key
# openssh_keypair:
# path: /root/.ssh/id_rsa
- name: General | Account Management | Keys | Root | Create SSH
shell: ssh-keygen -t rsa -N '' -f ~/.ssh/id_rsa <<< n
args:
executable: "{{ bash_exec.stdout }}"
ignore_errors: yes
- name: General | Account Management | Keys | Root | Copy SSH to 1337
shell: ssh-copy-id -i /root/.ssh/id_rsa {{ leet_ssh }}

View File

@ -1,69 +0,0 @@
---
# Mount shares that all systems should have.
# Test if this machine can use SSHFS
- name: General | Account Management | Mounts | Create Test Folder
file:
path: "/mnt/test"
state: directory
mode: '0755'
- name: General | Account Management | Mounts | Enable SSHFS (FreeBSD)
shell: "{{ load_fusefs }}"
ignore_errors: yes
when: ansible_system == "FreeBSD"
- name: General | Account Management | Mounts | Test SSHFS
shell: "sshfs {{ leet_ssh }}: /mnt/test -o allow_other"
register: sshfs_test
ignore_errors: yes
# Begin setting up 1337
- name: General | Account Management | Mounts | Create 1337 Folder
file:
path: "{{ leet_drive }}"
state: directory
mode: '0755'
# Linux uses fstab
- name: General | Account Management | Mounts | Create 1337 fstab Entry
blockinfile:
path: /etc/fstab
block: |
{{ leet_ssh }}: /mnt/leet fuse.sshfs defaults,_netdev,allow_other 0 0
marker: '# {mark} MANAGED BY ANSIBLE | 1337 Share'
state: present
backup: yes
when: ansible_system == "Linux" and
(not sshfs_test.failed or leet_drive_details.stat.exists)
- name: General | Account Management | Mounts | Mount All (Linux)
shell: mount -a
args:
warn: false
when: ansible_system == "Linux" and
(not sshfs_test.failed or leet_drive_details.stat.exists)
# FreeBSD has to do this via root cron job, fstab is unhappy
- name: General | Account Management | Mounts | Unmount 1337 (FreeBSD)
shell: umount -f /mnt/leet
args:
warn: false
when: ansible_system == "FreeBSD" and
(not sshfs_test.failed or leet_drive_details.stat.exists)
ignore_errors: yes
- name: General | Account Management | Mounts | Remount 1337 (FreeBSD)
shell: "{{ sshfs_leet_cmd }}"
when: ansible_system == "FreeBSD" and
(not sshfs_test.failed or leet_drive_details.stat.exists)
# Ensure correct cron jobs and other downstream dependencies are done properly.
- name: General | Account Management | Mounts | Refresh Variable leet_drive_details
stat:
path: "{{ leet_drive }}/Temp/ansible"
register: leet_drive_details