78 lines
2.5 KiB
YAML
78 lines
2.5 KiB
YAML
---
|
|
# Define file, folder, and other facts per OS.
|
|
|
|
- name: General | Facts | System | Global 01
|
|
ansible.builtin.set_fact:
|
|
global_src: /usr/local/src
|
|
global_bin: /usr/local/bin
|
|
x_desktops: /usr/share/xsessions
|
|
git_repo_http: "https://{{ git_host }}/{{ git_user }}/{{ git_project }}"
|
|
git_repo_ssh: "ssh://git@{{ git_host }}:{{ git_ssh_port }}/{{ git_user }}/{{ git_project }}"
|
|
notify_log: "ansible.notify.log"
|
|
runit_script_dir: /etc/runit/sv
|
|
runit_service_dir: /etc/runit/runsvdir/default
|
|
runit_service_script: run
|
|
runit_log_dir: log
|
|
global_log: /var/log
|
|
global_log_config: config
|
|
runit_finish_sleep: |
|
|
#!/bin/sh
|
|
exec 2>&1
|
|
# $1 is the exit code, $2 is the exit status byte (signal number if killed)
|
|
echo "FINISH: Service returned with exit code: $1 and status: $2"
|
|
|
|
sleep_long=30
|
|
sleep_short=1
|
|
if [[ "$1" != 0 ]]; then
|
|
echo "FINISH: Sleeping for $sleep_long seconds due to error..."
|
|
sleep $sleep_long
|
|
else
|
|
echo "FINISH: Sleeping for $sleep_short seconds."
|
|
sleep $sleep_short
|
|
fi
|
|
|
|
- name: General | Facts | System | Global 02
|
|
ansible.builtin.set_fact:
|
|
shared_rc_install_dir: "{{ global_src }}/env-shared"
|
|
notify_log_file: "/var/log/{{ notify_log }}"
|
|
notify_log_file_wip: "/tmp/{{ notify_log }}.wip"
|
|
lynis_install_dir: "{{ global_src }}/lynis"
|
|
dwm_install_dir: "{{ global_src }}/dwm"
|
|
st_install_dir: "{{ global_src }}/st"
|
|
runit_log_script: "{{ runit_service_script }}"
|
|
|
|
- name: General | Facts | System | Global 03
|
|
ansible.builtin.set_fact:
|
|
shared_rc_bin: "{{ shared_rc_install_dir }}/bin-shared"
|
|
|
|
- name: General | Facts | System | Linux
|
|
ansible.builtin.set_fact:
|
|
rc_conf: /dev/null
|
|
sudoers_install_dir: /etc/sudoers.d/
|
|
sudoers_config: /etc/sudoers
|
|
shutdown_command: sudo shutdown -h now
|
|
when: ansible_system == "Linux"
|
|
|
|
- name: General | Facts | System | FreeBSD
|
|
ansible.builtin.set_fact:
|
|
rc_conf: /etc/rc.conf
|
|
sudoers_install_dir: /usr/local/etc/sudoers.d/
|
|
shutdown_command: sudo shutdown -p now
|
|
when: ansible_system == "FreeBSD"
|
|
|
|
- name: General | Facts | System | Report File Names
|
|
ansible.builtin.set_fact:
|
|
lynis_report: "lynis_hardness_check.txt"
|
|
nmap_report: "nmap_port_check.txt"
|
|
|
|
- name: General | Facts | System | Ansible Branch
|
|
ansible.builtin.set_fact:
|
|
branch: main
|
|
when: branch is not defined
|
|
|
|
- name: General | Facts | System | runit (Devuan)
|
|
ansible.builtin.set_fact:
|
|
runit_script_dir: /etc/sv
|
|
runit_service_dir: /etc/service
|
|
when: ansible_pkg_mgr == "apt"
|