Hyperling 451e76559d
Add Git Server To Keep ansible-pull Traffic Local (#21)
* Fedora Minimal does not come with tar. Need installed for Telegraf.

* First attempt at automating HTTP git server setup.

* Add cron jobs to keep projects up to date.

* Add new git playbook to server.

* Add new server variables for git. Put all variables in a dictionary.

* Put variables into run file.

* Fix the loop variables to be dictionaries, not jinja.

* Upgrade nanominer.

* Attempt to fix templating error.

* Attempt to fix templating error, but in the right spot this time. :)

* Attempt another fix for building list of dictionaries.

* Change strings to dicts.

* Add quotes for jinja variables.

* Remove extra curly brackets.

* Fix the rest of the file's dictionaries now that General works.

* Remove testing code.

* Variablize ansible repo. Begin watching personal repos rather than pinging GitHub.

* Fix variables to append, not replace.

* Fix variable names.

* Try to prevent variables from being strings, without getting formatting error.

* Try to fix variables, again.

* Fixed git.yml. Found a way to test locally and all is working now.
2021-12-24 14:55:21 -06:00

91 lines
3.2 KiB
YAML

---
# Define file, folder, and other facts per OS.
- name: General | Facts | System | Global
set_fact:
leet_ssh: '{{ user }}@leet'
leet_drive: /mnt/leet
lynis_install_dir: /usr/local/lynis
dwm_install_dir: /usr/local/src/dwm
st_install_dir: /usr/local/src/st
global_bin: /usr/local/bin
x_desktops: /usr/share/xsessions
repo_github: https://github.com/Hyperling/ansible.git
repo_local: https://git.hyperling.com/ansible.git
- name: General | Facts | System | Dev
set_fact:
repo_local: https://git.hyperling.com/ansible-dev.git
when: branch == "dev"
- name: General | Facts | System | Linux
set_fact:
rc_conf: /dev/null
sudoers_install_dir: /etc/sudoers.d/
shutdown_command: sudo shutdown -h now
when: ansible_system == "Linux"
- name: General | Facts | System | FreeBSD
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 | 1337 Drive Mounted?
stat:
path: "{{ leet_drive }}/Temp/ansible"
register: leet_drive_details
- name: General | Facts | System | Report Location = 1337
set_fact:
report_location: "{{ leet_drive }}/Temp/ansible"
when: leet_drive_details.stat.exists
- name: General | Facts | System | Report Location = /root
set_fact:
report_location: "/root"
report_scp_location: "Temp/ansible"
when: not leet_drive_details.stat.exists
- name: General | Facts | System | Report File Names
set_fact:
heartbeat_report_name: "{{ ansible_hostname }}.txt"
ansible_pull_report_name: "{{ ansible_hostname }}_last_pull_times.txt"
lynis_report_name: "{{ ansible_hostname }}_lynis.txt"
nmap_report_name: "{{ ansible_hostname }}_nmap.txt"
- name: General | Facts | System | Report Locations (SSHFS)
set_fact:
heartbeat_report: "{{ report_location }}/{{ heartbeat_report_name }}"
ansible_pull_report: "{{ report_location }}/pull/{{ ansible_pull_report_name }}"
lynis_report: "{{ report_location }}/lynis/{{ lynis_report_name }}"
nmap_report: "{{ report_location }}/nmap/{{ nmap_report_name }}"
when: leet_drive_details.stat.exists
- name: General | Facts | System | Report Locations (Local)
set_fact:
heartbeat_report: "{{ report_location }}/{{ heartbeat_report_name }}"
ansible_pull_report: "{{ report_location }}/{{ ansible_pull_report_name }}"
lynis_report: "{{ report_location }}/{{ lynis_report_name }}"
nmap_report: "{{ report_location }}/{{ nmap_report_name }}"
when: not leet_drive_details.stat.exists
- name: General | Facts | System | Report Destinations (SCP)
set_fact:
heartbeat_report_scp: "{{ leet_ssh }}:{{ report_scp_location }}/{{ heartbeat_report_name }}"
ansible_pull_report_scp: "{{ leet_ssh }}:{{ report_scp_location }}/pull/{{ ansible_pull_report_name }}"
lynis_report_scp: "{{ leet_ssh }}:{{ report_scp_location }}/lynis/{{ lynis_report_name }}"
nmap_report_scp: "{{ leet_ssh }}:{{ report_scp_location }}/nmap/{{ nmap_report_name }}"
when: not leet_drive_details.stat.exists
- name: General | Facts | System | Ansible Branch
set_fact:
branch: main
when: branch is not defined