ara-infra/roles/website/tasks/main.yaml
David Moreau Simard dda029ec43
Add role to deploy the website and Zuul job to test it
This adds a role which:
- Sets up user/group/logging for Hugo
- Retrieves and installs the hugo from upstream release
- Sets up a systemd unit file to keep the hugo server running
- Installs and configure nginx as a reverse proxy to the hugo server
  to serve ara.recordsansible.org

I'm not sure yet if keeping the hugo server running is the way to
go or if we should regenerate the static files every time.

It sort of goes against the point of hugo to use the server but
the fact that it reloads automatically when the source changes could
come in handy for automated updates.

Change-Id: I40e833a27117f9ec5003007bb08a677e16734e55
2018-11-21 14:58:53 -05:00

43 lines
1.4 KiB
YAML

---
# Copyright (c) 2018 Red Hat, Inc.
#
# This file is part of ARA Records Ansible.
#
# ARA is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# ARA is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with ARA. If not, see <http://www.gnu.org/licenses/>.
# Zuul already prepares the src repository on the remote node and
# Zuul doesn't let you run pipe lookups on executors for security purposes
- name: Symlink ara-infra to persistent location with Zuul
become: yes
file:
src: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}"
dest: /opt/ara-infra
state: link
when: zuul is defined
# git rev-parse --show-toplevel returns the root git directory
- name: Copy ara-infra to persistent location
become: yes
synchronize:
src: "{{ lookup('pipe', 'git rev-parse --show-toplevel') }}"
dest: /opt/
delete: yes
when: zuul is not defined
- name: Set up Hugo
include_tasks: hugo.yaml
- name: Set up nginx
include_tasks: nginx.yaml