From 0954205f192df9bfa69ebd2ebeca0e7b169c799d Mon Sep 17 00:00:00 2001 From: Edoardo Putti Date: Mon, 23 May 2016 00:30:51 +0200 Subject: [PATCH] add comments for postgres variables --- roles/gogs/tasks/main.yaml | 14 ++++++++++---- roles/gogs/templates/app.ini | 4 ++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/roles/gogs/tasks/main.yaml b/roles/gogs/tasks/main.yaml index c1b8171..5bfa2a0 100644 --- a/roles/gogs/tasks/main.yaml +++ b/roles/gogs/tasks/main.yaml @@ -2,11 +2,19 @@ gen_passwd: length=20 register: db_password - block: - - postgresql_db: name=gogs + - postgresql_db: + # database name + name=gogs + state=present - postgresql_user: + # the user name: gogs password: "{{ db_password.passwd }}" + # which db owns db: gogs + # set login password + login_password: "{{ db_password.passwd }}" + # privileges on gogs db priv: ALL become: true become_method: su @@ -23,11 +31,9 @@ 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 template: - dest=/etc/gogs/custom/conf/app.ini + dest=/etc/gogs/conf/app.ini src=templates/app.ini owner=gogs group=gogs diff --git a/roles/gogs/templates/app.ini b/roles/gogs/templates/app.ini index ee70979..c76cd4a 100644 --- a/roles/gogs/templates/app.ini +++ b/roles/gogs/templates/app.ini @@ -110,7 +110,7 @@ DB_TYPE = postgres HOST = 127.0.0.1:5432 NAME = gogs USER = gogs -PASSWD = `{{ db_password.passwd }}` +PASSWD = {{ db_password.passwd }} ; For "postgres" only, either "disable", "require" or "verify-full" SSL_MODE = disable ; For "sqlite3" and "tidb", use absolute path when you start as service @@ -121,7 +121,7 @@ PATH = data/gogs.db [security] INSTALL_LOCK = false ; !!CHANGE THIS TO KEEP YOUR USER DATA SAFE!! -SECRET_KEY = !#@FDEWREWR&*( +SECRET_KEY = {{ gogs_password.passwd }} ; Auto-login remember days LOGIN_REMEMBER_DAYS = 7 COOKIE_USERNAME = gogs_awesome