General FreeBSD and account improvements.
This commit is contained in:
parent
95024e6400
commit
86e1881090
@ -1,6 +1,10 @@
|
|||||||
---
|
---
|
||||||
# Facts that must be gathered after running tasks.
|
# Facts that must be gathered after running tasks.
|
||||||
|
|
||||||
- name: Facts | General | Gather | Locate BASH
|
- name: Facts | General | Gather | Locate bash
|
||||||
shell: which bash
|
shell: which bash
|
||||||
register: bash_exec
|
register: bash_exec
|
||||||
|
|
||||||
|
- name: Facts | General | Gather | Locate ansible-pull
|
||||||
|
shell: which ansible-pull
|
||||||
|
register: ansible_pull_exec
|
||||||
|
@ -1,23 +1,16 @@
|
|||||||
---
|
---
|
||||||
# Define program names per OS for package builtin.
|
# Define program names for package builtin.
|
||||||
# This file is for ALL systems and should not include UI components.
|
# This file is for ALL systems and should not include UI components.
|
||||||
|
|
||||||
- name: Facts | Workstation | Package | Pop OS
|
- name: Facts | Workstation | Package | apt
|
||||||
set_fact:
|
set_fact:
|
||||||
sshfs: sshfs
|
sshfs: sshfs
|
||||||
locate: locate
|
locate: locate
|
||||||
when: ansible_distribution == "Pop!_OS"
|
when: ansible_pkg_mgr == "apt"
|
||||||
|
|
||||||
|
|
||||||
- name: Facts | Workstation | Package | Debian and Ubuntu
|
|
||||||
set_fact:
|
|
||||||
sshfs: sshfs
|
|
||||||
locate: locate
|
|
||||||
when: ansible_distribution in ("Debian","Ubuntu")
|
|
||||||
|
|
||||||
|
|
||||||
- name: Facts | Workstation | Package | FreeBSD
|
- name: Facts | Workstation | Package | FreeBSD
|
||||||
set_fact:
|
set_fact:
|
||||||
sshfs: fusefs-sshfs
|
sshfs: fusefs-sshfs
|
||||||
locate: htop # This is just a placeholder to prevent errors
|
locate: htop # Placeholder to prevent errors. locate builtin FreeBSD.
|
||||||
when: ansible_system == "FreeBSD"
|
when: ansible_system == "FreeBSD"
|
@ -1,22 +1,13 @@
|
|||||||
---
|
---
|
||||||
# Define program names per OS for service builtin.
|
# Define program names for service builtin.
|
||||||
|
|
||||||
- name: Facts | Workstation | Service | Pop OS
|
- name: Facts | Workstation | Service | Linux
|
||||||
set_fact:
|
set_fact:
|
||||||
cups: cups
|
cups: cups
|
||||||
cups_pattern: cupsd
|
cups_pattern: cupsd
|
||||||
cups_browse: cups-browsed
|
cups_browse: cups-browsed
|
||||||
cups_browse_pattern: cups-browsed
|
cups_browse_pattern: cups-browsed
|
||||||
when: ansible_distribution == "Pop!_OS"
|
when: ansible_system == "Linux"
|
||||||
|
|
||||||
|
|
||||||
- name: Facts | Workstation | Service | Debian and Ubuntu
|
|
||||||
set_fact:
|
|
||||||
cups: cups
|
|
||||||
cups_pattern: cupsd
|
|
||||||
cups_browse: cups-browsed
|
|
||||||
cups_browse_pattern: cups-browsed
|
|
||||||
when: ansible_distribution in ("Debian","Ubuntu")
|
|
||||||
|
|
||||||
|
|
||||||
- name: Facts | Workstation | Service | FreeBSD
|
- name: Facts | Workstation | Service | FreeBSD
|
||||||
@ -25,4 +16,5 @@
|
|||||||
cups_pattern: cupsd
|
cups_pattern: cupsd
|
||||||
cups_browse: cups-browsed
|
cups_browse: cups-browsed
|
||||||
cups_browse_pattern: cups-browsed
|
cups_browse_pattern: cups-browsed
|
||||||
|
sshfs_leet_cmd: "sshfs ling@leet: /mnt/leet -o defaults.allow_othher,_netdev"
|
||||||
when: ansible_system == "FreeBSD"
|
when: ansible_system == "FreeBSD"
|
@ -6,7 +6,6 @@
|
|||||||
lynis_install_dir: /usr/local/lynis
|
lynis_install_dir: /usr/local/lynis
|
||||||
lynis_report: /home/ling/lynis.log
|
lynis_report: /home/ling/lynis.log
|
||||||
sudoers_install_dir: /etc/sudoers.d/ansible
|
sudoers_install_dir: /etc/sudoers.d/ansible
|
||||||
ansible_pull_exec: /usr/bin/ansible-pull
|
|
||||||
when: ansible_distribution == "Pop!_OS"
|
when: ansible_distribution == "Pop!_OS"
|
||||||
|
|
||||||
|
|
||||||
@ -15,7 +14,6 @@
|
|||||||
lynis_install_dir: /usr/local/lynis
|
lynis_install_dir: /usr/local/lynis
|
||||||
lynis_report: /root/lynis.log
|
lynis_report: /root/lynis.log
|
||||||
sudoers_install_dir: /etc/sudoers.d/ansible
|
sudoers_install_dir: /etc/sudoers.d/ansible
|
||||||
ansible_pull_exec: /usr/bin/ansible-pull
|
|
||||||
when: ansible_distribution in ("Debian","Ubuntu")
|
when: ansible_distribution in ("Debian","Ubuntu")
|
||||||
|
|
||||||
|
|
||||||
@ -24,5 +22,4 @@
|
|||||||
lynis_install_dir: /usr/local/lynis
|
lynis_install_dir: /usr/local/lynis
|
||||||
lynis_report: /root/lynis.log
|
lynis_report: /root/lynis.log
|
||||||
sudoers_install_dir: /usr/local/etc/sudoers.d/ansible
|
sudoers_install_dir: /usr/local/etc/sudoers.d/ansible
|
||||||
ansible_pull_exec: /usr/local/bin/ansible-pull
|
|
||||||
when: ansible_system == "FreeBSD"
|
when: ansible_system == "FreeBSD"
|
@ -27,6 +27,7 @@
|
|||||||
- include: tasks/general/acct_mgmt/mounts.yml
|
- include: tasks/general/acct_mgmt/mounts.yml
|
||||||
|
|
||||||
- include: tasks/general/cron/ansible.yml
|
- include: tasks/general/cron/ansible.yml
|
||||||
|
- include: tasks/general/cron/root.yml
|
||||||
|
|
||||||
|
|
||||||
# Additional setup for systems with GUI.
|
# Additional setup for systems with GUI.
|
||||||
|
@ -32,4 +32,13 @@
|
|||||||
warn: false
|
warn: false
|
||||||
when: ansible_system == "Linux"
|
when: ansible_system == "Linux"
|
||||||
|
|
||||||
# Add @reboot cron job for FreeBSD, fstab does not like fuse or sshfs as mount type
|
# FreeBSD also has root cron job for this @reboot
|
||||||
|
- name: General | Cron | Root | Create SSHFS Job
|
||||||
|
cron:
|
||||||
|
user: root
|
||||||
|
name: "1337 SSHFS"
|
||||||
|
special_time: reboot
|
||||||
|
job: "{{ sshfs_leet_cmd }}"
|
||||||
|
state: present
|
||||||
|
disabled: no
|
||||||
|
when: ansible_system == "FreeBSD"
|
@ -21,3 +21,11 @@
|
|||||||
create_home: yes
|
create_home: yes
|
||||||
generate_ssh_key: yes
|
generate_ssh_key: yes
|
||||||
#password: "{{ ling_passwd }}"
|
#password: "{{ ling_passwd }}"
|
||||||
|
register: user_ling
|
||||||
|
|
||||||
|
- name: General | Account Management | User | Hyperling TRASH Folder
|
||||||
|
file:
|
||||||
|
path: "{{ user_ling.home }}/TRASH"
|
||||||
|
state: directory
|
||||||
|
mode: '0755'
|
||||||
|
when: user_ling.home != ""
|
@ -1,10 +1,11 @@
|
|||||||
---
|
---
|
||||||
|
# Jobs relating to the ansible user.
|
||||||
|
|
||||||
- name: General | Cron | Ansible | Create Main Job
|
- name: General | Cron | Ansible | Create Subscriber Job
|
||||||
cron:
|
cron:
|
||||||
user: ansible
|
user: ansible
|
||||||
name: "Ansible Sync"
|
name: "Ansible Sync"
|
||||||
minute: "*/15"
|
minute: "*/15"
|
||||||
job: "{{ ansible_pull_exec }} -o -U https://github.com/Hyperling/ansible.git"
|
job: "sudo {{ ansible_pull_exec }} -o -U https://github.com/Hyperling/ansible.git"
|
||||||
state: present
|
state: present
|
||||||
disabled: no
|
disabled: no
|
||||||
|
12
tasks/general/cron/root.yml
Normal file
12
tasks/general/cron/root.yml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
---
|
||||||
|
# Jobs relating to the root user.
|
||||||
|
|
||||||
|
- name: General | Cron | Root | Create SSHFS Job
|
||||||
|
cron:
|
||||||
|
user: root
|
||||||
|
name: "1337 SSHFS"
|
||||||
|
special_time: reboot
|
||||||
|
job: "{{ sshfs_leet_cmd }}"
|
||||||
|
state: present
|
||||||
|
disabled: no
|
||||||
|
when: ansible_system == "FreeBSD"
|
@ -1,4 +1,5 @@
|
|||||||
---
|
---
|
||||||
|
# Lynis hardness check.
|
||||||
|
|
||||||
- name: General | Tests | Lynis | Install
|
- name: General | Tests | Lynis | Install
|
||||||
git:
|
git:
|
||||||
|
3
tasks/general/tests/nmap.yml
Normal file
3
tasks/general/tests/nmap.yml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
# Nmap port test
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user