Browse Source

add homepage role

master
cinnaboot 3 years ago
parent
commit
f626311c44
  1. 4
      all.yml
  2. 2
      roles/haproxy/templates/haproxy.cfg.j2
  3. 46
      roles/homepage/tasks/main.yml

4
all.yml

@ -36,3 +36,7 @@
- hosts: file-host - hosts: file-host
tags: containers, file-host tags: containers, file-host
roles: [file-host] roles: [file-host]
- hosts: homepage
tags: containers, homepage
roles: [homepage]

2
roles/haproxy/templates/haproxy.cfg.j2

@ -41,7 +41,7 @@ frontend main
{% endif %} {% endif %}
{% endfor %} {% endfor %}
default_backend gitea default_backend homepage
{% for c in groups['containers'] %} {% for c in groups['containers'] %}
{# NOTE: don't add haproxy to list of containers :P #} {# NOTE: don't add haproxy to list of containers :P #}

46
roles/homepage/tasks/main.yml

@ -0,0 +1,46 @@
---
- name: install packages
apk:
name:
- lighttpd
state: installed
- vars:
block:
- name: start and enable lighttpd
service:
name: lighttpd
state: restarted
enabled: yes
- name: add homepage user
user:
name: homepage
home: /var/www/localhost
password: ''
- name: set homepage user as owner of http docroot
file:
path: /var/www/localhost
state: directory
recurse: yes
owner: homepage
group: homepage
- name: add ssh path for homepage user
file:
path: /var/www/localhost/.ssh
state: directory
owner: homepage
group: homepage
mode: 0700
- name: copy ssh pubkey for homepage user
copy:
remote_src: yes
owner: homepage
group: homepage
src: /root/.ssh/authorized_keys
dest: /var/www/localhost/.ssh/authorized_keys
mode: 0600
Loading…
Cancel
Save