From a62336f13990f348427c8e19bad9290b493db3da Mon Sep 17 00:00:00 2001 From: Hyperling Date: Tue, 13 Jul 2021 06:47:31 -0500 Subject: [PATCH] Release HUGO and scm-dev.sh additions. (#1) * Create HUGO file. * Add HUGO. * Add script for running system against development branch. --- hosts | 9 +++++++-- local.yml | 3 +++ tasks/general/cron/ansible.yml | 2 +- tasks/general/scripts/root.yml | 21 ++++++++++++++++++++- tasks/server/software/hugo.yml | 17 +++++++++++++++++ 5 files changed, 48 insertions(+), 4 deletions(-) create mode 100644 tasks/server/software/hugo.yml diff --git a/hosts b/hosts index 6f6633b..9a5da0d 100644 --- a/hosts +++ b/hosts @@ -51,7 +51,7 @@ x570 amdgpu=true nanominer=true nanominer_gpu=eth nanominer_gpus=0 nanominer_gpu [server] ;;;;;;; Parameters ;;;;;; ; -; domain : Set to the domain which gives the server its FQDN +; domain : Set to the domain which gives the server its FQDN. ; Example: hyperling.com ; ; onlyoffice : Set to anything for this server to be configured as an OnlyOffice server. @@ -66,7 +66,10 @@ x570 amdgpu=true nanominer=true nanominer_gpu=eth nanominer_gpus=0 nanominer_gpu ; influxdb2 : Set to anything for this server to be configured as an Influx 2 DB + web server. ; Example: true ; -; certbot : Set to anything to add cron job for `certbot renew` +; certbot : Set to anything to add cron job for `certbot renew`. +; Example: true +; +; hugo : Set to anything to install HUGO static website generator. ; Example: true ; onlyoffice domain=hyperling.com onlyoffice=true @@ -80,3 +83,5 @@ reverse-proxy certbot=true nextcloud certbot=true wordpress certbot=true usb-server +parrotsec-dev-www hugo=true domain=hyperling.com +my-parrotsec-dev-www hugo=true domain=hyperling.com \ No newline at end of file diff --git a/local.yml b/local.yml index f276aee..14a0b1e 100644 --- a/local.yml +++ b/local.yml @@ -140,6 +140,9 @@ - include: tasks/server/cron/certbot.yml when: certbot is defined + - include: tasks/server/software/hugo.yml + when: hugo is defined + # Provide information for analysis. diff --git a/tasks/general/cron/ansible.yml b/tasks/general/cron/ansible.yml index 2681659..0b74049 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" + job: "sudo {{ ansible_pull_exec.stdout }} -o -U https://github.com/Hyperling/ansible.git --checkout main" state: present disabled: no diff --git a/tasks/general/scripts/root.yml b/tasks/general/scripts/root.yml index 6bdbb74..281ee0c 100644 --- a/tasks/general/scripts/root.yml +++ b/tasks/general/scripts/root.yml @@ -35,4 +35,23 @@ - name: General | Scripts | Root | push.sh Permissions file: path: "{{ user_root.home }}/bin/push.sh" - mode: '0755' \ No newline at end of file + mode: '0755' + + +- name: General | Scripts | Root | scm-dev.sh + blockinfile: + path: "{{ user_root.home }}/bin/scm-dev.sh" + block: | + # 20210713 - Make life easier for development! + push.sh + {{ ansible_pull_exec.stdout }} -U https://github.com/Hyperling/ansible.git --checkout dev + marker: '{mark}' + marker_begin: "#!{{ bash_exec.stdout }}" + marker_end: "exit 0" + state: present + create: yes + +- name: General | Scripts | Root | scm-dev.sh Permissions + file: + path: "{{ user_root.home }}/bin/scm-dev.sh" + mode: '0755' diff --git a/tasks/server/software/hugo.yml b/tasks/server/software/hugo.yml new file mode 100644 index 0000000..c81a813 --- /dev/null +++ b/tasks/server/software/hugo.yml @@ -0,0 +1,17 @@ +# Install HUGO to host sites like parrotsec.org + +- name: Server | Software | HUGO | Variables (apt) + set_fact: + hugo_package: hugo + when: ansible_pkg_mgr == "apt" + +- name: Server | Software | HUGO | Variables (FreeBSD) + set_fact: + hugo_package: gohugo + when: ansible_system == "FreeBSD" + + +- name: Server | Software | HUGO | Variables (FreeBSD) + package: + name: "{{ hugo_package }}" + state: present \ No newline at end of file