From 246e83a13a3865e25b5e0eb3fe20576c492f6102 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Tue, 13 Jul 2021 08:10:14 -0500 Subject: [PATCH] Allow choosing Github branch dynamically. --- facts/general/system.yml | 8 +++++++- hosts | 8 ++++++-- tasks/general/cron/ansible.yml | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/facts/general/system.yml b/facts/general/system.yml index b73651d..7f3eb15 100644 --- a/facts/general/system.yml +++ b/facts/general/system.yml @@ -66,4 +66,10 @@ 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 \ No newline at end of file + when: not leet_drive_details.stat.exists + + +- name: General | Facts | System | Ansible Branch + set_fact: + branch: main + when: branch is not defined \ No newline at end of file diff --git a/hosts b/hosts index 4510e6b..59e95c5 100644 --- a/hosts +++ b/hosts @@ -1,3 +1,7 @@ +;;;;;;; Available options - all require lowercase values ;;;;;; +; branch : Provide the Github branch that the machine should poll. +; Exampel: main, dev +; [everything] localhost @@ -83,5 +87,5 @@ reverse-proxy certbot=true nextcloud certbot=true wordpress certbot=true usb-server -parrotsec-dev-www domain=hyperling.com hugo=true hugo_site_path=/mnt/leet/Code/parrotsec/website -my-parrotsec-dev-www hugo=true domain=hyperling.com hugo_site_path=/mnt/leet/Code/parrotsec/website-hyperling +parrotsec-dev-www branch=dev domain=hyperling.com hugo=true hugo_site_path=/mnt/leet/Code/parrotsec/website +my-parrotsec-dev-www branch=dev hugo=true domain=hyperling.com hugo_site_path=/mnt/leet/Code/parrotsec/website-hyperling diff --git a/tasks/general/cron/ansible.yml b/tasks/general/cron/ansible.yml index 0b74049..3604108 100644 --- a/tasks/general/cron/ansible.yml +++ b/tasks/general/cron/ansible.yml @@ -6,7 +6,7 @@ user: ansible name: "Ansible Sync" minute: "*/15" - job: "sudo {{ ansible_pull_exec.stdout }} -o -U https://github.com/Hyperling/ansible.git --checkout main" + job: "sudo {{ ansible_pull_exec.stdout }} -o -U https://github.com/Hyperling/ansible.git --checkout {{ branch }}" state: present disabled: no