Browse Source

modifications on the mysql algorithm to simplify it, TODO : remove the variables with the SQL password of wallabag

master
theonlydoo 9 years ago
parent
commit
1c45708e94
2 changed files with 14 additions and 15 deletions
  1. +9
    -15
      roles/wallabag/tasks/wallabag.yml
  2. +5
    -0
      roles/wallabag/templates/root-wallabag.sql.j2

+ 9
- 15
roles/wallabag/tasks/wallabag.yml View File

@ -21,22 +21,16 @@
- php5-pgsql
- php5-tidy
- name: Create database user for wallabag
postgresql_user: login_host=localhost
login_user={{ db_admin_username }}
login_password="{{ db_admin_password }}"
name={{ wallabag_db_username }}
password="{{ wallabag_db_password }}"
state=present
#- name: Import database user template
# template: src=root-wallabag.sql.j2 dest=/root/wallabag.sql
#
#- name: Import sql file for account and db creation
# shell: mysql < /root/wallabag.sql
- name: Create database for wallabag
postgresql_db: login_host=localhost
login_user={{ db_admin_username }}
login_password="{{ db_admin_password }}"
name={{ wallabag_db_database }}
state=present
owner={{ wallabag_db_username }}
notify: import wallabag sql
- name: Import wallabag sql
shell: mysql {{ wallabag_db_database }} < /var/www/wallabag/install/mysql.sql
notify: remove install folder
- name: Build Composer
shell: curl -sS https://getcomposer.org/installer | php

+ 5
- 0
roles/wallabag/templates/root-wallabag.sql.j2 View File

@ -0,0 +1,5 @@
CREATE USER 'wallabag'@'localhost' IDENTIFIED BY '{{ wallabag_db_password }}';
GRANT USAGE ON * . * TO 'wallabag'@'localhost' IDENTIFIED BY '{{ wallabag_db_password }}' WITH MAX_QUERIES_PER_HOUR 0
MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;
CREATE DATABASE IF NOT EXISTS `wallabag` ;
GRANT ALL PRIVILEGES ON `wallabag` . * TO 'wallabag'@'localhost';

Loading…
Cancel
Save