Changeset - af9bde0c6a76
[Not reviewed]
0 2 0
x - 17 months ago 2023-12-14 22:41:24
xbr@c3l.lu
fix: finish hugo and api tocuhes
2 files changed with 19 insertions and 10 deletions:
0 comments (0 inline, 0 general)
web/tasks/api.yml
Show inline comments
 
---
 
# Setup the API website
 
- name: "Make sure api directory exists"
 
- name: "Make sure repos directory exists"
 
  ansible.builtin.file:
 
    path: "/var/www/api/"
 
    path: "~/public_repos"
 
    state: directory
 
    owner: fflux
 
    group: fflux
 
    mode: '0755'
 
    mode: '1755'
 
  become: true
 
  become_user: fflux
 
- name: "Clone api repo"
 
  ansible.builtin.git:
 
    accept_newhostkey: yes
 
    repo: "ssh://kallithea@projects.c3l.lu/freifunk/web/api"
 
    dest: "/var/www/api/"
 
    dest: "/home/fflux/public_repos/api/"
 
    version: "main"
 
  become: true
 
  become_user: fflux
 
- name: "Symlink to website"
 
  ansible.builtin.file:
 
    src: "/home/fflux/public_repos/api/public"
 
    dest: "/var/www/api"
 
    owner: fflux
 
    group: fflux
 
    state: link
 
  become: true
 
\ No newline at end of file
web/tasks/hugo.yml
Show inline comments
 
@@ -11,25 +11,25 @@
 
  when: "'hugo' not in ansible_facts.packages"
 
- name: "Make sure repos directory exists"
 
  ansible.builtin.file:
 
    path: "~/repos"
 
    path: "~/public_repos"
 
    state: directory
 
    owner: fflux
 
    group: fflux
 
    mode: '1750'
 
    mode: '1755'
 
  become: true
 
  become_user: fflux
 
- name: "Clone website repo"
 
  ansible.builtin.git:
 
    accept_newhostkey: true
 
    repo: "ssh://kallithea@projects.c3l.lu/freifunk/web/website"
 
    dest: "/home/fflux/repos/website"
 
    version: "main"
 
    dest: "/home/fflux/public_repos/website"
 
    version: "testing"
 
  become: true
 
  become_user: fflux
 
  register: hugo_website_cloned
 
- name: "Build the website"
 
  ansible.builtin.command:
 
    chdir: "/home/fflux/repos/website"
 
    chdir: "/home/fflux/public_repos/website"
 
    cmd: "hugo --minify"
 
  become: true
 
  become_user: fflux
 
@@ -38,7 +38,7 @@
 
  changed_when: hugo_website_built.rc == 0
 
- name: "Symlink to website"
 
  ansible.builtin.file:
 
    src: "/home/fflux/repos/website"
 
    src: "/home/fflux/public_repos/website/public"
 
    dest: "/var/www/website"
 
    owner: fflux
 
    group: fflux
0 comments (0 inline, 0 general)