Browse Source

Merge pull request #3 from LILiK-117bis/gogs

Gogs and Postgres roles
services
Edoardo Putti 8 years ago
parent
commit
a575e01428
3 changed files with 41 additions and 0 deletions
  1. +6
    -0
      roles/gogs/meta/main.yaml
  2. +19
    -0
      roles/gogs/tasks/main.yaml
  3. +16
    -0
      roles/postgres/tasks/main.yaml

+ 6
- 0
roles/gogs/meta/main.yaml View File

@ -0,0 +1,6 @@
---
dependencies:
- nginx
- { role: nginx_proxy, server_name: "gogs", config_name: "gogs", remote_host: "http://127.0.0.1:3000" }
# fix password
- { role: postgres, db_name: gogs, db_user: gogs, db_user_password: pippo }

+ 19
- 0
roles/gogs/tasks/main.yaml View File

@ -0,0 +1,19 @@
- name: Install dependencies
apt: name={{ item }} state=latest
with_items:
- git
- name: Install Https for APT
apt: name=apt-transport-https update_cache=yes
- name: Add the repository key to system
apt_key: url=https://deb.packager.io/key state=present
- name: Add the package.io repository to the list
apt_repository: repo='deb https://deb.packager.io/gh/pkgr/gogs jessie pkgr' state=present
- name: Install Gogs
apt: name=gogs update_cache=yes
- name: Custom Gogs configuration directory
file: path=/etc/gogs/custom/conf state=directory
- name: Copy Gogs configuration
copy: dest=/etc/gogs/custom/conf/app.ini src=files/app.ini owner=gogs group=gogs
- name: Start at boot
service: name=gogs state=started enabled=yes

+ 16
- 0
roles/postgres/tasks/main.yaml View File

@ -0,0 +1,16 @@
- name: install postgresql
apt: name={{ item }} state=latest
with_items:
- postgresql
- postgresql-contrib
- python-psycopg2
- block:
- postgresql_db: name={{ db_name }}
- postgresql_user:
name: "{{ db_user }}"
password: "{{ db_user_password }}"
db: "{{ db_name }}"
priv: ALL
become: true
become_method: su
become_user: postgres

Loading…
Cancel
Save