4e5346e2e0
- Added rsync installation in setup-env action for file synchronization. - Excluded playbook_websites.yml from ansible-apply-playbook workflow. - Created a new workflow for building and releasing the Hugo website. - Added submodule for Hugo theme in .gitmodules. - Updated host_vars for production to include websites configuration. - Introduced playbook_websites.yml for managing static files deployment. - Implemented hugo_build script for building and archiving Hugo sites. - Updated inventory to include a new web group for website deployment. - Refactored Terraform configuration to support new website structure. - Removed deprecated WordPress Terraform configuration. - Added .gitignore files for websites and specific Hugo site. - Created archetype and configuration files for the Hugo site. - Added static assets including CV and images for the Hugo site. - Integrated Hugo profile theme as a submodule for the website.
51 lines
1.3 KiB
YAML
51 lines
1.3 KiB
YAML
---
|
|
- name: Websites (Static Files) Playbook (K8s)
|
|
hosts: web
|
|
gather_facts: true
|
|
|
|
# Specific tasks for this playbook
|
|
tasks:
|
|
- name: Set required facts
|
|
ansible.builtin.set_fact:
|
|
web_home: "{{ persistent_data | default('/var/lib') }}/web"
|
|
web_user_id: 1000
|
|
web_group_id: 1000
|
|
tags: always
|
|
|
|
- name: Create required web data folder
|
|
become: true
|
|
ansible.builtin.file:
|
|
state: directory
|
|
path: "{{ web_home }}"
|
|
mode: "0750"
|
|
owner: "{{ web_user_id }}"
|
|
group: "{{ web_group_id }}"
|
|
tags:
|
|
- tasks
|
|
- tasks::folders
|
|
|
|
- name: Create required web data folder
|
|
become: true
|
|
ansible.builtin.file:
|
|
state: directory
|
|
path: "{{ web_home }}/{{ item }}"
|
|
mode: "0750"
|
|
owner: "{{ web_user_id }}"
|
|
group: "{{ web_group_id }}"
|
|
with_items:
|
|
- "{{ websites | default([]) }}"
|
|
tags:
|
|
- tasks
|
|
- tasks::folders
|
|
|
|
- name: Synchronize websites
|
|
become: true
|
|
ansible.posix.synchronize:
|
|
mode: push
|
|
src: "{{ lookup('env', 'GITHUB_WORKSPACE') + '/websites/releases/'+ item }}/"
|
|
dest: "{{ web_home }}/{{ item }}"
|
|
delete: yes
|
|
recursive: yes
|
|
with_items:
|
|
- "{{ websites | default([]) }}"
|