Changeset - 9a7bb723141c
[Not reviewed]
0 1 1
x - 19 months ago 2023-10-13 21:49:34
xbr@c3l.lu
feat: add main website setup
2 files changed with 33 insertions and 1 deletions:
0 comments (0 inline, 0 general)
web/install_website.yml
Show inline comments
 
@@ -12,7 +12,9 @@
 
    - name: Setup TLS and nginx for site
 
      ansible.builtin.include_tasks:
 
        file: "{{ ansible_repo_dir }}/web/tasks/base_website_setup.yml"
 
    - name: Copy files for site
 
    - name: Setup the Hugo main website
 
      ansible.builtin.include_tasks:
 
        file: "{{ ansible_repo_dir }}/web/tasks/hugo.yml"
 
    - name: Reload nginx
 
      ansible.builtin.service:
 
        name: nginx
web/tasks/hugo.yml
Show inline comments
 
new file 100644
 
---
 
# Setup the Hugo website
 
- name: "Get package facts"
 
  package_facts:
 
    manager: "apt"
 
- name: "Install Hugo"
 
  ansible.builtin.apt:
 
    deb: "https://github.com/gohugoio/hugo/releases/download/v0.119.0/hugo_extended_0.119.0_linux-amd64.deb"
 
    state: present
 
  become: true
 
  when: "'hugo' not in ansible_facts.packages"
 
- name: "Make sure repos directory exists"
 
  ansible.builtin.file:
 
    path: "~/repos"
 
    state: directory
 
  become: true
 
  become_user: fflux
 
- name: "Clone website repo"
 
  ansible.builtin.git:
 
    repo: "ssh://kallithea@projects.c3l.lu/freifunk/web/website"
 
    dest: "/home/fflux/repos/website"
 
    version: "main"
 
  become: true
 
  become_user: fflux
 
- name: "Build the website"
 
  ansible.builtin.command:
 
    chdir: "/home/fflux/repos/website"
 
    cmd: "hugo --minify"
 
  become: true
 
  become_user: fflux
 
\ No newline at end of file
0 comments (0 inline, 0 general)