Added role yourls
This commit is contained in:
parent
d398c22b56
commit
941b374f01
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
yourls_repo: https://github.com/YOURLS/YOURLS
|
||||
pseudonymize_repo: https://github.com/ubicoo/yourls-pseudonymize
|
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
dependencies:
|
||||
- role: common
|
|
@ -0,0 +1,37 @@
|
|||
---
|
||||
- name: copy configuration file
|
||||
copy:
|
||||
remote_src: yes
|
||||
mode: preserve
|
||||
src: ~/html/user/config-sample.php
|
||||
dest: ~/html/user/config.php
|
||||
- name: update database user
|
||||
lineinfile:
|
||||
path: ~/html/user/config.php
|
||||
regexp: 'YOURLS_DB_USER'
|
||||
line: define( 'YOURLS_DB_USER', '{{ uberspace_user }}' );
|
||||
- name: update database password
|
||||
lineinfile:
|
||||
path: ~/html/user/config.php
|
||||
regexp: 'YOURLS_DB_PASS'
|
||||
line: define( 'YOURLS_DB_PASS', '{{ mysql_password }}' );
|
||||
- name: update database name
|
||||
lineinfile:
|
||||
path: ~/html/user/config.php
|
||||
regexp: 'YOURLS_DB_NAME'
|
||||
line: define( 'YOURLS_DB_NAME', '{{ uberspace_user}}_yourls' );
|
||||
- name: update domain
|
||||
lineinfile:
|
||||
path: ~/html/user/config.php
|
||||
regexp: 'YOURLS_SITE'
|
||||
line: define( 'YOURLS_SITE', 'https:/\/{{ domain }}' );
|
||||
- name: set cookie key
|
||||
lineinfile:
|
||||
path: ~/html/user/config.php
|
||||
regexp: 'YOURLS_COOKIEKEY'
|
||||
line: define( 'YOURLS_COOKIEKEY', "{{ lookup('password', '/tmp/passwordfile chars=ascii_letters,digits,punctuation') }}" );
|
||||
- name: set up user and password
|
||||
lineinfile:
|
||||
path: ~/html/user/config.php
|
||||
regexp: "'username' => 'password'"
|
||||
line: "'{{ yourls_user }}' => '{{ yourls_password }}'"
|
|
@ -0,0 +1,9 @@
|
|||
---
|
||||
- name: install pymysql
|
||||
pip:
|
||||
name: pymysql
|
||||
extra_args: --user
|
||||
- name: create database
|
||||
community.mysql.mysql_db:
|
||||
name: '{{ uberspace_user }}_yourls'
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
---
|
||||
- name: delete nocontent
|
||||
file:
|
||||
path: ~/html/nocontent.html
|
||||
state: absent
|
||||
- name: download YOURLS
|
||||
git:
|
||||
dest: ~/html/
|
||||
repo: '{{ yourls_repo }}'
|
||||
depth: 1
|
||||
accept_hostkey: yes
|
||||
- name: download pseudonymize plugin
|
||||
git:
|
||||
dest: ~/html/user/plugins/yourls-pseudonymize
|
||||
repo: '{{ pseudonymize_repo }}'
|
||||
depth: 1
|
||||
accept_hostkey: yes
|
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
- include: download.yml
|
||||
- include: database.yml
|
||||
- include: configuration.yml
|
|
@ -0,0 +1,9 @@
|
|||
---
|
||||
- name: Set up YOURLS
|
||||
hosts: uberspace
|
||||
vars_files:
|
||||
- general_vars.yml
|
||||
- yourls_vars.yml
|
||||
remote_user: "{{ uberspace_user }}"
|
||||
roles:
|
||||
- yourls
|
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
yourls_user: yourls
|
||||
yourls_password: password
|
Loading…
Reference in New Issue