2020-03-19 00:57:09 +00:00
|
|
|
---
|
2020-03-19 00:46:09 +00:00
|
|
|
- hosts: all
|
2020-03-22 11:26:48 +00:00
|
|
|
gather_facts: false
|
2020-03-19 00:46:09 +00:00
|
|
|
tasks:
|
2020-03-22 10:53:49 +00:00
|
|
|
- name: Load variables
|
|
|
|
include_vars:
|
|
|
|
dir: "{{ dokku_lib_root }}/data/ansible/gitea/vars/"
|
|
|
|
extensions:
|
2020-03-22 10:54:58 +00:00
|
|
|
- yml
|
2020-03-22 10:53:49 +00:00
|
|
|
|
|
|
|
- name: Set HTTP 80 port proxy
|
|
|
|
dokku_ports:
|
|
|
|
app: gitea
|
|
|
|
mappings:
|
|
|
|
- "http:80:3000"
|
2020-03-23 15:38:48 +00:00
|
|
|
- "http:222:2222"
|
2020-03-22 10:53:49 +00:00
|
|
|
state: present
|
|
|
|
|
|
|
|
- name: Setup LE certificates
|
|
|
|
shell: dokku letsencrypt gitea
|
|
|
|
args:
|
|
|
|
creates: /home/dokku/gitea/letsencrypt/certs
|
|
|
|
|
2020-03-22 11:39:40 +00:00
|
|
|
- name: Setup LE certificates renew cron job
|
|
|
|
shell: dokku letsencrypt:cron-job --add
|
|
|
|
args:
|
|
|
|
creates: /home/dokku/gitea/letsencrypt/cron-job
|
|
|
|
|
2020-03-22 10:53:49 +00:00
|
|
|
- name: Remove automatically configured ports
|
|
|
|
dokku_ports:
|
|
|
|
app: gitea
|
|
|
|
mappings:
|
|
|
|
- "http:3000:3000"
|
2020-03-23 14:14:51 +00:00
|
|
|
- "http:2222:2222"
|
2020-03-22 10:53:49 +00:00
|
|
|
state: absent
|
2020-03-22 11:31:09 +00:00
|
|
|
|
|
|
|
- name: Set HTTP 443 port
|
|
|
|
dokku_ports:
|
|
|
|
app: gitea
|
|
|
|
mappings:
|
|
|
|
- "https:443:3000"
|
|
|
|
state: present
|
2020-03-23 15:21:12 +00:00
|
|
|
|
2020-03-23 17:07:49 +00:00
|
|
|
- name: Ensure jq package is installed
|
|
|
|
apt:
|
|
|
|
name: jq
|
|
|
|
state: present
|
|
|
|
|
|
|
|
- name: Retrieve application container IP address
|
|
|
|
shell: "dokku ps:inspect gitea | jq .[0].NetworkSettings.IPAddress"
|
|
|
|
register: dokku_container_ip
|
|
|
|
|
2020-03-23 15:21:12 +00:00
|
|
|
- name: Symlink the authorized keys configuration
|
2020-03-23 17:07:49 +00:00
|
|
|
vars:
|
|
|
|
ssh_listen_port: "{{ ssh_listen_port }}"
|
|
|
|
dokku_container_ip: "{{ dokku_container_ip }}"
|
2020-03-23 15:21:12 +00:00
|
|
|
file:
|
|
|
|
src: /var/lib/gitea/git/.ssh/authorized_keys
|
|
|
|
dest: /home/git/.ssh/authorized_keys
|
|
|
|
state: link
|
|
|
|
force: true
|
|
|
|
owner: git
|
2020-03-23 15:23:09 +00:00
|
|
|
become: true
|