masto-aio/ansible/roles/phanpy/tasks/main.yaml

54 lines
1.1 KiB
YAML

---
#- name: install base apps
# apt:
# force_apt_get: yes
# name:
# - git
- name: phanpy path
file:
path: "/srv/nginx/static/phanpy"
state: directory
recurse: true
- name: source
git:
repo: "https://tea.entar.net/teh/mastodon.git"
dest: /srv/mastodon/src
version: deploy
- name: get phanpy url
shell: |
curl -s "https://api.github.com/repos/cheeaun/phanpy/releases/latest" | grep /phanpy-dist.tar.gz | cut -d '"' -f 4
args:
executable: /bin/bash
register: phanpyurl
#- name: get phanpy release
# get_url:
# url: "{{ phanpyurl.stdout }}"
# dest: /tmp/phanpy-dist.tar.gz
- name: unzip release
unarchive:
src: "{{ phanpyurl.stdout }}"
dest: /srv/nginx/static/phanpy
remote_src: yes
- name: nginx static conf
copy:
dest: /srv/nginx/static.d/phanpy.conf
content: |
location /phanpy/ {
autoindex off;
alias /static/phanpy/;
index index.html;
include /etc/nginx/mime.types;
}
register: nginxconf
- name: reload nginx
command: docker exec -t nginx nginx -s reload
when: nginxconf.changed or phanpyurl.changed