Gogs as role.
This commit is contained in:
@@ -17,12 +17,17 @@
|
||||
- syncthing.rudolf.com.ua
|
||||
- smarthome.rudolf.com.ua
|
||||
- torrent.rudolf.com.ua
|
||||
- part.syncthing.rudolf.com.ua
|
||||
# - static.rudolf.com.ua
|
||||
# - dev.rudolf.com.ua
|
||||
# - ejudge.rudolf.com.ua
|
||||
# - webmin.rudolf.com.ua
|
||||
# - bitsync.rudolf.com.ua
|
||||
# - wa.rudolf.com.ua
|
||||
# - part.syncthing.rudolf.com.ua
|
||||
# - static.rudolf.com.ua
|
||||
# - dev.rudolf.com.ua
|
||||
# - ejudge.rudolf.com.ua
|
||||
# - webmin.rudolf.com.ua
|
||||
# - bitsync.rudolf.com.ua
|
||||
# - wa.rudolf.com.ua
|
||||
|
||||
- hosts: serva4og
|
||||
become: yes
|
||||
roles:
|
||||
- { role: gogs }
|
||||
|
||||
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
---
|
||||
- hosts: serva4og
|
||||
vars:
|
||||
user: rudolf
|
||||
become: yes
|
||||
|
||||
tasks:
|
||||
|
||||
- name: install packages
|
||||
apt: name={{ item }} update_cache=yes state=latest
|
||||
with_items:
|
||||
- docker.io
|
||||
- python-docker
|
||||
|
||||
- name: user {{ user }}
|
||||
user:
|
||||
name: "{{ user }}"
|
||||
groups: docker
|
||||
append: yes
|
||||
|
||||
- name: run gogs docker
|
||||
docker:
|
||||
name: gogs
|
||||
image: gogs/gogs
|
||||
detach: True
|
||||
restart_policy: always
|
||||
net: default
|
||||
volumes:
|
||||
- "/var/gogs:/data"
|
||||
ports:
|
||||
- "0.0.0.0:{{ gogs_port }}:3000"
|
||||
- "0.0.0.0:{{ gogs_ssh }}:22"
|
||||
state: reloaded
|
||||
|
||||
|
||||
- name: oauth config
|
||||
blockinfile:
|
||||
dest: /var/gogs/gogs/conf/app.ini
|
||||
block: |
|
||||
[oauth]
|
||||
ENABLED = true
|
||||
|
||||
[oauth.google]
|
||||
ENABLED = true
|
||||
CLIENT_ID = `259977835489-5lrmult5iimh3f7dik848fb00mn8td2j.apps.googleusercontent.com`
|
||||
CLIENT_SECRET = `3xzC51fw-yBeWv63pxYlmYE7`
|
||||
SCOPES = `https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile`
|
||||
AUTH_URL = `https://accounts.google.com/o/oauth2/auth`
|
||||
TOKEN_URL = `https://accounts.google.com/o/oauth2/token`
|
||||
|
||||
notify: restart gogs docker
|
||||
|
||||
|
||||
|
||||
|
||||
handlers:
|
||||
- name: restart gogs docker
|
||||
service:
|
||||
name: docker
|
||||
state: restarted
|
||||
restart_policy: always
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
- name: restart gogs docker
|
||||
service:
|
||||
name: docker
|
||||
state: restarted
|
||||
restart_policy: always
|
||||
@@ -0,0 +1,13 @@
|
||||
galaxy_info:
|
||||
author: your name
|
||||
description: your description
|
||||
company: your company (optional)
|
||||
|
||||
license: license (GPLv2, CC-BY, etc)
|
||||
|
||||
min_ansible_version: 1.2
|
||||
|
||||
galaxy_tags: []
|
||||
|
||||
dependencies: []
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
- name: install packages
|
||||
apt: name={{ item }} update_cache=yes state=latest
|
||||
with_items:
|
||||
- docker.io
|
||||
- python-docker
|
||||
|
||||
- name: user {{ ansible_ssh_user }}
|
||||
user:
|
||||
name: "{{ ansible_ssh_user }}"
|
||||
groups: docker
|
||||
append: yes
|
||||
|
||||
- name: run gogs docker
|
||||
docker:
|
||||
name: gogs
|
||||
image: gogs/gogs
|
||||
detach: True
|
||||
restart_policy: always
|
||||
net: default
|
||||
volumes:
|
||||
- "/var/gogs:/data"
|
||||
ports:
|
||||
- "0.0.0.0:{{ gogs_port }}:3000"
|
||||
# - "0.0.0.0:{{ gogs_ssh }}:22"
|
||||
state: reloaded
|
||||
|
||||
|
||||
- name: oauth config
|
||||
blockinfile:
|
||||
dest: /var/gogs/gogs/conf/app.ini
|
||||
block: |
|
||||
[oauth]
|
||||
ENABLED = true
|
||||
|
||||
[oauth.google]
|
||||
ENABLED = true
|
||||
CLIENT_ID = `259977835489-5lrmult5iimh3f7dik848fb00mn8td2j.apps.googleusercontent.com`
|
||||
CLIENT_SECRET = `3xzC51fw-yBeWv63pxYlmYE7`
|
||||
SCOPES = `https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile`
|
||||
AUTH_URL = `https://accounts.google.com/o/oauth2/auth`
|
||||
TOKEN_URL = `https://accounts.google.com/o/oauth2/token`
|
||||
|
||||
notify: restart gogs docker
|
||||
|
||||
Reference in New Issue
Block a user