remove ansible

all ansible stuff has been moved to a separate repo
pull/88/head
eric 2018-06-11 11:57:44 -04:00
parent 75168b92d9
commit b240d015d6
97 changed files with 0 additions and 6605 deletions

View File

@ -1,46 +0,0 @@
# Deploying Regluit to Production
The current provisioning setup uses [Ansible](https://www.ansible.com/resources/get-started) to deploy code to production servers.
## Pre-requisites
Before attempting to deploy, ensure you have done the following:
1. Install `ansible` on your local machine
1. Obtain the `ansible-vault` password and save it to a file
1. Set the path to the `ansible-vault` file via environment variable e.g. `export NSIBLE_VAULT_PASSWORD_FILE=[path]`
1. Create/obtain the secret key needed to SSH into the server
1. (optional) Add the secret key to your ssh agent
```
$ ssh-agent bash
$ ssh-add /path/to/secret.pem
```
## Deploy
Deploying is as simple as running the `setup-prod` ansible playbook.
Navigate to the `provisioning/` directory and run the following:
```
$ ansible-playbook -i hosts setup-prod.yml
```
If you successfully completed all the pre-requisite steps, the playbook should begin running through deploy tasks and finally restart apache.
## Additional Configuration
### Variables and Secrets
The necessary variables are pulled from `provisioning/group_vars/production/vars.yml` which in turn pulls certain secret values from `vault.yml`.
The variables are split into two files to still allow for searching references in playbook tasks.
To add or view secret values, you must decrypt the file first: `$ ansible-vault decrypt vault.yml` however **always remember to encrypt secret files before pushing to git**. This is done in a similar manner: `$ ansible-vault encrypt vault.yml`.
Ansible also allows for overriding variables from the command line when running playbooks.
This is useful for ad-hoc playbook runs without editing var files.
For example, deploying code from another branch can be done as so:
`$ ansible-playbook -i hosts setup-prod.yml -e git_branch=mybranch`
### Inventory and Groups
Currently we are using a static inventory file `hosts` to define target server hosts and groups.
This means that the `hosts` file must be manually updated to reflect things such as DNS changes or additional hosts being added.
In the future, the static inventory file may be replaced with a dynamic inventory solution, such as ansible's [ec2 inventory script](http://docs.ansible.com/ansible/latest/user_guide/intro_dynamic_inventory.html#example-aws-ec2-external-inventory-script)
One important aspect of the `hosts` file is that it defines the groups which a host or hosts are a part of.
Currently, there is only one prod host called `regluit-prod` which is a member of the `production` group.
Both of these designations are important, as the `setup-prod` playbook specifically targets the `regluit-prod` host, and only that host will inherit the variables in `group_vars/production/`.

View File

@ -1,58 +0,0 @@
---
### Variables for Regluit Production Server ###
### Sensitive vars are references to actual values in vault.yml ###
### Use ansible-vault view vault.yml to see the secret values ###
project_path: "/opt/regluit"
django_settings_module: "regluit.settings.prod"
virtualenv_name: "venv"
user_name: "ubuntu"
server_name: "m.unglue.it"
wsgi_home: "/opt/regluit/venv"
wsgi_python_path: "/opt/regluit/venv/bin/python"
git_repo: "https://github.com/EbookFoundation/regluit.git"
git_branch: "master"
### Variables in settings.prod.py ###
mysql_db_name: "{{ vault_mysql_db_name }}"
mysql_db_user: "{{ vault_mysql_db_user }}"
mysql_db_pass: "{{ vault_mysql_db_pass }}"
mysql_db_host: "{{ vault_mysql_db_host }}"
mysql_db_port: ""
email_host: "{{ vault_email_host }}"
email_port: 465
default_from_email: "notices@gluejar.com"
broker_transport: "redis"
broker_host: "127.0.0.1"
broker_port: 6379
broker_vhost: "0"
### Variables in common.py ###
common_keys:
booxtream_api_key: "{{ vault_booxtream_api_key }}"
booxtream_api_user: "{{ vault_booxtream_api_user }}"
dropbox_key: "{{ vault_dropbox_key }}"
github_public_token: "{{ vault_github_public_token }}"
mailchimp_api_key: "{{ vault_mailchimp_api_key }}"
mailchimp_news_id: "{{ vault_mailchimp_news_id }}"
mobigen_url: "{{ vault_mobigen_url }}"
mobigen_user_id: "{{ vault_mobigen_user_id }}"
mobigen_password: "{{ vault_mobigen_password }}"
### Variables in host.py ###
host_keys:
secret_key: '{{ vault_secret_key }}'
google_books_api_key: "{{ vault_google_books_api_key }}"
goodreads_api_key: "{{ vault_goodreads_api_key }}"
goodreads_api_secret: "{{ vault_goodreads_api_secret }}"
email_host_user: '{{ vault_email_host_user }}'
email_host_password: '{{ vault_email_host_password }}'
social_auth_twitter_key: '{{ vault_social_auth_twitter_key }}'
social_auth_twitter_secret: '{{ vault_social_auth_twitter_secret }}'
social_auth_facebook_key: '{{ vault_social_auth_facebook_key }}'
social_auth_facebook_secret: '{{ vault_social_auth_facebook_secret }}'
social_auth_google_oauth2_key: '{{ vault_social_auth_google_oauth2_key }}'
social_auth_google_oauth2_secret: '{{ vault_social_auth_google_oauth2_secret }}'
aws_access_key_id: '{{ vault_aws_access_key_id }}'
aws_secret_access_key: '{{ vault_aws_secret_access_key }}'
aws_storage_bucket_name: '{{ vault_aws_storage_bucket_name }}'

View File

@ -1,90 +0,0 @@
$ANSIBLE_VAULT;1.1;AES256
35613232373661333630323135393138313263623531323030656532643831313832373766393635
3737383265653238663165613563396162613961353532320a363562386230383432646265323563
61313039646366633965653136353264663236356333653265386336386437343832386131333362
3432663165313436390a356633616663383135393232613833663433376239366666336532353066
66306530333030366339636232333164346136393166636434343130646164316135306633363933
37316434376238363963636237393932343065633737383139366465306231323431393061663632
62323863633466613134393862633238623766616139653361653965663766363837376537646164
32366363336262633437333931363130333463333439346566313631633666333139623335393337
38373931643833636532353762376562346530313931343335663463653139323135633161383861
65656462396333646437306265303934306538316537383462303238346665366135656662616532
62306534303233356130356565323034396337383336386238643836303839393031613338656434
62633363663961633837643535663737323631636238393063306236666261306432616338643761
64336364656539306363336461353962333766316137623965633962663066326262316635636530
66646163386134363036386463363332333365396661313138666538383334626266633737303533
65316433383136613063616565633934633230666561663433346564323462396531623133343538
34613233373134323831613365383266363565313632383866373330333032646261316433663539
61363966343366306166393162343834323663616632663761343266663138373164346534343837
66616131323638386532376461336231313238333463303533613830646535633666386463393037
35313562326139616438396633383265383361316262363535323934303837306631386130386637
38313636613963373038646536333466393031613835376639363461383837343731646430343930
30373130376231383837306539633934643030616563386166643865636361643932623031323439
62623364373665353934366633303133343337306139373033313032613261393761363235376135
65356661313361356466353761336239656166356533636461663832613766363736303961666463
65346662346361323032653230626630356336353832656565363963633561343163626266653631
66626239393533653664353438323331616531333438356530653664376561346134626430643964
35393437663861373164303039333138643337653035643761316236313366616563666136666365
32396535663837626239626136393466653534613630316636323932376133376462323730613731
64393039373636353536313036363064633831323334383930663164323539656161613932656364
64636565636136343063626438623639386635306436383432313333376361393035653436353332
64623161316133663166336363343437393962633834333065396433313832333362326639363336
31633333393563306436646464313561643932393632613762643765333835323463303431383133
37653431366661653833623561343637343631616366623165656430396638353638346632326133
31333237336531386239643161623634656334336565646463653763363735653035653334626431
65656361343437316132323733303136623961313030663638656366653836376530393765643133
66306130343331353165643836613339306662393861656132626530626438333439386239396434
64613464646337393866306365333632316565383430303331353533623366373832666336616336
37313961393237363433396333626631643363666366633732386334353062333639333463613035
66306231303331306531636534313036646362336337333964353237396464353138663531346133
66613433326434363138326131383836636330343739336366623364643062633433613766386639
37393562396239633933373735313661316531366662346362313162326233366438653565656531
66323138383834666463313232623535643139336230336664653739386161316466653965653236
64653730623332326239646236636539643435373835333130666133623764343037363663366538
35643130313162376435363336383563363666353366303634663735393632366439373461393737
36353764613834613730376261356566626665396133396364383762633661386238616134633831
61613466633639656662333138396338303630643961353939326462373661356162356534383133
65393739643061356330366535616461326464613332346233616538633439373133323562343363
34343437633236333638366263616235356634613262396562623535383538306430643932353766
39623465376165343839326332623634303431613964646232373738323434313632376336393561
39653065633735326137386539323531656337396339363865393034336131663163646338363733
33356165306661343966373463643034383564313637353339653562663238306233356137383266
30303263303864396430366438613039383436396139343838316364323236356431383831383333
66373762396539636435303334313461663066323062623433356637366564336333346264636530
36646564643331343830363563383231636336366437333064333666616234376637343330306261
62663461303134336531623133363261643863383130373561396665643463613239653535663664
65383164313735366532666461323033313562616539363938333131623066623435616438383563
36313236633131356264346239376135376663303035363835393262666264323033353562366535
64363834363734613635613836623433616239613530623434383061616331656431616438653765
39633764656365396232313062333636376463396466376134366266343536336563626237616666
62346565326138343534303030313539396233656232376561643662343533383464656662653736
64653661666332316265396161646435643566336463393639663063373664633561386630633764
64636633336266646264383834633634636633386330626461336463316334386665366137666233
31643537646331653065336236303730316166393138633765333931646539666466643161353935
66613632643037653333366465353831643437663861623361343066336135666164343661313862
61613737396535363362386238333366396135353065303231313435393434623032613464653462
30383039623036393239383966326333663531356537343539333633623036396132646338393332
33653564633165356663636663386232346239303835613739356430386636386137653861306661
64313238306139383066633963333563633235636632613862313862343738633338303638383362
32653630626333613036306366353065663231623263613737626633366236616432383530346633
63306265333461313230346633636662353932336562376636646135633063653031383061626530
35653963363466353263396663313333646661386262393866643762356635353363636235353031
33393732623264353737356131633039653564626334623362383361646436316336343962353830
32303635666134613033666664326235663566646162336161333663333665613266326564616339
34303565306466346662336464666537643037633837353263346363313939623166653539323032
64623731376137393664653039623761366230356566316135613031623363323437343664656261
35626439313232353166666636333263633831653863653939643862323535626439323539626639
35363764303565346336323965383334336562306231656366643066653962356636383436336163
37343435353430363663616232326266333662303462616634633637613432346264366537323062
66323865643738373639356434386232656630383562656336363538356633363134343163343162
62663438393332376166663434366662616565616633636334643536656436643131303432303231
31313639613062323763303336323336646632303834366233633939616230353431356538363636
65623562326637363233333666623532326633643864653261363836626565313537366632653363
64333231663538663739636630356336336565323666373436613337633864313761653664643566
38666439626633353462623236626633613263303265623733636433633666643339356632366133
32616532646466343563636336663230333337366466656232323865333431616434306466646433
62626437316130623839663166323264333866613866323061393662663935363339363337636663
66623634373864613464623230373434363461336461373233616533373461343030313166386230
61623637636630666264346637333961623730356366313336313663643539393138343830346138
34643337343031373566656537626533633131646631383962373437666337303764636163623931
65373737316234666465363839313566323338313939653032643362613962316139

View File

@ -1,2 +0,0 @@
[production]
regluit-prod ansible_host=m.unglue.it ansible_user=ubuntu

View File

@ -1,21 +0,0 @@
project_path: "/opt/regluit"
django_settings_module: "regluit.settings.me"
virtualenv_name: "venv"
# MySQL
mysql_db_name: "regluit"
mysql_db_user: "regluit"
mysql_db_pass: "password123"
mysql_db_host: "localhost"
mysql_db_port: 3306
# Task Broker
broker_transport: "redis"
broker_host: "localhost"
broker_port: 6379
broker_vhost: "0"
# Common.py defaults
boxstream_api_key: "012345678901234567890123456789"
boxstream_api_user: "user"
dropbox_key: "012345678901234"

View File

@ -1,154 +0,0 @@
#!/bin/bash
# =========================================================
# celerybeat - Starts the Celery periodic task scheduler.
# =========================================================
#
# :Usage: /etc/init.d/celerybeat {start|stop|force-reload|restart|try-restart|status}
# :Configuration file: /etc/default/celerybeat or /etc/default/celeryd
#
# See http://docs.celeryq.org/en/latest/cookbook/daemonizing.html#init-script-celerybeat
# This file is copied from https://github.com/ask/celery/blob/2.4/contrib/generic-init.d/celerybeat
### BEGIN INIT INFO
# Provides: celerybeat
# Required-Start: $network $local_fs $remote_fs
# Required-Stop: $network $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: celery periodic task scheduler
### END INIT INFO
# Cannot use set -e/bash -e since the kill -0 command will abort
# abnormally in the absence of a valid process ID.
#set -e
DEFAULT_PID_FILE="/var/run/celerybeat.pid"
DEFAULT_LOG_FILE="/var/log/celerybeat.log"
DEFAULT_LOG_LEVEL="INFO"
DEFAULT_CELERYBEAT="celerybeat"
# /etc/init.d/ssh: start and stop the celery task worker daemon.
if test -f /etc/default/celeryd; then
. /etc/default/celeryd
fi
if test -f /etc/default/celerybeat; then
. /etc/default/celerybeat
fi
CELERYBEAT=${CELERYBEAT:-$DEFAULT_CELERYBEAT}
CELERYBEAT_PID_FILE=${CELERYBEAT_PID_FILE:-${CELERYBEAT_PIDFILE:-$DEFAULT_PID_FILE}}
CELERYBEAT_LOG_FILE=${CELERYBEAT_LOG_FILE:-${CELERYBEAT_LOGFILE:-$DEFAULT_LOG_FILE}}
CELERYBEAT_LOG_LEVEL=${CELERYBEAT_LOG_LEVEL:-${CELERYBEAT_LOGLEVEL:-$DEFAULT_LOG_LEVEL}}
export CELERY_LOADER
CELERYBEAT_OPTS="$CELERYBEAT_OPTS -f $CELERYBEAT_LOG_FILE -l $CELERYBEAT_LOG_LEVEL"
if [ -n "$2" ]; then
CELERYBEAT_OPTS="$CELERYBEAT_OPTS $2"
fi
CELERYBEAT_LOG_DIR=`dirname $CELERYBEAT_LOG_FILE`
CELERYBEAT_PID_DIR=`dirname $CELERYBEAT_PID_FILE`
if [ ! -d "$CELERYBEAT_LOG_DIR" ]; then
mkdir -p $CELERYBEAT_LOG_DIR
fi
if [ ! -d "$CELERYBEAT_PID_DIR" ]; then
mkdir -p $CELERYBEAT_PID_DIR
fi
# Extra start-stop-daemon options, like user/group.
if [ -n "$CELERYBEAT_USER" ]; then
DAEMON_OPTS="$DAEMON_OPTS --uid $CELERYBEAT_USER"
chown "$CELERYBEAT_USER" $CELERYBEAT_LOG_DIR $CELERYBEAT_PID_DIR
fi
if [ -n "$CELERYBEAT_GROUP" ]; then
DAEMON_OPTS="$DAEMON_OPTS --gid $CELERYBEAT_GROUP"
chgrp "$CELERYBEAT_GROUP" $CELERYBEAT_LOG_DIR $CELERYBEAT_PID_DIR
fi
CELERYBEAT_CHDIR=${CELERYBEAT_CHDIR:-$CELERYD_CHDIR}
if [ -n "$CELERYBEAT_CHDIR" ]; then
DAEMON_OPTS="$DAEMON_OPTS --workdir $CELERYBEAT_CHDIR"
fi
export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
check_dev_null() {
if [ ! -c /dev/null ]; then
echo "/dev/null is not a character device!"
exit 1
fi
}
wait_pid () {
pid=$1
forever=1
i=0
while [ $forever -gt 0 ]; do
kill -0 $pid 1>/dev/null 2>&1
if [ $? -eq 1 ]; then
echo "OK"
forever=0
else
kill -TERM "$pid"
i=$((i + 1))
if [ $i -gt 60 ]; then
echo "ERROR"
echo "Timed out while stopping (30s)"
forever=0
else
sleep 0.5
fi
fi
done
}
stop_beat () {
echo -n "Stopping celerybeat... "
if [ -f "$CELERYBEAT_PID_FILE" ]; then
wait_pid $(cat "$CELERYBEAT_PID_FILE")
else
echo "NOT RUNNING"
fi
}
start_beat () {
echo "Starting celerybeat..."
if [ -n "$VIRTUALENV" ]; then
source $VIRTUALENV/bin/activate
fi
$CELERYBEAT $CELERYBEAT_OPTS $DAEMON_OPTS --detach \
--pidfile="$CELERYBEAT_PID_FILE"
}
case "$1" in
start)
check_dev_null
start_beat
;;
stop)
stop_beat
;;
reload|force-reload)
echo "Use start+stop"
;;
restart)
echo "Restarting celery periodic task scheduler"
stop_beat
check_dev_null
start_beat
;;
*)
echo "Usage: /etc/init.d/celerybeat {start|stop|restart}"
exit 1
esac
exit 0

View File

@ -1,217 +0,0 @@
#!/bin/bash
# ============================================
# celeryd - Starts the Celery worker daemon.
# ============================================
#
# :Usage: /etc/init.d/celeryd {start|stop|force-reload|restart|try-restart|status}
#
# :Configuration file: /etc/default/celeryd
#
# To configure celeryd you probably need to tell it where to chdir.
#
# EXAMPLE CONFIGURATION
# =====================
#
# this is an example configuration for a Python project:
#
# /etc/default/celeryd:
#
# # List of nodes to start
# CELERYD_NODES="worker1 worker2 worker3"k
# # ... can also be a number of workers
# CELERYD_NODES=3
#
# # Where to chdir at start.
# CELERYD_CHDIR="/opt/Myproject/"
#
# # Extra arguments to celeryd
# CELERYD_OPTS="--time-limit=300"
#
# # Name of the celery config module.#
# CELERY_CONFIG_MODULE="celeryconfig"
#
# EXAMPLE DJANGO CONFIGURATION
# ============================
#
# # Where the Django project is.
# CELERYD_CHDIR="/opt/Project/"
#
# # Name of the projects settings module.
# export DJANGO_SETTINGS_MODULE="settings"
#
# # Path to celeryd
# CELERYD="/opt/Project/manage.py celeryd"
#
# AVAILABLE OPTIONS
# =================
#
# * CELERYD_NODES
#
# A space separated list of nodes, or a number describing the number of
# nodes, to start
#
# * CELERYD_OPTS
# Additional arguments to celeryd-multi, see `celeryd-multi --help`
# and `celeryd --help` for help.
#
# * CELERYD_CHDIR
# Path to chdir at start. Default is to stay in the current directory.
#
# * CELERYD_PIDFILE
# Full path to the pidfile. Default is /var/run/celeryd.pid.
#
# * CELERYD_LOGFILE
# Full path to the celeryd logfile. Default is /var/log/celeryd.log
#
# * CELERYD_LOG_LEVEL
# Log level to use for celeryd. Default is INFO.
#
# * CELERYD
# Path to the celeryd program. Default is `celeryd`.
# You can point this to an virtualenv, or even use manage.py for django.
#
# * CELERYD_USER
# User to run celeryd as. Default is current user.
#
# * CELERYD_GROUP
# Group to run celeryd as. Default is current user.
# VARIABLE EXPANSION
# ==================
#
# The following abbreviations will be expanded
#
# * %n -> node name
# * %h -> host name
### BEGIN INIT INFO
# Provides: celeryd
# Required-Start: $network $local_fs $remote_fs
# Required-Stop: $network $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: celery task worker daemon
### END INIT INFO
#set -e
DEFAULT_PID_FILE="/var/run/celeryd@%n.pid"
DEFAULT_LOG_FILE="/var/log/celeryd@%n.log"
DEFAULT_LOG_LEVEL="INFO"
DEFAULT_NODES="celery"
DEFAULT_CELERYD="-m celery.bin.celeryd_detach"
# /etc/init.d/celeryd: start and stop the celery task worker daemon.
CELERY_DEFAULTS=${CELERY_DEFAULTS:-"/etc/default/celeryd"}
test -f "$CELERY_DEFAULTS" && . "$CELERY_DEFAULTS"
if [ -f "/etc/default/celeryd" ]; then
. /etc/default/celeryd
fi
if [ -f $VIRTUALENV_ACTIVATE ]; then
echo "activating virtualenv $VIRTUALENV_ACTIVATE"
source "$VIRTUALENV_ACTIVATE"
fi
CELERYD_PID_FILE=${CELERYD_PID_FILE:-${CELERYD_PIDFILE:-$DEFAULT_PID_FILE}}
CELERYD_LOG_FILE=${CELERYD_LOG_FILE:-${CELERYD_LOGFILE:-$DEFAULT_LOG_FILE}}
CELERYD_LOG_LEVEL=${CELERYD_LOG_LEVEL:-${CELERYD_LOGLEVEL:-$DEFAULT_LOG_LEVEL}}
CELERYD_MULTI=${CELERYD_MULTI:-"celeryd-multi"}
CELERYD=${CELERYD:-$DEFAULT_CELERYD}
CELERYD_NODES=${CELERYD_NODES:-$DEFAULT_NODES}
export CELERY_LOADER
if [ -n "$2" ]; then
CELERYD_OPTS="$CELERYD_OPTS $2"
fi
# Extra start-stop-daemon options, like user/group.
if [ -n "$CELERYD_USER" ]; then
DAEMON_OPTS="$DAEMON_OPTS --uid=$CELERYD_USER"
fi
if [ -n "$CELERYD_GROUP" ]; then
DAEMON_OPTS="$DAEMON_OPTS --gid=$CELERYD_GROUP"
fi
if [ -n "$CELERYD_CHDIR" ]; then
DAEMON_OPTS="$DAEMON_OPTS --workdir=\"$CELERYD_CHDIR\""
fi
check_dev_null() {
if [ ! -c /dev/null ]; then
echo "/dev/null is not a character device!"
exit 1
fi
}
export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
stop_workers () {
$CELERYD_MULTI stop $CELERYD_NODES --pidfile="$CELERYD_PID_FILE"
}
start_workers () {
$CELERYD_MULTI start $CELERYD_NODES $DAEMON_OPTS \
--pidfile="$CELERYD_PID_FILE" \
--logfile="$CELERYD_LOG_FILE" \
--loglevel="$CELERYD_LOG_LEVEL" \
--cmd="$CELERYD" \
$CELERYD_OPTS
}
restart_workers () {
$CELERYD_MULTI restart $CELERYD_NODES $DAEMON_OPTS \
--pidfile="$CELERYD_PID_FILE" \
--logfile="$CELERYD_LOG_FILE" \
--loglevel="$CELERYD_LOG_LEVEL" \
--cmd="$CELERYD" \
$CELERYD_OPTS
}
case "$1" in
start)
check_dev_null
start_workers
;;
stop)
check_dev_null
stop_workers
;;
reload|force-reload)
echo "Use restart"
;;
status)
celeryctl status
;;
restart)
check_dev_null
restart_workers
;;
try-restart)
check_dev_null
restart_workers
;;
*)
echo "Usage: /etc/init.d/celeryd {start|stop|restart|try-restart|kill}"
exit 1
;;
esac
exit 0

View File

@ -1,37 +0,0 @@
---
# Tasks for Celeryd and Celerybeat processes
- name: Create /var/log/celery
become: true
file:
path: "/var/log/celery"
state: directory
#owner: celery
#group: celery
mode: 0775
- name: Create /var/run/celery
become: true
file:
path: "/var/run/celery"
state: directory
#owner: celery
#group: celery
mode: 0775
- name: Copy celery init.d scripts
become: true
copy:
src: "{{ item }}"
dest: "/etc/init.d/{{ item }}"
with_items:
- 'celeryd'
- 'celerybeat'
- name: Copy celery config files
become: true
template:
src: "celery/{{ item }}.j2"
dest: "/etc/default/{{ item }}"
with_items:
- 'celeryd'
- 'celerybeat'

View File

@ -1,85 +0,0 @@
---
# Need to install python2.7 and pip first so Ansible will function
# This is due to Ubuntu 16 shipping with Python3 by default
- name: Install python2.7 and pip
become: true
raw: bash -c "apt -qqy update && apt install -qqy python2.7-dev python-pip"
register: output
changed_when: output.stdout != ""
- name: Gathering Facts
setup:
- name: Install base regluit dependencies
become: true
apt:
name: "{{ item }}"
update_cache: true
state: present
with_items:
- 'git'
- 'python-setuptools'
- 'python-lxml'
- 'build-essential'
- 'libssl-dev'
- 'libffi-dev'
- 'libxml2-dev'
- 'libxslt-dev'
- 'mysql-server'
- 'mysql-client'
- 'libmysqlclient-dev'
- 'python-mysqldb'
- name: Install virtualenv
pip:
name: "virtualenv"
state: present
- name: Install python packages to virtualenv
pip:
requirements: "{{ project_path }}/requirements_versioned.pip"
state: present
virtualenv: "{{ project_path }}/venv"
- name: Add project to PYTHONPATH of virtualenv
template:
src: "{{ item }}.j2"
dest: "{{ project_path }}/venv/lib/python2.7/site-packages/{{ item }}"
with_items:
- 'regluit.pth'
- 'opt.pth'
- name: Create keys directory
file:
path: "{{ project_path}}/settings/keys"
state: directory
- name: Copy keys files
copy:
src: "{{ project_path }}/settings/dummy/__init__.py"
dest: "{{ project_path }}/settings/keys/__init__.py"
remote_src: yes
- name: Copy django settings template
template:
src: me.py.j2
dest: "{{ project_path }}/settings/me.py"
- name: Copy key templates to keys directory
template:
src: "{{ item }}.j2"
dest: "{{ project_path }}/settings/keys/{{ item }}"
with_items:
- 'common.py'
- 'host.py'
- name: MySQL setup
become: true
import_tasks: mysql.yml
- name: Redis setup
become: true
import_tasks: redis.yml
# - name: Celery setup
# import_tasks: celery.yml

View File

@ -1,12 +0,0 @@
---
- name: Create MySQL database
mysql_db:
name: "{{ mysql_db_name }}"
state: present
- name: Create MySQL user
mysql_user:
name: "{{ mysql_db_user }}"
password: "{{ mysql_db_pass }}"
priv: '*.*:ALL'
state: present

View File

@ -1,13 +0,0 @@
---
- name: Install Redis server
become: yes
apt:
name: "redis-server"
state: present
- name: Ensure Redis is started
become: yes
service:
name: "redis-server"
state: started
enabled: yes

View File

@ -1,35 +0,0 @@
# http://docs.celeryproject.org/en/latest/cookbook/daemonizing.html#generic-initd-celerybeat-example
# to be placed at /etc/defaults/celerybeat
# Where to chdir at start.
CELERYBEAT_CHDIR="{{ project_path }}t/"
# Extra arguments to celerybeat
#CELERYBEAT_OPTS="--schedule=/var/run/celerybeat-schedule"
# Name of the celery config module.#
CELERY_CONFIG_MODULE="celeryconfig"
# Name of the projects settings module.
export DJANGO_SETTINGS_MODULE="{{ django_settings_module }}"
# Path to celerybeat
CELERYBEAT="{{ project_path }}/{{ virtualenv_name }}/bin/django-admin.py celerybeat"
# virtualenv to use
VIRTUALENV="{{ project_path }}/{{ virtualenv_name }}"
#Full path to the PID file. Default is /var/run/celeryd.pid
CELERYBEAT_PIDFILE="/var/log/celerybeat/celerybeat.pid"
#Full path to the celeryd log file. Default is /var/log/celeryd.log
CELERYBEAT_LOGFILE="/var/log/celerybeat/celerybeat.log"
#Log level to use for celeryd. Default is INFO.
CELERYBEAT_LOG_LEVEL="INFO"
#User to run celeryd as. Default is current user.
#CELERYBEAT_USER
#Group to run celeryd as. Default is current user.
#CELERYBEAT_GROUP

View File

@ -1,9 +0,0 @@
CELERYD_NODES="w1"
CELERYD_CHDIR="{{ project_path }}/"
CELERYD_LOG_FILE="/var/log/celery/%n.log"
CELERYD_PID_FILE="/var/log/celery/%n.pid"
CELERYD="{{ project_path }}/{{ virtualenv_name }}/bin/django-admin.py celeryd"
CELERYD_MULTI="{{ project_path }}/{{ virtualenv_name }}/bin/django-admin.py celeryd_multi"
VIRTUALENV_ACTIVATE="{{ project_path }}/{{ virtualenv_name }}/bin/activate"
export DJANGO_SETTINGS_MODULE="{{ django_settings_module }}"

View File

@ -1,13 +0,0 @@
import os
# all the COMMON_KEYS
# copy this file to settings/keys/ and replace the dummy values with real ones
BOOXTREAM_API_KEY = os.environ.get('BOOXTREAM_API_KEY', '{{ boxstream_api_key }}')
BOOXTREAM_API_USER = os.environ.get('BOOXTREAM_API_USER', '{{ boxstream_api_user }}')
DROPBOX_KEY = os.environ.get('DROPBOX_KEY', '{{ dropbox_key }}')
GITHUB_PUBLIC_TOKEN = os.environ.get('GITHUB_PUBLIC_TOKEN', None) # 40 chars; null has lower limit
MAILCHIMP_API_KEY = os.environ.get('MAILCHIMP_API_KEY', '-us2') # [32chars]-xx#
MAILCHIMP_NEWS_ID = os.environ.get('MAILCHIMP_NEWS_ID', '0123456789')
MOBIGEN_PASSWORD = os.environ.get('MOBIGEN_PASSWORD', '012345678901234')
MOBIGEN_URL = os.environ.get('MOBIGEN_URL', '') # https://host/mobigen
MOBIGEN_USER_ID = os.environ.get('MOBIGEN_USER_ID', 'user')

View File

@ -1,47 +0,0 @@
# host.py
# copy this file to settings/keys/ and replace the dummy values with real ones
# or generate it from the ansible vault
import os
# you can use this to generate a key: http://www.miniwebtool.com/django-secret-key-generator/
SECRET_KEY = os.environ.get("SECRET_KEY", '01234567890123456789012345678901234567890123456789')
# you'll need to register a GoogleBooks API key
# https://code.google.com/apis/console
GOOGLE_BOOKS_API_KEY = os.environ.get("GOOGLE_BOOKS_API_KEY", "012345678901234567890123456789012345678")
#
GOODREADS_API_KEY = os.environ.get("GOODREADS_API_KEY", "01234567890123456789")
GOODREADS_API_SECRET = os.environ.get("GOODREADS_API_SECRET", None) #43 chars
# Amazon SES
# create with https://console.aws.amazon.com/ses/home?region=us-east-1#smtp-settings:
EMAIL_HOST_USER = os.environ.get("EMAIL_HOST_USER", '01234567890123456789')
EMAIL_HOST_PASSWORD = os.environ.get("EMAIL_HOST_PASSWORD", '01234567890123456789012345678901234567890123')
# twitter auth
# you'll need to create a new Twitter application to fill in these blanks
# https://dev.twitter.com/apps/new
SOCIAL_AUTH_TWITTER_KEY = os.environ.get("SOCIAL_AUTH_TWITTER_KEY", '0123456789012345678901234')
SOCIAL_AUTH_TWITTER_SECRET = os.environ.get("SOCIAL_AUTH_TWITTER_SECRET", '01234567890123456789012345678901234567890123456789')
# support@icontact.nl
BOOXTREAM_API_KEY = os.environ.get("BOOXTREAM_API_KEY", None) # 30 chars
BOOXTREAM_API_USER = os.environ.get("BOOXTREAM_API_USER", 'user')
# you'll need to create a new Facebook application to fill in these blanks
# https://developers.facebook.com/apps/
SOCIAL_AUTH_FACEBOOK_KEY = os.environ.get("SOCIAL_AUTH_FACEBOOK_KEY", '012345678901234')
SOCIAL_AUTH_FACEBOOK_SECRET = os.environ.get("SOCIAL_AUTH_FACEBOOK_SECRET", '01234567890123456789012345678901')
# https://console.developers.google.com/apis/credentials/oauthclient/
# unglue.it (prod) SOCIAL_AUTH_GOOGLE_OAUTH2_KEY #2
SOCIAL_AUTH_GOOGLE_OAUTH2_KEY = os.environ.get("_KEY", '012345678901-01234567890123456789012345678901.apps.googleusercontent.com')
SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET = os.environ.get("_SECRET", '012345678901234567890123')
AWS_ACCESS_KEY_ID = os.environ.get("AWS_ACCESS_KEY_ID", '01234567890123456789')
AWS_SECRET_ACCESS_KEY = os.environ.get("AWS_SECRET_ACCESS_KEY", '') # 40 chars
DATABASE_USER = os.environ.get("DATABASE_USER", 'root')
DATABASE_PASSWORD = os.environ.get("DATABASE_PASSWORD", '')
DATABASE_HOST = os.environ.get("DATABASE_HOST", '')

View File

@ -1,90 +0,0 @@
# coding=utf-8
from .common import *
try:
from .keys.host import *
except ImportError:
from .dummy.host import *
DEBUG = True
TEMPLATES[0]['OPTIONS']['debug'] = DEBUG
# if you're doing development work, you'll want this to be zero
IS_PREVIEW = False
# SITE_ID for your particular site -- must be configured in /core/fixtures/initial_data.json
SITE_ID = 3
ADMINS = (
('Raymond Yee', 'rdhyee+ungluebugs@gluejar.com'),
('Eric Hellman', 'eric@gluejar.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': '{{ mysql_db_name }}',
'USER': '{{ mysql_db_user }}',
'PASSWORD': '{{ mysql_db_pass }}',
'HOST': '{{ mysql_db_host }}',
'PORT': '{{ mysql_db_port }} ',
'TEST_CHARSET': 'utf8',
}
}
STATIC_ROOT = '/var/www/static'
CKEDITOR_UPLOAD_PATH = '/var/www/static/media/'
TIME_ZONE = 'America/New_York'
# settings for outbout email
# if you have a gmail account you can use your email address and password
EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.gmail.com'
# EMAIL_HOST_USER is in keys/host
# EMAIL_HOST_PASSWORD is in keys/host
EMAIL_PORT = 587
DEFAULT_FROM_EMAIL = 'info@ebookfoundation.org'
# for use with test google account only
GOOGLE_DISPLAY_NAME = 'Unglue.It'
REDIRECT_IS_HTTPS = False
#BASE_URL = 'http://0.0.0.0'
BASE_URL_SECURE = 'https://0.0.0.0'
# use redis as queuing service
BROKER_TRANSPORT = "{{ broker_transport }}"
BROKER_HOST = "{{ broker_host }}"
BROKER_PORT = {{ broker_port }}
BROKER_VHOST = "{{ broker_vhost }}"
# send celery log to Python logging
CELERYD_HIJACK_ROOT_LOGGER = False
# a debug_toolbar setting
INTERNAL_IPS = ('127.0.0.1',)
CELERYD_LOG_LEVEL = "INFO"
# decide which of the period tasks to add to the schedule
#CELERYBEAT_SCHEDULE['send_test_email'] = SEND_TEST_EMAIL_JOB
#CELERYBEAT_SCHEDULE['refresh_acqs'] = REFRESH_ACQS_JOB
# if you're doing development work, you'll want this to be zero
IS_PREVIEW = False
# username, password to pass to LIVE_SERVER_TEST_URL
UNGLUEIT_TEST_USER = None
UNGLUEIT_TEST_PASSWORD = None
# local settings for maintenance mode
MAINTENANCE_MODE = False
# assume that CSS will get generated on dev
SASS_OUTPUT_STYLE = 'compressed'

View File

@ -1 +0,0 @@
{{ project_path }}/

View File

@ -1,5 +0,0 @@
django_settings_module: "regluit.settings.me"
project_path: "/opt/regluit"
virtualenv_name: "venv"
django_server_ip: "0.0.0.0"
django_server_port: 8000

View File

@ -1,69 +0,0 @@
---
- name: Install dev dependencies
become: true
apt:
name: "{{ item }}"
update_cache: true
state: present
with_items:
- 'git'
- 'python-setuptools'
- 'python-lxml'
- 'build-essential'
- 'libssl-dev'
- 'libffi-dev'
- 'libxml2-dev'
- 'libxslt-dev'
- 'mysql-server'
- 'mysql-client'
- 'libmysqlclient-dev'
- 'python-mysqldb'
- name: Migrate databse
django_manage:
app_path: "{{ project_path }}"
command: "migrate --noinput"
virtualenv: "{{ project_path }}/venv"
settings: "{{ django_settings_module }}"
- name: Import fixtures
django_manage:
app_path: "{{ project_path }}"
command: "loaddata"
virtualenv: "{{ project_path }}/venv"
settings: "{{ django_settings_module }}"
fixtures: "core/fixtures/initial_data.json core/fixtures/bookloader.json"
- name: Start Celery Worker
django_manage:
app_path: "{{ project_path }}"
command: "celery worker --detach --loglevel=INFO"
virtualenv: "{{ project_path }}/venv"
settings: "{{ django_settings_module }}"
- name: Start Celery Beat
django_manage:
app_path: "{{ project_path }}"
command: "celery beat --detach --loglevel=INFO"
virtualenv: "{{ project_path }}/venv"
settings: "{{ django_settings_module }}"
- name: Copy activation script
template:
src: "activate_venv.sh.j2"
dest: "/home/{{ ansible_user }}/activate_venv.sh"
owner: "{{ ansible_user }}"
mode: "u=rx,g=rx,o=rwx"
- name: Source activation script in bash profile
blockinfile:
path: "/home/{{ ansible_user }}/.profile"
block: |
if [ -f ~/activate_venv.sh ]; then
source ~/activate_venv.sh
fi
marker: "# {mark} SOURCE REGLUIT ACTIVATION SCRIPT ON LOGIN"
- debug:
msg: "Successfully provisioned regluit development environment."

View File

@ -1,7 +0,0 @@
#!/bin/bash
cd {{ project_path }}
source {{ virtualenv_name }}/bin/activate
echo Local setup of Regluit complete!
echo To start the django development server, run:
echo ./manage.py runserver {{ django_server_ip }}:{{ django_server_port }}
echo Then leave this session running and access the site on your host machine at http://127.0.0.1:{{ django_server_port }}

View File

@ -1,154 +0,0 @@
#!/bin/bash
# =========================================================
# celerybeat - Starts the Celery periodic task scheduler.
# =========================================================
#
# :Usage: /etc/init.d/celerybeat {start|stop|force-reload|restart|try-restart|status}
# :Configuration file: /etc/default/celerybeat or /etc/default/celeryd
#
# See http://docs.celeryq.org/en/latest/cookbook/daemonizing.html#init-script-celerybeat
# This file is copied from https://github.com/ask/celery/blob/2.4/contrib/generic-init.d/celerybeat
### BEGIN INIT INFO
# Provides: celerybeat
# Required-Start: $network $local_fs $remote_fs
# Required-Stop: $network $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: celery periodic task scheduler
### END INIT INFO
# Cannot use set -e/bash -e since the kill -0 command will abort
# abnormally in the absence of a valid process ID.
#set -e
DEFAULT_PID_FILE="/var/run/celerybeat.pid"
DEFAULT_LOG_FILE="/var/log/celerybeat.log"
DEFAULT_LOG_LEVEL="INFO"
DEFAULT_CELERYBEAT="celerybeat"
# /etc/init.d/ssh: start and stop the celery task worker daemon.
if test -f /etc/default/celeryd; then
. /etc/default/celeryd
fi
if test -f /etc/default/celerybeat; then
. /etc/default/celerybeat
fi
CELERYBEAT=${CELERYBEAT:-$DEFAULT_CELERYBEAT}
CELERYBEAT_PID_FILE=${CELERYBEAT_PID_FILE:-${CELERYBEAT_PIDFILE:-$DEFAULT_PID_FILE}}
CELERYBEAT_LOG_FILE=${CELERYBEAT_LOG_FILE:-${CELERYBEAT_LOGFILE:-$DEFAULT_LOG_FILE}}
CELERYBEAT_LOG_LEVEL=${CELERYBEAT_LOG_LEVEL:-${CELERYBEAT_LOGLEVEL:-$DEFAULT_LOG_LEVEL}}
export CELERY_LOADER
CELERYBEAT_OPTS="$CELERYBEAT_OPTS -f $CELERYBEAT_LOG_FILE -l $CELERYBEAT_LOG_LEVEL"
if [ -n "$2" ]; then
CELERYBEAT_OPTS="$CELERYBEAT_OPTS $2"
fi
CELERYBEAT_LOG_DIR=`dirname $CELERYBEAT_LOG_FILE`
CELERYBEAT_PID_DIR=`dirname $CELERYBEAT_PID_FILE`
if [ ! -d "$CELERYBEAT_LOG_DIR" ]; then
mkdir -p $CELERYBEAT_LOG_DIR
fi
if [ ! -d "$CELERYBEAT_PID_DIR" ]; then
mkdir -p $CELERYBEAT_PID_DIR
fi
# Extra start-stop-daemon options, like user/group.
if [ -n "$CELERYBEAT_USER" ]; then
DAEMON_OPTS="$DAEMON_OPTS --uid $CELERYBEAT_USER"
chown "$CELERYBEAT_USER" $CELERYBEAT_LOG_DIR $CELERYBEAT_PID_DIR
fi
if [ -n "$CELERYBEAT_GROUP" ]; then
DAEMON_OPTS="$DAEMON_OPTS --gid $CELERYBEAT_GROUP"
chgrp "$CELERYBEAT_GROUP" $CELERYBEAT_LOG_DIR $CELERYBEAT_PID_DIR
fi
CELERYBEAT_CHDIR=${CELERYBEAT_CHDIR:-$CELERYD_CHDIR}
if [ -n "$CELERYBEAT_CHDIR" ]; then
DAEMON_OPTS="$DAEMON_OPTS --workdir $CELERYBEAT_CHDIR"
fi
export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
check_dev_null() {
if [ ! -c /dev/null ]; then
echo "/dev/null is not a character device!"
exit 1
fi
}
wait_pid () {
pid=$1
forever=1
i=0
while [ $forever -gt 0 ]; do
kill -0 $pid 1>/dev/null 2>&1
if [ $? -eq 1 ]; then
echo "OK"
forever=0
else
kill -TERM "$pid"
i=$((i + 1))
if [ $i -gt 60 ]; then
echo "ERROR"
echo "Timed out while stopping (30s)"
forever=0
else
sleep 0.5
fi
fi
done
}
stop_beat () {
echo -n "Stopping celerybeat... "
if [ -f "$CELERYBEAT_PID_FILE" ]; then
wait_pid $(cat "$CELERYBEAT_PID_FILE")
else
echo "NOT RUNNING"
fi
}
start_beat () {
echo "Starting celerybeat..."
if [ -n "$VIRTUALENV" ]; then
source $VIRTUALENV/bin/activate
fi
$CELERYBEAT $CELERYBEAT_OPTS $DAEMON_OPTS --detach \
--pidfile="$CELERYBEAT_PID_FILE"
}
case "$1" in
start)
check_dev_null
start_beat
;;
stop)
stop_beat
;;
reload|force-reload)
echo "Use start+stop"
;;
restart)
echo "Restarting celery periodic task scheduler"
stop_beat
check_dev_null
start_beat
;;
*)
echo "Usage: /etc/init.d/celerybeat {start|stop|restart}"
exit 1
esac
exit 0

View File

@ -1,217 +0,0 @@
#!/bin/bash
# ============================================
# celeryd - Starts the Celery worker daemon.
# ============================================
#
# :Usage: /etc/init.d/celeryd {start|stop|force-reload|restart|try-restart|status}
#
# :Configuration file: /etc/default/celeryd
#
# To configure celeryd you probably need to tell it where to chdir.
#
# EXAMPLE CONFIGURATION
# =====================
#
# this is an example configuration for a Python project:
#
# /etc/default/celeryd:
#
# # List of nodes to start
# CELERYD_NODES="worker1 worker2 worker3"k
# # ... can also be a number of workers
# CELERYD_NODES=3
#
# # Where to chdir at start.
# CELERYD_CHDIR="/opt/Myproject/"
#
# # Extra arguments to celeryd
# CELERYD_OPTS="--time-limit=300"
#
# # Name of the celery config module.#
# CELERY_CONFIG_MODULE="celeryconfig"
#
# EXAMPLE DJANGO CONFIGURATION
# ============================
#
# # Where the Django project is.
# CELERYD_CHDIR="/opt/Project/"
#
# # Name of the projects settings module.
# export DJANGO_SETTINGS_MODULE="settings"
#
# # Path to celeryd
# CELERYD="/opt/Project/manage.py celeryd"
#
# AVAILABLE OPTIONS
# =================
#
# * CELERYD_NODES
#
# A space separated list of nodes, or a number describing the number of
# nodes, to start
#
# * CELERYD_OPTS
# Additional arguments to celeryd-multi, see `celeryd-multi --help`
# and `celeryd --help` for help.
#
# * CELERYD_CHDIR
# Path to chdir at start. Default is to stay in the current directory.
#
# * CELERYD_PIDFILE
# Full path to the pidfile. Default is /var/run/celeryd.pid.
#
# * CELERYD_LOGFILE
# Full path to the celeryd logfile. Default is /var/log/celeryd.log
#
# * CELERYD_LOG_LEVEL
# Log level to use for celeryd. Default is INFO.
#
# * CELERYD
# Path to the celeryd program. Default is `celeryd`.
# You can point this to an virtualenv, or even use manage.py for django.
#
# * CELERYD_USER
# User to run celeryd as. Default is current user.
#
# * CELERYD_GROUP
# Group to run celeryd as. Default is current user.
# VARIABLE EXPANSION
# ==================
#
# The following abbreviations will be expanded
#
# * %n -> node name
# * %h -> host name
### BEGIN INIT INFO
# Provides: celeryd
# Required-Start: $network $local_fs $remote_fs
# Required-Stop: $network $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: celery task worker daemon
### END INIT INFO
#set -e
DEFAULT_PID_FILE="/var/run/celeryd@%n.pid"
DEFAULT_LOG_FILE="/var/log/celeryd@%n.log"
DEFAULT_LOG_LEVEL="INFO"
DEFAULT_NODES="celery"
DEFAULT_CELERYD="-m celery.bin.celeryd_detach"
# /etc/init.d/celeryd: start and stop the celery task worker daemon.
CELERY_DEFAULTS=${CELERY_DEFAULTS:-"/etc/default/celeryd"}
test -f "$CELERY_DEFAULTS" && . "$CELERY_DEFAULTS"
if [ -f "/etc/default/celeryd" ]; then
. /etc/default/celeryd
fi
if [ -f $VIRTUALENV_ACTIVATE ]; then
echo "activating virtualenv $VIRTUALENV_ACTIVATE"
source "$VIRTUALENV_ACTIVATE"
fi
CELERYD_PID_FILE=${CELERYD_PID_FILE:-${CELERYD_PIDFILE:-$DEFAULT_PID_FILE}}
CELERYD_LOG_FILE=${CELERYD_LOG_FILE:-${CELERYD_LOGFILE:-$DEFAULT_LOG_FILE}}
CELERYD_LOG_LEVEL=${CELERYD_LOG_LEVEL:-${CELERYD_LOGLEVEL:-$DEFAULT_LOG_LEVEL}}
CELERYD_MULTI=${CELERYD_MULTI:-"celeryd-multi"}
CELERYD=${CELERYD:-$DEFAULT_CELERYD}
CELERYD_NODES=${CELERYD_NODES:-$DEFAULT_NODES}
export CELERY_LOADER
if [ -n "$2" ]; then
CELERYD_OPTS="$CELERYD_OPTS $2"
fi
# Extra start-stop-daemon options, like user/group.
if [ -n "$CELERYD_USER" ]; then
DAEMON_OPTS="$DAEMON_OPTS --uid=$CELERYD_USER"
fi
if [ -n "$CELERYD_GROUP" ]; then
DAEMON_OPTS="$DAEMON_OPTS --gid=$CELERYD_GROUP"
fi
if [ -n "$CELERYD_CHDIR" ]; then
DAEMON_OPTS="$DAEMON_OPTS --workdir=\"$CELERYD_CHDIR\""
fi
check_dev_null() {
if [ ! -c /dev/null ]; then
echo "/dev/null is not a character device!"
exit 1
fi
}
export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
stop_workers () {
$CELERYD_MULTI stop $CELERYD_NODES --pidfile="$CELERYD_PID_FILE"
}
start_workers () {
$CELERYD_MULTI start $CELERYD_NODES $DAEMON_OPTS \
--pidfile="$CELERYD_PID_FILE" \
--logfile="$CELERYD_LOG_FILE" \
--loglevel="$CELERYD_LOG_LEVEL" \
--cmd="$CELERYD" \
$CELERYD_OPTS
}
restart_workers () {
$CELERYD_MULTI restart $CELERYD_NODES $DAEMON_OPTS \
--pidfile="$CELERYD_PID_FILE" \
--logfile="$CELERYD_LOG_FILE" \
--loglevel="$CELERYD_LOG_LEVEL" \
--cmd="$CELERYD" \
$CELERYD_OPTS
}
case "$1" in
start)
check_dev_null
start_workers
;;
stop)
check_dev_null
stop_workers
;;
reload|force-reload)
echo "Use restart"
;;
status)
celeryctl status
;;
restart)
check_dev_null
restart_workers
;;
try-restart)
check_dev_null
restart_workers
;;
*)
echo "Usage: /etc/init.d/celeryd {start|stop|restart|try-restart|kill}"
exit 1
;;
esac
exit 0

View File

@ -1,210 +0,0 @@
$ANSIBLE_VAULT;1.1;AES256
30636262636630653738383536613136363733643931316362326266656433376333386239373962
6635343138326335313430623566656130663136393531310a343562653666623235336539316561
31386163663632383436343735376266356134386335363637383536613531323231626535313236
6163326630306530360a663636393463303062316331623630353235383137333831333239393134
64353830366463376130633831633835313034643930636166396436373063623039316465613964
61333538656264353735613034356533353331313735393965363164616331306538383231303932
31373838363862343931643034643863313738636238376634363430613365356136323237613530
34323339323337383539363462303863663163373465373262636161346662333738663532316363
65313464333363643461353539306662353364643663373032346531633362373230653061646436
34393462326137336163316361363937323738663632386662643338626433626433633235323838
65653036643961626131383264393138316263366534656663386264376638393639636164323661
61646166376637396131356339313162343762636234643236316363643063326638366536656534
31616164313164373336666634356639653831623966333739356462656137363161663635353136
30653665353334646165663333643863643539373331613263386561353030363862666264353933
64643439336236386631393934623839626163373463653134656539376262316233626130363663
65636534303431616631633534643030346534633635393563366266356138383938636264383632
33616365333863393733646565643236613064616462633661303630613963666236663265636361
61376336346262346632313833633735356364636239366439393265613866316439643732326330
38396332363666656636646164646262303162656331636661393738626263383563646261323036
63363634616362323965616639373961333966303366363937333233356631393938383339613262
39393461316563383131666539333938313437336462376233353464303739356463323265366665
64316161333431353264336236373466613230363237316633386661303538666536366462323666
32373164626330313665653133356563383436663765666437636138343163663533646331346631
31643638373537653533353036653766663935663636663561343239383666333661343830353133
34363363333466393761643863393436386231626134663236326335336438633338313963646363
30623262386437313733353038353231353163326133643139633963303864633739383935363664
61336265656666643037316139306534323135333763383230633261336139636362396539643539
34303937656634653862383665356530643064383832363163343331383538623236366535393061
38373738393064376539343837356335326132363135323935333964383635383965656462383636
63663661626632396663383838353633663839303936646537363266346661373033663064326435
62646130376163623363346232346530376638613934623831303636366365313331613436626337
61346262333933363366653166326330663638643230373364653161333263323035366263623330
66636532616234636263323366626432363337326564663531323663356166303930653661313030
32363133313162313331623138356432653630663263623935303739663363323130646133613735
66333933393266663265333036616465353338656664313230643761303439363035663566393930
31303633396665316330623962643439313132633531656362333630653537393061316663356566
39376230643830333035316439346336313464623238373739623636313236316162356337313339
62376533663138613962306331313066383439373039636631633431316232643266326361666134
64383437636561323964346134663032663466333831663836393039353562663065643337303330
62356666353662386439353563643735633730613463666263666539323333613130633765393834
32343439306636306131386537373164363636386330623534373535323631396464626661323361
38353935623566373834643661616631373333303735393835643737626234643337653130396365
65666332323665356330396238633866653761346531303439666236653264323661626135353238
36643562623266636333623831303439336366646133653332313130336436386537653234666435
31343863376233623335366333363232653966316230363836613231613130613166643864373565
35356264383335623539643630323534623265313631383130643739306533663330396434653236
64376166373639363731663437663331346338373539363637353933386239373738373565353030
64353261366232643061356165323961383537626239623732393936623461393961353837633733
34356166393938346232396532353166373534623530646335633338633636336636646630356561
32363061356632313661386535306339636135623834333231303433343037353633613365326333
37666235323239383661323536353830383833326565346564663631336465313664346533323337
38613961313233623033386166336235383362393463393832646538373139333533313266303937
62346532356632316136633533373665373839623336383435353163386531366466646664326565
30303639393933373361623333326432366332396137396238336464376131323631343637306531
37343933373139333333623233386334636436356432303764653235353133366566383031633136
34616133336663623664616432336265323534373163316338386561623864623861343835633062
34343738616134366164356337663566326462303933386139643734376332313066613230326363
66623837323238356366333836386662366435626236333835346662623631373636663033623733
38316639343638313937353636616638396261333561313032383130393538663366636630376539
63353566613835343964356635303939343764396631393738646432313765666564316363626431
65346637656137363266346266616666316361383231343666643063353131386163356638346636
30383932633264373031373935616230323933373863663564363233313232363066326662303165
63346532313837396365353365636663313334626433303732326164363330303438636333636163
35656537623165323666633435386465303063633534656630306664343637336164626433373361
65376530333361303337623634353434373164626133626263613561613436303161626432626239
37343536313531626233343530633634613166633735613233393962323165623166366161356336
35386635366631326266343432386161663033323962313763343163663137643631393166333031
39346564656665343835616464663231333562616661643234326663633563303964386131656363
63666363356562383830646633396238623537336439326162376135633665653165326536353037
37313362666531333837633439643165356534383265643637363933366463343839333961376235
63333063643634623735363233646334633235373132646139313365303336646264633061643131
32616465633131356130396465643235353530326564373136313133613064313562306333313965
38396237653430353533353462373130303262663564653361313465353934353864656235653135
34613639613633633234386639633230653537393965323363623338656465326531346432333637
64343436373436356535333865643865373539393036626137626538626635653637666362356162
30313632396539623962346562646563316264613232343730643565386135346664646363333330
66656661636235633730393063343634636138383264336535326533356231626530613565336161
35626232343436616535373230653039303065343432343738616363626635383364373266323333
33376364666638313564366237356635653731623566626661373961663736666638343061646134
35313438356531383433636565326365313063383834613837666330396331353738323237363333
63363963666465313137386537356462663636323737306362326362363266343062626130616230
64363433343738343632636633373330386464396364383031343531663432363563653032336332
65366364333133386139636165303964366165326336316534323636633462356335633066643165
34613030323234383965396233373333393336653237613062323530353762633931343333323865
30663862373132633834353039653032373737313564333638333762303335636265646162313931
66393662653933363832623061633634626661356437663331373937396631356131333462656666
32303166396533643261646130306161326561326533626531663038643565376439633339333432
64333437366566666366303230616539663564333463666631646163356235636333363633663639
37666332346161376239656137306430623463653466626663636539666532373565373731613165
62663532383165656432313762376235333331343738646532373265353066363262333261626137
31396332383963353066336666366133336138653363613863653833653964663164313831333065
35333738383232656634356564643634346633313137333863363766643433363631333630643731
65363161303235323830376638303135613630663362653566363965313436323033643366306630
39303935636639333961666135633962653362666536663333623430356164376262346662643635
33323663333832316633373035386334623134326536366236636561373635353366386237323933
62393435363235396262653065656562383063663236323134313833363833396131643533666235
37386366343933376338336533316239383430343566626434303537653431626261363438336334
35363961656332336230386535386531363761303766313563333832633033646461393635376339
39633630336366373663666239623030326331346361323132363565366366616236346230636632
38376534363933383965386338313835356135663035326536343532643930383466633538316538
31353038656533336335376265626139333364633537633662653362393666346163386431326261
35393261353230373034633666663638306134643066643533323761666264326162343630376661
65613733343866306364333665353639646263323863663562333965636335613966323564373535
39363939383031393265613035376635663962386530663639356331393830383130626439346666
31393532316431393666616535363430636637366134366636643730636431343034336539616135
38633063333063383766386265336363386362383136653536616663376463333935356162343930
36383831666537313936393033363738666335653739646431363039373939626538343037633631
39383439373336336561663431626265666434646565356438336530643863656464323034353565
36366563323836336162373465313938646239373637613066333238323533346338353834636631
30333262376638336537623466643736653562336336663436333963366464666131303862313335
61353862656435653939343362393934303633303333366231646431656234656638613033383133
31353262353231663633633063663537353536383138366132646364353661363135336333323133
64613231626662666364313232333633386265353935363065333933666165633862393965326637
63623962616164626237303466623565623032666431383633323233633861326132346263386631
64386364653633363965356664636434393031383663393137343733343732363239633436663636
64346237653966363538303632363461663030396237623661356438653562396232313935626164
64326162363264323831663965383639393937613931663239316663323164306537326363376339
33333063373464363065336132613230643831303937373163386263646562313361306133306639
36636264373638326663613236353439383532323032393431373333626330313235623362643137
30636462643536363638613936383931363663343964363038373834343164633062343265666137
30373734396232343936326330623362316636616535643136313765356439323934386364643631
34316630366332366432373739363637623437363132646330326361363366313633343634383132
34626633343163613136343665373931363065306232313336356461373366623934306563383935
35373930633334343864306165653034386133393636386662303737303136613432333531313461
62323065343037386231656335326364363761396532346661343664636637633334383131613833
34306465643133383239306534383035303363353766613631643464383264656536323866326464
38666665613166653638633039666261326135363833393832373564333765353134636138343266
64373536313666353332613535633061363835363839323430333430643863343461643236333937
62346262396331613536343539653766323561343639643766653535353335383736333464613331
61336337613737356236636333393236653263663065353431633537666161373638663861363863
36393364616566343561393364313531356134626431646261346363343939616332313631636331
31393435373265313836653533323237613336333061306330636665626233613537383932316235
35646633653664313834376466306335653465613866393939323265316436333062646662656462
36313861306533326163306266353538396436386365393464613335646432366461326331623664
35616665666337663163663631393539663731376333393339373065643363326535643563383532
63656466623939376632636433316661613730386363363930613830386638653837323938373030
34653565386564333866336337316164663931396630333634336130383465643061633239656638
66666166303835326365353433636130653038643938653365333431646561306536623037666231
30333830376637653932613961353931363537336462643030376537386539623636303038363862
34373036393931303465626563623664663532666166336334653234346561303538313036343565
61363734333737393131643661326331383036333363653333373536373134306436646139636561
61386462323832653061313034616532643265343636313366346537356164346461313436373637
34316663356135636231613330323431316566323361363636633436653864633564366366383339
61633266343336643430623138326436383361636161326264346365643536343838333138646563
65383230373361663461383236313832366334303632313935313263646266393030313238613334
66626631323033383334636561313666653165356135366435613438323662353135633234346662
33333336646166643862396361383636306431353439333562633533303265303266613662306162
34383062333166393739656365303738373361373436343064323636336634353232383232356334
35633561383735316663383333303334633631346339323562353634396533343636653963653462
61393039303366626563393737306336376437666138393562373933333335633435396632333232
39666435383832663462626563646162666565393530393164373963386161666436343263316639
30343064663133616135613164653937366636353062303139366261313165373362643365316663
33653630633732623466343236646136663730663938333234613163663835393036363161386332
62383833396164313132633535323530633937626437383462663866346163623234663564306533
65326362636433333930623663653031313438363930373462663639366434633665656138303866
35626333336532346663366530303061343835376239643466326361613030613730326130633165
39333465393466336231333335616662386238346537633164666636333133306266613064343165
39653963346133333234353266323065656237303233623264376233616334623665323433623632
63316262306337386535653233336635616438356565343433393662653036663736663663666435
33333433343566623331333961613662306236386439386135653138333638366566313534383934
62626261303530306237653637363933393634663330336462393932353230313730336362376134
35343530363431323366613361643636663961366238636537616237633965666639633265376437
63363930353064346664323435313136316132373237356332383537623032633831353563326230
65626166336166363164613130393165356139353439353436666537346362326635386136313464
34383633336636376137643733313637373535643966376435353339363535653139313739313362
65343434343364666639306663663665356533323635316534316561313263663662623764326138
38386434316535653262616530643164663335323436386365313361656430616535346463643765
64613231623333363835386337643334333039363835343731316165346438363234666134343263
63663036663566373734656661613432623761393964313166393532396664326230363230303161
36373364663137373234383134363966633935666365303430343539663461623561383236626137
66623964333766323534316439643666323666336539393566316331363862666561656634326166
64383236633638663163666236633531346330643066353566336337646265623361326261373862
32626538316631303465396436643236376161613232666339373537383438633630316365363065
31653433326333613431303936333137323632383163323561313636396331376664656365326536
39323632623861333466333530643864616166623261346237356431326335343431373164633366
34363932656234613431306135323434353164323461346262656337336137616430386533313933
65306566373634363933616233316562643930666161643234323864336631343032326462623365
65363036633061643463343637313933396436636333663861393333353732383736633534303864
62376339343938383639626237373961623931616264353264353337333133396564623831643338
39653962623766643239393061643938643066386564613932656565306564303066316165336230
62363330653137616666343333323636663462643264656364396138626265623964663730636561
31356339323934366637623165623039323439333434653336623962643734653436376462386232
64393863353164373734313262383638393961623466653034626666353361393230623933373336
35323661333330393835363064396564613766626665623866346334643463663865323264386661
33663561616131616134333564343334343765373061393131376231653536353163643435613564
32376466363230363930393734663433313133646238396366356361663636343362313237303766
63613538383836646333366664313637333537303333373537646130393631656636623461383533
31333661376236323736666136393062643566313131383165663965656637303634366330666539
61336265356662336236626432643738343038396263393665396337633837303761613332623436
33313235323938333333666437613731376562376233353664313362356433383938376436373863
32633131386462333838323536333439323733393266376632386530366363633337323963353437
37653334626434616433643930363765366439613236373731343339613237633962356531303433
38333261613062323963366131633738613463363364653531663639626234383263633963336635
65343330636330353363356134363138333031393838623635343335393462343036316638623861
30323638373032653331616361383338333761386264623435656561623337303863323536633932
61613964363538313435363231613834323333336364353962346265646233613935313632343738
65303732376561643763336162333962353136663136613466666631323063646432323130616266
65663431626562646537366661393638346538336538666466343261396431383232356238353062
37653031653766333931393763346366356563393261363438363535303163303962306630306665
62346633356463653465363965396164323437346132396138316562316237303033396233636336
30623039326132393534633937623363656666663366643130633161646566386135303939383762
33356334636565643761323638346162373636323433306436303331336432333830623739643237
64646432366466326139306663356438613433366534616462383938646239643262373836363032
61623735666238626435316530363833366135633563663530643631623539333832343561323138
32383138303464393265373665333736303861646464373861613730653861353463323837383737
30356437653833376631303636393739636663663936656663393130616637303332393636363431
38663837393231326536643033376663316138363234306637613135396365616636656236646335
33633962626135343564633337663936393031316133646334303635653130626131646531396134
38343631613562393435326139366330373064393839636138323466646533303538

View File

@ -1,100 +0,0 @@
$ANSIBLE_VAULT;1.1;AES256
66366138323934613133623237633539616236326462373461303832393739313466373236323765
3461353265343631356335643139363335356262346238360a383136303237393662303762393766
61346362386338663037396631633932373834303265383662356539323766393466656564633465
3835623862356266390a646463633764653431353537643265363764653934656430646363373335
32343135303266623365656532633061373564623664616564343638636138623433363964303366
63323939396365363539366562626135626662336236313963613233633637313731313465363636
39386237393034383263346164623036646535623463306330663034383632373836333661666435
61656662353762653266363036373430343333653835646365613835303935396230363032636164
64613730663339316261313664633636613763313631653839313465336562633663306563633561
38613661333766366633333463376162306365323330356339613266326331353866316638363237
33646165313865313431666163613234366133616263396630303362333336323638373131396334
39656534616331643530646530316335633730323166373830353262366465306631636339316266
32303162313438373531616439356563303030383136613531353561316234353632646232396433
38643463333836326435303733373239626562363264653532323334356262346133633361373963
64396564313630393164323231313937643435613234376436386563623435633666616331643530
39366536616165303562663638313739353763656134316132616162303161623130616263306366
65613264623935333134383733353637653336636532383165646338303633353330623231383239
39343834643038656539623162353561646364393162323839643533333363616437393239313034
61356134643031356536653262663833336361653632626364336565616163376238326334663661
35623338393730636237616161383032353762383965633962343330353235643363346633313462
36653365346263323062653239373132323734626363623337393635373738663931656363383136
62613836356562363866623436393131323130306636356235343035333534326331343337383431
38613565383365666632326238363165313631373262336234666434313065363363346636653339
36363432306639303266366665643934346562663934666665343030396233666534633438396332
31323662363130616338333233373961316639633436313737353530646135373533613433353034
62346432623261346334623738663835666639616564373961643439336432316365666665393135
38623936616361313634333339353133633165663936616332323938396533393235636435376439
62633537633136386366313934373263383730633334343636373035316638343334356530613530
63396438343139383439666539383531386437313865303864316437363563663065643266353138
66323133646463653066323466653662653736306162636565326663386362366332303761653564
31383133396131663563343339623563363239363763643530383833353263646264363565656535
64343737663261653530623836356430666462633964353832663964396462363430623336646336
65356566653938376132663230333033376261376538306266643565613561373636383532616139
30396564613564333964303262656162313839663435666539393734376639653562643735393037
34613864353764303661653561383466663730333932663139616164333239633961326632346230
30316138626562346434643033303333333234396533626633333437316636323062643035623664
38626434366261326663393839343765363133623339373738313563653736373565336164356435
37623837343437623833623137373662653934363133633366636436663831653737376631376431
34363461323535323337343632653430333961343165633864346132343938313361373864363565
32663734626631323930613638323133396135313562643536343038366233373136653330626239
65313933636136303365353466646533353236343934356330356161343433643139383764393134
32356331653831633832376262356238336634353362373837646563653835613634356463653466
30383361356631616538333565646435656361313839346165376231643633643634313863663137
61333236313436383464663439366637643663356535613861343831663737623364303339643733
36373461323130333639613235373961313736303436666361613134323265386165616237393164
34366530363034376437393866333861646636396434636631343033633565396164663833623331
32666161636163333266393361383838653333326437303235326565306663356366613430303237
65343937653439353334343834303234643136656565366461393838653739336233613234616437
62643065356462306565363964663332663564313734336239633833306135613662633535666662
36616639323332353864383733393561666464313466393535373961613831313463306461663266
37653230663732393061616365656638623830346536373932636461663532343532366566343436
63376365643061623839393139333661643439376363396564363237346461393264663131616162
32396464363231613231363561373334646362636536343732396364653132663664366434313538
39396262333232383934396335653461346338316564303563626363646136633266393937343434
34396234363362336232653136666639613466663833303062356264633461643932613162303031
33663539366332643538353632336433393564366565323034393531626236353432623531383033
64613435623761623562363563323364396166353265363039663932626431666339376632353539
63656330626438653366396635353236663762666439613237623638663731306331313564333239
37363663366134303037376433323735366266613831356635663932626162343639306366386439
61643831336139303133336366366165303934646362303665643135386462353565303932383930
33393334353235306534366339613066633434393038636331366265336163306334323638393264
64313538316632373430656532623532313063613337626165353365303832373566316131666336
62353062343565633836306235343134323433303633346130363362633263343564616535396263
65666666646231336636616364646565303538343361653932356135393161316335343333653439
61373266633033653931623631643430613137393633393063353833306463663630333434616462
33653230613639616531666335336131373636323065616239313733323664623138313964303930
35366665626362303161396562306639613435396331366363616138613735383030366362396337
66356666643131393433343237346533383335376462383566643035616438396366633737393133
66323630656539363237646663363764363536373266383036636166333834366663613863663533
62393235666666653433613665376431306439616138633533656362323436613231303264303764
30336665336661393866343935313465626264303139353632356137663439373232326339393136
64306365353639626565653965666133346364613538333135653831663032613135653263353965
63373532323062653630646363323063383065646562313539373637623463313333313535323866
32363631613035653637663935313535626333333433623735663439383239373231613037303736
39633436383361356633373037333362363861346263313038373131653938663930666538306432
34386163316163623064376132653062333535396631393363393265303964356431663439636234
64636138333031656364656565346163663533353333353666373466373734633263626439316230
65313031396564613163333364376637303539343563613133613133376239623066303139393866
32623135396134396439653061386561666433613536336566613530656530333433343537623866
31333364636631336264636531343365633264633433643661353164653831343836323763343033
37386131306563626437343034333330623932303639646631613239303331646364323465616562
62353030633765393237653161636165363465336136333264373832616537356531313066643263
38346331383061373133353132646562313630643335376565396662653830656538356165356137
31396232326666613236313961636334383962373533613566333930313866373334613064376561
65313565303630326531613131316463386636623830346131656532363632613032303466623334
33353633663730306638623566326533363065663363373537353130393938313936383763663966
34336535663565633162313732376237336463343833303939353965653665356563326534643033
34343638666463363462363235343731346461336235306264643866366235663961363461373930
63326334323363656263616531373861633936636339623835323936373661373364336233316631
66366462643663316162383438376162663065633333353138363836353331343162396636623130
62383461626534386664633166323764303631373731366133633930643232303934666535393237
35373462313561353561643866623761313839316662373134363431373562373062313430613462
37333635313037656433656363313864653037313732656232323639383838326263323564643263
38373337353635353836366136326334343661393064316139373431313330653966323763306337
62333066323961623535336232303234636138306630313732373364613363663434633734346231
64663930633162313937343130343961356437353366306338663636366631326366663938363531
63353863306137653237656330656237356563346337343262363664313339323863616438373537
63643235306137363264383238316434313331336337356364366261313835656562643566666130
633536646634326262663866316566376638

View File

@ -1,89 +0,0 @@
$ANSIBLE_VAULT;1.1;AES256
32373237336239343336393066383464393861636235623430343533636365306430323738643234
3538336532623734333038333832393735343363363566340a643638636634653735656635336338
39396461646661353061373636313032333065373562373036336232346133313334333862353034
6337653431323235650a663536386561366531623363303963353539326339393034313961393362
30306235623461326365646365373835333235303965336635363361366336303236333237383539
61383438316464336338633163366532323435616563343463623266346632393930353332626137
34396538653134373433333461373337333639393530383738373764353731363264373835626364
35393163333462343562303136313264653764333038343838656562653133353934336666643534
63366264393462643065323865303033636133663164366334313564333262633736626263363338
39376164343330666332333534313634633137653432343232656464363066356336623166303030
34653432366563663432343164636665373139346435396135303736653030653930393963663538
36333636623832633630386235623365363065343936363031613165383534353837353231373164
37373038363361633330653633396562323738663739316634666137306161313233633561383064
30323236643635663766393862343363653866303431346535626565356162353433623132363031
62656332383835386136656534636135346234326561623037396239303034353961396134396334
35303463366439363336363666623064623564323032646337366332666536373064353962373461
63306166616535356231396566316433633062376164303434323639376339643731393461393536
65633363616235343532386435323736313138666661666434643935623266323133336463326532
33326364346364626165666262396133343736656335353732666362613234343163343465326361
33383136636364383466363666316131383366623665323561636130343337613539383134646535
31383131623237636433313133336162633537653533383435336461616439343035336164333363
31623638333465306538313637636436626132656534313064383663393230653132333938343537
65343339333037613332316534336133373864666130303166393038373531396266303832383632
65343531616661303363303966303230353630356437336164383038366563363166363763396464
37386330653563613063323438363737313565363130353264613236346565323837326631363935
31346365653938653566646437623333326533646235343966383031656132396539616661393461
65333235306432666539623964393132616436653430383236353033333366336363323539333636
64616563376464646534343838616437306232393262313065353936356235373231613561323866
61383536636361363039656138306131383732326464613931363837376234326433376533643861
32616434383536373532383238663263643862373738333338343332303735663863346331663037
35643637356531323639623533313865656132353139323436363661643263323633363161653235
37636635623865303536353264313263373938366165623364643337313831653161623231343764
33386162623531396234623937633465653930636637623837653138373365346132323731346130
64613338386662653833653034313066636566333839306539666161333333616261653537313363
64656632333462633232396236373666366464623464653434383832333365376532626531313735
30313335353664643566313437393834393262333665666366326463663761626135326434363931
36306439376138313838613532343663383938366333316432303930326239646232623633373564
62316632383131626432333461323330366165366331303735333330363335366265316330663563
64393231393136626162386335626433336337373765623933346237643532366662616434366163
37373832303664303836373434343032313731323362353031346438643335323131366538653334
33643432646339383865386238666134383861616437663238366365663737623663323137613865
63633965323933366332363131313834653564636336303966656663366361353731316336633233
32623339343838373639343534326365346135393137303736346634303863333664376332636634
30303938353536636365353338393932353435383635326435666133353430323464333531356563
31353733323331656538373932643332316332386437373938373635633832383662316537346132
35316339343538343462363237666332376461363262623438623738623732383337373738346235
64333335396336333337643235616436373736623339366236313938653433343661366332646265
34636530666636363764366533643739653561626134393936616632616264663230616164376132
30656336633230323535653766636361626562306262326265626166343036643034303730306164
63356131333739333338353835363430363864333063363238303861323033643534366264623433
30653639633862376232393065626636396137343635343030316630313863323365363764616630
38346336663932626430613437656437313462633039393934653532386535323836366465383761
39323732666339386565653836323461623238316564323333363461396161643338633137646335
66373461633233333337663332323064373662636535376433613232653137353834373630663366
61343066303366666362353837343337386631653461646230656533663965626135383131346635
31623131653264353861353630646662303835643738323565383233336334356264353939373933
31303964346563636437633532383762383234303130366331313864386330653130653437356466
38373135333066336139336332643666373932666565303062636465326236623963323337633634
66646633366532646232326435663065393035386438343030323038663033356639356264663532
61396130643135666266366664323234353065303031343531366532633532363534646536646235
62383531393832643137633332353364333230383361663264623564366539323132623639623939
61323263373866343933653734323661383634636139383833323837303236326364666466386336
34316465346261366131316535303563623238346530643264326539653432633237656133613532
30663738313139333461346163626130343535306538623763343134623832346132656666393761
35316164646635613032326565353163656134616366386364306436303134386339346462653262
61383961656334653564623262366265316364366538353362313233343239396265383235303534
33666366323466303534333165653334343437316435613566326338666336326664616133313062
66333339346335626663323335373939303163623331303133643937653362666430323930623462
30393239633763666463643066393161353235386461633066306235376261346139363330663235
31643539616335396331656364383265346333323661333066353732653336616330303931376164
37643931313337646337333236323939613333303834356662373836633631393736616462363338
31623064303936306330343361313763336239316362633732326564653566313265616566336135
61616538653365313666613366313064623232653563383465386535636530643831633735323433
30353239333166343366643738363834613230316463636339666434633961386335623238353030
34356536376164613338376534353438383039383930316439653732643339653531316530393534
35326165666439396537396464656339333366333535366530353064396436663966333465616630
33666233313537363165333738393362656631386564376365616266393137633931643833343232
62393663663836303563386235383363623966316635366133353165346635373063383666373833
35633264666139616463333339653733376431363761653433653138356364383865633937363433
33313361653536633066656164616331343033373339336334666635353630636532323632323261
39303937626633613434653835376538356164396631326163346465663337386230656139396237
36613762346462626135323233393537616539646234663866353433396530383966613333376137
37373461333561313966303239633834663837656230613830303433353639643431323930633238
63383161313938663737396539663163303161633732393130363737303732313166623534303339
65323162386430393639303435653436656239303032663761626462633565626161656632626162
62386631316434383239303631343536363034626663626430633635353933313533316337613532
33383335326637626535336664626663376332316236633735663339373131373630643665356133
31393664663737326638

View File

@ -1,58 +0,0 @@
$ANSIBLE_VAULT;1.1;AES256
65656166313438643163366632316530386139623538636439633638636566383566646239306131
3938333565313734613639376539323233353932373635640a313831613637383734636539666463
64306331656564626233383831633862623861346364366632313733623263306464636264363965
3933326435396164390a646439366537323232633232373339343538616431343137373338326166
65373365613465616631623463313364396332366539386462333737623737343330393662646533
62353663306531663935623765353838333138346630313333373066303835323461383630306662
34316363316661613865616163393133626139663162393336356665373465353766656661633731
37373563396437366661373134623664393430616532353530303861336238666539306562343662
32613431393331306234643362323961343261376238353635366132623638663463343730343730
37323733313739636238376538323264333238643532306439366463626233613237313933383333
31373064343036616239616562373264653163396265613935656638613662663364633866393638
62303563363763356433376634626234663234323636366232616431646534383730346233333963
31616263353462653932343537343863326337643037326265666433623965646264303066316139
31653864383331626231313736623563316330393563376562303933313237383939396438623231
65383666336565393236326433646561346635356661356136306165323432383531646264323064
31353738663861306135636131333261333964663338636637306665333663313164393537396663
36666663616634323137333835626133383737666632316336313661656434376239616437346636
62643035376637373031636330646638356562643962313336653964616337643064346562366531
33613935656630633736386632616162663535366466663637313339323939646136636165656166
38346562346331323738393934396362316361643538653163333935656139356535363432313532
38633336646332386661643464666263646432373134306639306561663134373164326632613531
64313162303263333534666436333634663262623632366631633865336433303564363138353566
36303862656531343765643965666531613231343035636537373030613932303039623131363830
37346263666637373639643930303438316430663462333430613335613131396566303533343864
62373439663236636232353230343433336137613930623133303936323562313061336637306566
34383336646336663263373334323131316262613136353239616630303264633238383266323464
37623864646331363735306132393936306162393463313736366166656439343039626434353739
37613532393830323431393964333437306366313335393434323463346133343237303732343962
33373164363135363335323435636666386231363463373864663933373430656239366539643164
30323038323739373965616630336166356362653833303132336230323661373737666232346630
38393933303736306537383364356162656339613461333262656137636662303532663737636237
36333661663734643363636661353337616162396666356663393432633361313534333537393161
66666165363635346162623965333061386563663166643736653134303638613332313637333064
65333438333661343664303361316631643763323164386330636139353932646635393963656336
36343362323332336130633533663234343236393639323062663962633336626435653137306539
63633866616438623764616631663533363233346362336132303861653039386133323965643863
30633932646132633862666266323761656438343935636332326263653437333366306338636137
65303538613661373538313437646466393536313665623666396235353962306634386261396337
61376439636531383631383234313230303731653435393964393835393236653739316634623363
61363730333632323039326438366633336462656135366164663434383561356337393636353661
64616435386238316265386565633938623935663332633062316163356337303765366262313534
61396361326333616136366435666662346637663864326561653634313030303033303132366132
64353635383932633733303333636137323237393764396136313661353463306137316563303232
32363063626630343230333065376638626236653532383766363161313862616336396334303764
38393262613531343134653130313237343036383464393739353631636235343930653537373935
63306431643132643362656433313061303838306164643236316166303331313636376431326239
66386635333631653232383664343864383739663364363131373062623835363635393930326639
33303733353761336638363935316232336533366339396166383539363963373536346232663865
39613463386138363364316365373161313130316638616635313235363235396166323935353664
39646163306161323536366532333231373530636234643764366134306164333431336636333533
32333966393634393135333031356533666531613262313432346366373262373565323962323939
36343764303866653638336134653263616561396332643030356434383531343166356466646633
37336564613131633534313064303933633134393131656536383439393633366164376636353634
34663236663163633338303838303733643262363834633064313532626631646239306564313361
62616331306330636366306633366430353964376466313032356434346532366362356136376536
33613962316539376138323033623736366531643261386535653733303465333331383131666530
38336561353633303639616635656566323130616561656235393135616631356334

View File

@ -1,6 +0,0 @@
---
- name: restart apache
become: yes
service:
name: apache2
state: restarted

View File

@ -1,96 +0,0 @@
---
- name: Install apache
become: yes
apt:
name: "{{ item }}"
state: present
with_items:
- 'apache2'
- 'libapache2-mod-wsgi'
- 'cronolog'
- name: Ensure apache is running and enabled
become: yes
service:
name: apache2
state: started
enabled: yes
- name: Create apache config
become: yes
template:
src: apache.conf.j2
dest: "/etc/apache2/sites-available/prod.conf"
owner: "{{ user_name }}"
group: "{{ user_name }}"
mode: 0664
notify:
- restart apache
- name: Create static directory
become: yes
file:
path: "/var/www/static"
state: directory
owner: "{{ user_name }}"
group: "{{ user_name }}"
mode: 0755
- name: Create WSGI Script
template:
src: prod.wsgi.j2
dest: "{{ project_path }}/deploy/prod.wsgi"
owner: "{{ user_name }}"
group: "{{ user_name }}"
mode: 0664
- name: Remove apache2 logrotate file
become: yes
file:
path: /etc/logrotate.d/apache2
state: absent
notify:
- restart apache
- name: Disable default site
become: yes
command: a2dissite 000-default
notify:
- restart apache
- name: Enable prod site
become: yes
command: a2ensite prod
notify:
- restart apache
- name: Enable SSL rewrite headers
become: yes
command: a2enmod ssl rewrite headers
notify:
- restart apache
- name: Generate static files
django_manage:
app_path: "{{ project_path }}"
command: "collectstatic"
virtualenv: "{{ project_path }}/venv"
settings: "{{ django_settings_module }}"
notify:
- restart apache
- name: Migrate databse
django_manage:
app_path: "{{ project_path }}"
command: "migrate --noinput"
virtualenv: "{{ project_path }}/venv"
settings: "{{ django_settings_module }}"
notify:
- restart apache
- name: Add unglueit log file to www-data group
file:
path: "/var/log/regluit/unglue.it.log"
group: www-data
notify:
- restart apache

View File

@ -1,67 +0,0 @@
---
- name: Create celery user
become: yes
user:
create_home: no
name: "celery"
tags:
- celery
- name: Add current user to celery and www-data groups
become: yes
user:
name: "{{ user_name }}"
groups:
- celery
- www-data
append: yes
tags:
- celery
- name: Create directories for celery
become: yes
file:
path: "{{ item }}"
state: directory
owner: celery
group: celery
mode: 0775
with_items:
- '/var/log/celery'
- '/var/run/celery'
tags:
- celery
- name: Copy celery init.d scripts
become: yes
copy:
src: "{{ item }}"
dest: "/etc/init.d/{{ item }}"
mode: 0755
with_items:
- 'celeryd'
- 'celerybeat'
tags:
- celery
- name: Copy celery config files
become: yes
template:
src: "celery/{{ item }}.j2"
dest: "/etc/default/{{ item }}"
mode: 0644
with_items:
- 'celeryd'
- 'celerybeat'
tags:
- celery
- name: Start celeryd
django_manage:
app_path: "{{ project_path }}"
command: "celeryd_multi restart w1"
virtualenv: "{{ project_path }}/venv"
settings: "{{ django_settings_module }}"
- name: Start celerybeat
command: /etc/init.d/celerybeat start

View File

@ -1,39 +0,0 @@
---
- name: Copy server key
become: yes
copy:
src: certs/server.key
dest: /etc/ssl/private/server.key
owner: "{{ user_name }}"
group: "{{ user_name }}"
mode: 0600
notify:
- restart apache
tags:
- certs
- name: Copy STAR_unglue_it.crt
become: yes
copy:
src: certs/STAR_unglue_it.crt
dest: /etc/ssl/certs/server.crt
owner: "{{ user_name }}"
group: "{{ user_name }}"
mode: 0644
notify:
- restart apache
tags:
- certs
- name: Copy STAR_unglue_it.ca-bundle
become: yes
copy:
src: certs/STAR_unglue_it.ca-bundle
dest: /etc/ssl/certs/STAR_unglue_it.ca-bundle
owner: "{{ user_name }}"
group: "{{ user_name }}"
mode: 0600
notify:
- restart apache
tags:
- certs

View File

@ -1,120 +0,0 @@
---
- name: Install prod dependencies
become: true
apt:
name: "{{ item }}"
update_cache: true
state: present
with_items:
- 'git'
- 'python-setuptools'
- 'python-lxml'
- 'python-dev'
- 'python-virtualenv'
- 'build-essential'
- 'libssl-dev'
- 'libffi-dev'
- 'libxml2-dev'
- 'libxslt-dev'
- 'mysql-client'
- 'libmysqlclient-dev'
- 'python-mysqldb'
- 'postfix'
- 'libjpeg-dev'
- name: Create project directory
become: true
file:
path: "{{ project_path }}"
state: directory
owner: "{{ user_name }}"
mode: 0755
- name: Checkout regluit repo
git:
accept_hostkey: yes
force: yes
repo: "{{ git_repo }}"
dest: "{{ project_path }}"
version: "{{ git_branch }}"
- name: Install python packages to virtualenv
pip:
requirements: "{{ project_path }}/requirements_versioned.pip"
state: present
virtualenv: "{{ project_path }}/venv"
- name: Add project to PYTHONPATH of virtualenv
template:
src: "{{ item }}.j2"
dest: "{{ project_path }}/venv/lib/python2.7/site-packages/{{ item }}"
with_items:
- 'regluit.pth'
- 'opt.pth'
- name: Create keys directory
file:
path: "{{ project_path}}/settings/keys"
state: directory
owner: "{{ user_name }}"
mode: 0755
- name: Copy keys files
copy:
src: "{{ project_path }}/settings/dummy/__init__.py"
dest: "{{ project_path }}/settings/keys/__init__.py"
remote_src: yes
- name: Copy django settings template
template:
src: prod.py.j2
dest: "{{ project_path }}/settings/prod.py"
- name: Copy key templates to keys directory
template:
src: "{{ item }}.j2"
dest: "{{ project_path }}/settings/keys/{{ item }}"
with_items:
- 'common.py'
- 'host.py'
- name: Create django log directory
become: yes
file:
path: "/var/log/regluit"
state: directory
owner: "{{ user_name }}"
group: "www-data"
mode: 0775
- name: Open ports on firewall
become: yes
ufw:
rule: allow
port: "{{ item }}"
proto: tcp
with_items:
- 22
- 80
- 443
- name: Run redis tasks
import_tasks: redis.yml
# - name: Run mysql tasks
# import_tasks: mysql.yml
- name: Run cert tasks
import_tasks: certs.yml
- name: Run apache tasks
import_tasks: apache.yml
- name: Run celery tasks
import_tasks: celery.yml

View File

@ -1,13 +0,0 @@
---
- name: Install Redis server
become: yes
apt:
name: "redis-server"
state: present
- name: Ensure Redis is started
become: yes
service:
name: "redis-server"
state: started
enabled: yes

View File

@ -1,71 +0,0 @@
WSGIPythonHome {{ wsgi_home }}
WSGIPythonPath {{ wsgi_python_path }}
WSGISocketPrefix {{ project_path }}
<VirtualHost *:80>
ServerName {{ server_name }}
ServerAdmin info@ebookfoundation.org
Redirect permanent / https://{{ server_name }}
</VirtualHost>
<VirtualHost _default_:443>
ServerName {{ server_name }}:443
ServerAdmin info@ebookfoundation.org
SSLEngine on
SSLProtocol All -SSLv2 -SSLv3
SSLCertificateFile /etc/ssl/certs/server.crt
SSLCertificateKeyFile /etc/ssl/private/server.key
SSLCertificateChainFile /etc/ssl/certs/STAR_unglue_it.ca-bundle
#SSLCertificateChainFile /etc/ssl/certs/gd_bundle.crt
WSGIDaemonProcess regluit processes=4 threads=4 python-eggs=/tmp/regluit-python-eggs
WSGIScriptAlias / /opt/regluit/deploy/prod.wsgi
# generated using https://mozilla.github.io/server-side-tls/ssl-config-generator/
# intermediate mode
# 2015.03.04 (with Apache v 2.2.22 and OpenSSL 1.0.1 and HSTS enabled)
SSLProtocol all -SSLv2 -SSLv3
SSLCipherSuite ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA
SSLHonorCipherOrder on
# HSTS (mod_headers is required) (15768000 seconds = 6 months)
Header always add Strict-Transport-Security "max-age=15768000"
<Directory /opt/regluit/deploy>
<Files prod.wsgi>
Require all granted
</Files>
</Directory>
<Directory /opt/regluit/static>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
Alias /static /var/www/static
BrowserMatch "MSIE [2-6]" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
# MSIE 7 and newer should be able to use keepalive
BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
ErrorLog "|/usr/bin/cronolog /var/log/apache2/%Y%m%d_error.log"
LogLevel warn
CustomLog "|/usr/bin/cronolog /var/log/apache2/%Y%m%d_access.log" combined
</VirtualHost>

View File

@ -1,35 +0,0 @@
# http://docs.celeryproject.org/en/latest/cookbook/daemonizing.html#generic-initd-celerybeat-example
# to be placed at /etc/defaults/celerybeat
# Where to chdir at start.
CELERYBEAT_CHDIR="{{ project_path }}t/"
# Extra arguments to celerybeat
#CELERYBEAT_OPTS="--schedule=/var/run/celerybeat-schedule"
# Name of the celery config module.#
CELERY_CONFIG_MODULE="celeryconfig"
# Name of the projects settings module.
export DJANGO_SETTINGS_MODULE="{{ django_settings_module }}"
# Path to celerybeat
CELERYBEAT="{{ project_path }}/{{ virtualenv_name }}/bin/django-admin.py celerybeat"
# virtualenv to use
VIRTUALENV="{{ project_path }}/{{ virtualenv_name }}"
#Full path to the PID file. Default is /var/run/celeryd.pid
CELERYBEAT_PIDFILE="/var/log/celerybeat/celerybeat.pid"
#Full path to the celeryd log file. Default is /var/log/celeryd.log
CELERYBEAT_LOGFILE="/var/log/celerybeat/celerybeat.log"
#Log level to use for celeryd. Default is INFO.
CELERYBEAT_LOG_LEVEL="INFO"
#User to run celeryd as. Default is current user.
#CELERYBEAT_USER
#Group to run celeryd as. Default is current user.
#CELERYBEAT_GROUP

View File

@ -1,9 +0,0 @@
CELERYD_NODES="w1"
CELERYD_CHDIR="{{ project_path }}/"
CELERYD_LOG_FILE="/var/log/celery/%n.log"
CELERYD_PID_FILE="/var/log/celery/%n.pid"
CELERYD="{{ project_path }}/{{ virtualenv_name }}/bin/django-admin.py celeryd"
CELERYD_MULTI="{{ project_path }}/{{ virtualenv_name }}/bin/django-admin.py celeryd_multi"
VIRTUALENV_ACTIVATE="{{ project_path }}/{{ virtualenv_name }}/bin/activate"
export DJANGO_SETTINGS_MODULE="{{ django_settings_module }}"

View File

@ -1,13 +0,0 @@
import os
# all the COMMON_KEYS
# copy this file to settings/keys/ and replace the dummy values with real ones
BOOXTREAM_API_KEY = os.environ.get('BOOXTREAM_API_KEY', '{{ booxtream_api_key }}')
BOOXTREAM_API_USER = os.environ.get('BOOXTREAM_API_USER', '{{ booxtream_api_user }}')
DROPBOX_KEY = os.environ.get('DROPBOX_KEY', '{{ dropbox_key }}')
GITHUB_PUBLIC_TOKEN = os.environ.get('GITHUB_PUBLIC_TOKEN', '{{ github_public_token }}') # 40 chars; null has lower limit
MAILCHIMP_API_KEY = os.environ.get('MAILCHIMP_API_KEY', '{{ mailchimp_api_key }}') # [32chars]-xx#
MAILCHIMP_NEWS_ID = os.environ.get('MAILCHIMP_NEWS_ID', '{{ mailchimp_news_id }}')
MOBIGEN_PASSWORD = os.environ.get('MOBIGEN_PASSWORD', '{{ mobigen_password }}')
MOBIGEN_URL = os.environ.get('MOBIGEN_URL', '{{ mobigen_url }}') # https://host/mobigen
MOBIGEN_USER_ID = os.environ.get('MOBIGEN_USER_ID', '{{ mobigen_user_id }}')

View File

@ -1,5 +0,0 @@
import os
{% for key in common_keys %}
{{ key|upper }} = os.environ.get('{{ key|upper }}', '{{ common_keys[key] }}')
{% endfor %}

View File

@ -1,47 +0,0 @@
# host.py
# copy this file to settings/keys/ and replace the dummy values with real ones
# or generate it from the ansible vault
import os
# you can use this to generate a key: http://www.miniwebtool.com/django-secret-key-generator/
SECRET_KEY = os.environ.get("SECRET_KEY", '{{ secret_key }}')
# you'll need to register a GoogleBooks API key
# https://code.google.com/apis/console
GOOGLE_BOOKS_API_KEY = os.environ.get("GOOGLE_BOOKS_API_KEY", "{{ google_books_api_key }}")
#
GOODREADS_API_KEY = os.environ.get("GOODREADS_API_KEY", "{{ goodreads_api_key }}")
GOODREADS_API_SECRET = os.environ.get("GOODREADS_API_SECRET", "{{ goodreads_api_secret }}") #43 chars
# Amazon SES
# create with https://console.aws.amazon.com/ses/home?region=us-east-1#smtp-settings:
EMAIL_HOST_USER = os.environ.get("EMAIL_HOST_USER", '{{ email_host_user }}')
EMAIL_HOST_PASSWORD = os.environ.get("EMAIL_HOST_PASSWORD", '{{ email_host_password }}')
# twitter auth
# you'll need to create a new Twitter application to fill in these blanks
# https://dev.twitter.com/apps/new
SOCIAL_AUTH_TWITTER_KEY = os.environ.get("SOCIAL_AUTH_TWITTER_KEY", '{{ social_auth_twitter_key }}')
SOCIAL_AUTH_TWITTER_SECRET = os.environ.get("SOCIAL_AUTH_TWITTER_SECRET", '{{ social_auth_twitter_secret }}')
# support@icontact.nl
BOOXTREAM_API_KEY = os.environ.get("BOOXTREAM_API_KEY", "{{ booxtream_api_key }}") # 30 chars
BOOXTREAM_API_USER = os.environ.get("BOOXTREAM_API_USER", '{{ booxtream_api_user }}')
# you'll need to create a new Facebook application to fill in these blanks
# https://developers.facebook.com/apps/
SOCIAL_AUTH_FACEBOOK_KEY = os.environ.get("SOCIAL_AUTH_FACEBOOK_KEY", '{{ social_auth_facebook_key }}')
SOCIAL_AUTH_FACEBOOK_SECRET = os.environ.get("SOCIAL_AUTH_FACEBOOK_SECRET", '{{ social_auth_facebook_secret }}')
# https://console.developers.google.com/apis/credentials/oauthclient/
# unglue.it (prod) SOCIAL_AUTH_GOOGLE_OAUTH2_KEY #2
SOCIAL_AUTH_GOOGLE_OAUTH2_KEY = os.environ.get("_KEY", '{{ social_auth_google_oauth2_key }}')
SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET = os.environ.get("_SECRET", '{{ social_auth_google_oauth2_secret }}')
AWS_ACCESS_KEY_ID = os.environ.get("AWS_ACCESS_KEY_ID", '{{ aws_access_key_id }}')
AWS_SECRET_ACCESS_KEY = os.environ.get("AWS_SECRET_ACCESS_KEY", '{{ aws_secret_access_key }}') # 40 chars
DATABASE_USER = os.environ.get("DATABASE_USER", '{{ mysql_db_user }}')
DATABASE_PASSWORD = os.environ.get("DATABASE_PASSWORD", '{{ mysql_db_pass }}')
DATABASE_HOST = os.environ.get("DATABASE_HOST", '{{ mysql_db_host }}')

View File

@ -1,5 +0,0 @@
import os
{% for key in host_keys %}
{{ key|upper }} = os.environ.get('{{ key|upper }}', '{{ host_keys[key] }}')
{% endfor %}

View File

@ -1,135 +0,0 @@
from .common import *
ALLOWED_HOSTS = ['.unglue.it']
DEBUG = False
TEMPLATES[0]['OPTIONS']['debug'] = DEBUG
# we are launched!
IS_PREVIEW = False
SITE_ID = 1
ADMINS = (
('Raymond Yee', 'rdhyee+ungluebugs@gluejar.com'),
('Eric Hellman', 'eric@gluejar.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': '{{ mysql_db_name }}',
'USER': '{{ mysql_db_user }}',
'PASSWORD': '{{ mysql_db_pass }}',
'HOST': '{{ mysql_db_host }}',
'PORT': '{{ mysql_db_port }}',
'TEST_CHARSET': 'utf8',
}
}
TIME_ZONE = 'America/New_York'
# settings for outbout email
# if you have a gmail account you can use your email address and password
# Amazon SES
EMAIL_BACKEND = 'django_smtp_ssl.SSLEmailBackend'
MAIL_USE_TLS = True
EMAIL_HOST = '{{ email_host }}'
EMAIL_PORT = '{{ email_port }}'
DEFAULT_FROM_EMAIL = '{{ default_from_email }}'
# send celery log to Python logging
CELERYD_HIJACK_ROOT_LOGGER = False
# Next step to try https
#BASE_URL = 'http://{{ server_name }}'
BASE_URL_SECURE = 'https://{{ server_name }}'
IPN_SECURE_URL = False
# use redis for production queue
BROKER_TRANSPORT = '{{ broker_transport }}'
BROKER_HOST = '{{ broker_host }}'
BROKER_PORT = '{{ broker_port }}'
BROKER_VHOST = '{{ broker_vhost }}'
LOGGING = {
'version': 1,
'disable_existing_loggers': True,
'formatters': {
'brief': {
'format': '%(asctime)s %(levelname)s %(name)s[%(funcName)s]: %(message)s',
},
},
'handlers': {
'mail_admins': {
'level': 'ERROR',
'class': 'django.utils.log.AdminEmailHandler'
},
'null': {
'level': 'DEBUG',
'class': 'logging.NullHandler',
},
'file': {
'level': 'INFO',
'class': 'logging.handlers.RotatingFileHandler',
'filename': join('/var/log/regluit', 'unglue.it.log'),
'maxBytes': 1024*1024*5, # 5 MB
'backupCount': 5,
'formatter': 'brief',
},
},
'loggers': {
'django.request': {
'handlers': ['mail_admins'],
'level': 'ERROR',
'propagate': True,
},
'django.security.DisallowedHost': {
'handlers': ['null'],
'propagate': False,
},
'': {
'handlers': ['file'],
'level': 'WARNING',
'propagate': False,
},
}
}
STATIC_ROOT = '/var/www/static'
#CKEDITOR_UPLOAD_PATH = '/var/www/static/media/'
#CKEDITOR_UPLOAD_PREFIX = 'https://unglue.it/static/media/'
# decide which of the period tasks to add to the schedule
CELERYBEAT_SCHEDULE['send_test_email'] = SEND_TEST_EMAIL_JOB
# update the statuses of campaigns
CELERYBEAT_SCHEDULE['update_active_campaign_statuses'] = UPDATE_ACTIVE_CAMPAIGN_STATUSES
CELERYBEAT_SCHEDULE['report_new_ebooks'] = EBOOK_NOTIFICATIONS_JOB
CELERYBEAT_SCHEDULE['notify_ending_soon'] = NOTIFY_ENDING_SOON_JOB
CELERYBEAT_SCHEDULE['update_account_statuses'] = UPDATE_ACCOUNT_STATUSES
CELERYBEAT_SCHEDULE['notify_expiring_accounts'] = NOTIFY_EXPIRING_ACCOUNTS
CELERYBEAT_SCHEDULE['refresh_acqs'] = REFRESH_ACQS_JOB
CELERYBEAT_SCHEDULE['refresh_acqs'] = NOTIFY_UNCLAIMED_GIFTS
# set -- sandbox or production Amazon FPS?
#AMAZON_FPS_HOST = "fps.sandbox.amazonaws.com"
AMAZON_FPS_HOST = "fps.amazonaws.com"
# local settings for maintenance mode
MAINTENANCE_MODE = False
# Amazon keys to permit S3 access
# https://console.aws.amazon.com/iam/home?region=us-east-1#/users/s3user?section=security_credentials
DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
# we should suppress Google Analytics outside of production
SHOW_GOOGLE_ANALYTICS = True
# if settings/local.py exists, import those settings -- allows for dynamic generation of parameters such as DATABASES
try:
from regluit.settings.local import *
except ImportError:
pass

View File

@ -1,13 +0,0 @@
#!/usr/bin/env python
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "regluit.settings.prod")
os.environ['CELERY_LOADER'] = 'django'
{% for key in host_keys %}
os.environ['{{ key|upper }}'] = '{{ host_keys[key] }}'
{% endfor %}
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

View File

@ -1 +0,0 @@
{{ project_path }}/

View File

@ -1,18 +0,0 @@
- hosts: regluit-prod
gather_facts: false
tasks:
# Need to install python2.7 and pip first so Ansible will function
# This is due to Ubuntu 16 shipping with Python3 by default
- name: Install python2.7 and pip
become: true
raw: bash -c "apt -qqy update && apt install -qqy python2.7-dev python-pip"
register: output
changed_when: output.stdout != ""
- name: Gathering Facts
setup:
- include_role:
name: regluit_prod

View File

@ -1,6 +0,0 @@
---
- hosts: regluit-local
gather_facts: false
roles:
- regluit_common
- regluit_dev

View File

@ -1,38 +0,0 @@
This directory is for [ansible](http://www.ansible.com/home) playbooks for sysadmin tasks around unglue.it.
We start with automating tasks such as [applying security upgrades](unattended-upgrade.yml) to the servers.
Goal is to build playbooks for the configuration of servers.
# Current status of playbooks
* [host](hosts) is currently written by hand -- the inventory might be dynamically generated at some point.
# Installing ansible
[installation instructions](http://docs.ansible.com/intro_installation.html).
On the mac, easiest approach is probably to use [homebrew](http://brew.sh/):
brew install ansible
You can also use `pip`:
pip install ansible
Note: ansible depends on one having ssh access to the servers.
# Running unattended-upgrade
in `regluit/sysadmin/playbooks`, run
ansible-playbook -i hosts -e "target=instances" unattended-upgrade.yml
to run on all the servers.
ansible-playbook -i hosts unattended-upgrade.yml
will run only just.

View File

@ -1,5 +0,0 @@
[instances]
just ansible_ssh_port=22 ansible_ssh_host=just.unglue.it ansible_ssh_user=ubuntu
web1 ansible_ssh_port=22 ansible_ssh_host=unglue.it ansible_ssh_user=ubuntu
gluejar ansible_ssh_port=22 ansible_ssh_host=gluejar.com ansible_ssh_user=ubuntu

View File

@ -1,38 +0,0 @@
Role Name
=========
A brief description of the role goes here.
Requirements
------------
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
Role Variables
--------------
A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.
Dependencies
------------
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
Example Playbook
----------------
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
- hosts: servers
roles:
- { role: username.rolename, x: 42 }
License
-------
BSD
Author Information
------------------
An optional section for the role authors to include contact information, or a website (HTML is not allowed).

View File

@ -1,2 +0,0 @@
---
# defaults file for common

View File

@ -1,2 +0,0 @@
---
# handlers file for common

View File

@ -1,128 +0,0 @@
---
galaxy_info:
author: your name
description:
company: your company (optional)
# Some suggested licenses:
# - BSD (default)
# - MIT
# - GPLv2
# - GPLv3
# - Apache
# - CC-BY
license: license (GPLv2, CC-BY, etc)
min_ansible_version: 1.2
#
# Below are all platforms currently available. Just uncomment
# the ones that apply to your role. If you don't see your
# platform on this list, let us know and we'll get it added!
#
#platforms:
#- name: EL
# versions:
# - all
# - 5
# - 6
# - 7
#- name: GenericUNIX
# versions:
# - all
# - any
#- name: Fedora
# versions:
# - all
# - 16
# - 17
# - 18
# - 19
# - 20
#- name: SmartOS
# versions:
# - all
# - any
#- name: opensuse
# versions:
# - all
# - 12.1
# - 12.2
# - 12.3
# - 13.1
# - 13.2
#- name: Amazon
# versions:
# - all
# - 2013.03
# - 2013.09
#- name: GenericBSD
# versions:
# - all
# - any
#- name: FreeBSD
# versions:
# - all
# - 8.0
# - 8.1
# - 8.2
# - 8.3
# - 8.4
# - 9.0
# - 9.1
# - 9.1
# - 9.2
#- name: Ubuntu
# versions:
# - all
# - lucid
# - maverick
# - natty
# - oneiric
# - precise
# - quantal
# - raring
# - saucy
# - trusty
#- name: SLES
# versions:
# - all
# - 10SP3
# - 10SP4
# - 11
# - 11SP1
# - 11SP2
# - 11SP3
#- name: GenericLinux
# versions:
# - all
# - any
#- name: Debian
# versions:
# - all
# - etch
# - lenny
# - squeeze
# - wheezy
#
# Below are all categories currently available. Just as with
# the platforms above, uncomment those that apply to your role.
#
#categories:
#- cloud
#- cloud:ec2
#- cloud:gce
#- cloud:rax
#- clustering
#- database
#- database:nosql
#- database:sql
#- development
#- monitoring
#- networking
#- packaging
#- system
#- web
dependencies: []
# List your role dependencies here, one per line. Only
# dependencies available via galaxy should be listed here.
# Be sure to remove the '[]' above if you add dependencies
# to this list.

View File

@ -1,2 +0,0 @@
---
# tasks file for common

View File

@ -1,2 +0,0 @@
---
# vars file for common

View File

@ -1,19 +0,0 @@
- name: unattended-upgrade
# by default, run only just
hosts: '{{target | default("just")}}'
sudo: yes
tasks:
- name: update apt-get
apt: update_cache=yes
- name: apply upgrade
command: sudo unattended-upgrade
- name: check whether reboot needed
stat: path=/var/run/reboot-required
register: reboot_required
- debug: var=reboot_required.stat.exists

View File

@ -1 +0,0 @@
See [vangrant_ansible.md](../docs/vagrant_ansible.md) for documentation.

382
vagrant/Vagrantfile vendored
View File

@ -1,382 +0,0 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.define "please" do |node|
# Every Vagrant virtual environment requires a box to build off of.
node.vm.box = "ubuntu/trusty64"
# node.vm.network "forwarded_port", guest: 80, host: 8080
node.vm.network "private_network", ip: "192.168.33.10"
node.ssh.forward_agent = true
#node.vm.network "private_network", type: "dhcp"
#node.vm.synced_folder "data", "vagrant_data"
node.vm.synced_folder ".", "/vagrant", disabled: false
node.vm.provision 'ansible' do |ansible|
ansible.playbook = 'dev.yml'
ansible.verbose = "vv"
# ansible.inventory_path = '.vagrant/provisioners/ansible/inventory/'
ansible.raw_arguments = [
"--inventory-file=.vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory",
"--limit=please,127.0.0.1",
"-e vname=please",
"-e class=please",
"-e hostname=please.unglue.it",
"-e setdns=true",
"-e branch=master",
# "--start-at-task=restart_here"
]
end
# 512MB not enough for compiling lxml: https://stackoverflow.com/a/25916353/7782
# https://stackoverflow.com/a/26468913/7782 --> for how to get to this setting
node.vm.provider "virtualbox" do |v|
v.memory = 1024
v.cpus = 2
end
node.vm.provider :aws do |aws, override|
aws.access_key_id = ENV.fetch('AWS_ACCESS_KEY_ID')
aws.secret_access_key = ENV.fetch('AWS_SECRET_ACCESS_KEY')
aws.keypair_name = ENV.fetch('AWS_KEYPAIR_NAME')
# Ubuntu 12.04 LTS Precise / PV EBS-SSD boot
# alestic 2015.05.05
#aws.instance_type="t1.micro"
aws.instance_type="m1.small"
# aws.region = "us-east-1"
# aws.availability_zone = "us-east-1c"
# 2015.05.05
# aws.ami = "ami-d8132bb0"
# 2016.03.01
# aws.ami = "ami-03dcdd69"
# 2017.03.17
# Trusty 14.04
# aws.ami = "ami-9fde7f89"
# put into just security group
# aws.security_groups = ["just"]
# FEF
aws.instance_type="m1.small"
aws.region = "us-east-1"
aws.availability_zone = "us-east-1a"
# 2017.03.17
# Trusty 14.04
# aws.ami = "ami-9fde7f89"
# 2017.11.22
# Xenial 16.04
# hvm:ebs-ssd 20171121.1 ami-aa2ea6d0
aws.ami = "ami-aa2ea6d0"
# put into just security group
# regluit-pub-a
aws.subnet_id = "subnet-a97777e0"
# SSHAccesss, just_ec2
aws.associate_public_ip = true
aws.security_groups = ["sg-93aed0ef", "sg-f6a1df8a"]
aws.tags = {
'Name' => 'please_vagrant'
}
override.vm.box = "dummy"
override.ssh.username = "ubuntu"
override.ssh.private_key_path = ENV['SSH_PRIVATE_KEY_PATH'] || "~/.ssh/id_rsa"
end
end
config.vm.define "just" do |node|
node.vm.box = "ubuntu/trusty64"
node.vm.network "private_network", type: "dhcp"
#node.vm.network "private_network", ip: "192.168.33.10"
node.ssh.forward_agent = true
node.vm.provision 'ansible' do |ansible|
ansible.playbook = 'dev.yml'
ansible.verbose = "vv"
# ansible.inventory_path = '.vagrant/provisioners/ansible/inventory/'
ansible.raw_arguments = [
"--inventory-file=.vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory",
"--limit=just,127.0.0.1",
"-e vname=just",
"-e class=just",
"-e hostname=just.unglue.it",
"-e setdns=false",
"-e branch=master",
"-e do_migrate=false"
]
end
node.vm.provider "virtualbox" do |v|
v.memory = 1024
v.cpus = 2
end
node.vm.provider :aws do |aws, override|
aws.access_key_id = ENV.fetch('AWS_ACCESS_KEY_ID')
aws.secret_access_key = ENV.fetch('AWS_SECRET_ACCESS_KEY')
aws.keypair_name = ENV.fetch('AWS_KEYPAIR_NAME')
# Ubuntu 12.04 LTS Precise / PV EBS-SSD boot
# alestic 2015.05.05
aws.instance_type="m1.small"
aws.region = "us-east-1"
aws.availability_zone = "us-east-1a"
# aws.ami = "ami-d8132bb0"
# 2017.03.17
# Trusty 14.04
# aws.ami = "ami-9fde7f89"
# 2017.11.22
# Xenial 16.04
# hvm:ebs-ssd 20171121.1 ami-aa2ea6d0
aws.ami = "ami-aa2ea6d0"
# aws.security_groups = ["just"]
# regluit-pub-a
aws.subnet_id = "subnet-a97777e0"
# SSHAccesss, just_ec2
aws.associate_public_ip = true
aws.security_groups = ["sg-93aed0ef", "sg-e0b1b59f"]
aws.tags = {
'Name' => 'just_vagrant'
}
override.vm.box = "dummy"
override.ssh.username = "ubuntu"
override.ssh.private_key_path = ENV['SSH_PRIVATE_KEY_PATH'] || "~/.ssh/id_rsa"
end
end
config.vm.define "just2" do |node|
node.vm.box = "ubuntu/trusty64"
node.vm.network "private_network", type: "dhcp"
#node.vm.network "private_network", ip: "192.168.33.10"
node.ssh.forward_agent = true
node.vm.provision 'ansible' do |ansible|
ansible.playbook = 'dev.yml'
ansible.verbose = "vv"
# ansible.inventory_path = '.vagrant/provisioners/ansible/inventory/'
ansible.raw_arguments = [
"--inventory-file=.vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory",
"--limit=just2,127.0.0.1",
"-e vname=just2",
"-e class=just",
"-e hostname=just2.unglue.it",
"-e setdns=false",
"-e branch=master",
"-e do_migrate=false"
]
end
node.vm.provider "virtualbox" do |v|
v.memory = 1024
v.cpus = 2
end
node.vm.provider :aws do |aws, override|
aws.access_key_id = ENV.fetch('AWS_ACCESS_KEY_ID')
aws.secret_access_key = ENV.fetch('AWS_SECRET_ACCESS_KEY')
aws.keypair_name = ENV.fetch('AWS_KEYPAIR_NAME')
# Ubuntu 12.04 LTS Precise / PV EBS-SSD boot
# alestic 2015.05.05
aws.instance_type="m1.small"
aws.region = "us-east-1"
aws.availability_zone = "us-east-1a"
# aws.ami = "ami-d8132bb0"
# 2017.03.17
# Trusty 14.04
# aws.ami = "ami-9fde7f89"
# 2017.11.22
# Xenial 16.04
# hvm:ebs-ssd 20171121.1 ami-aa2ea6d0
aws.ami = "ami-aa2ea6d0"
# aws.security_groups = ["just"]
# regluit-pub-a
aws.subnet_id = "subnet-a97777e0"
# SSHAccesss, just_ec2
aws.associate_public_ip = true
aws.security_groups = ["sg-93aed0ef", "sg-e0b1b59f"]
aws.tags = {
'Name' => 'just2_vagrant'
}
override.vm.box = "dummy"
override.ssh.username = "ubuntu"
override.ssh.private_key_path = ENV['SSH_PRIVATE_KEY_PATH'] || "~/.ssh/id_rsa"
end
end
config.vm.define "prod" do |node|
node.vm.box = "ubuntu/trusty64"
node.vm.network "private_network", type: "dhcp"
#node.vm.network "private_network", ip: "192.168.33.10"
node.ssh.forward_agent = true
node.vm.provision 'ansible' do |ansible|
ansible.playbook = 'dev.yml'
ansible.verbose = "vv"
# ansible.inventory_path = '.vagrant/provisioners/ansible/inventory/'
ansible.raw_arguments = [
"--inventory-file=.vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory",
"--limit=prod,127.0.0.1",
"-e vname=prod",
"-e class=prod",
"-e hostname=unglue.it",
"-e setdns=false",
"-e do_migrate=false",
"-e branch=production"
]
end
node.vm.provider "virtualbox" do |v|
v.memory = 1024
v.cpus = 2
end
node.vm.provider :aws do |aws, override|
aws.access_key_id = ENV.fetch('AWS_ACCESS_KEY_ID')
aws.secret_access_key = ENV.fetch('AWS_SECRET_ACCESS_KEY')
aws.keypair_name = ENV.fetch('AWS_KEYPAIR_NAME')
# Ubuntu 12.04 LTS Precise / PV EBS-SSD boot
# alestic 2015.05.05
aws.instance_type="c1.medium"
aws.region = "us-east-1"
#aws.availability_zone = "us-east-1c"
# 2017.12.15 -- for some reason 1c doesn't hava the capacity
aws.availability_zone = "us-east-1b"
# aws.ami = "ami-d8132bb0"
# 2017.03.17
# Trusty 14.04
# aws.ami = "ami-9fde7f89"
# 2017.11.22
# Xenial 16.04
# hvm:ebs-ssd 20171121.1 ami-aa2ea6d0
aws.ami = "ami-aa2ea6d0"
aws.security_groups = ["web-production"]
aws.tags = {
'Name' => 'prod_vagrant'
}
override.vm.box = "dummy"
override.ssh.username = "ubuntu"
override.ssh.private_key_path = ENV['SSH_PRIVATE_KEY_PATH'] || "~/.ssh/id_rsa"
end
end
config.vm.define "prod2" do |node|
node.vm.box = "ubuntu/trusty64"
node.vm.network "private_network", type: "dhcp"
#node.vm.network "private_network", ip: "192.168.33.10"
node.ssh.forward_agent = true
node.vm.provision 'ansible' do |ansible|
ansible.playbook = 'dev.yml'
ansible.verbose = "vv"
# ansible.inventory_path = '.vagrant/provisioners/ansible/inventory/'
ansible.raw_arguments = [
"--inventory-file=.vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory",
"--limit=prod2,127.0.0.1",
"-e vname=prod2",
"-e class=prod",
"-e hostname=unglue.it",
"-e setdns=false",
"-e do_migrate=false",
"-e branch=production"
]
end
node.vm.provider "virtualbox" do |v|
v.memory = 1024
v.cpus = 2
end
node.vm.provider :aws do |aws, override|
aws.access_key_id = ENV.fetch('AWS_ACCESS_KEY_ID')
aws.secret_access_key = ENV.fetch('AWS_SECRET_ACCESS_KEY')
aws.keypair_name = ENV.fetch('AWS_KEYPAIR_NAME')
# Ubuntu 12.04 LTS Precise / PV EBS-SSD boot
# alestic 2015.05.05
aws.instance_type="c1.medium"
aws.region = "us-east-1"
aws.availability_zone = "us-east-1c"
# aws.ami = "ami-d8132bb0"
# 2017.03.17
# Trusty 14.04
# aws.ami = "ami-9fde7f89"
# 2017.11.22
# Xenial 16.04
# hvm:ebs-ssd 20171121.1 ami-aa2ea6d0
aws.ami = "ami-aa2ea6d0"
aws.security_groups = ["web-production"]
aws.tags = {
'Name' => 'prod2_vagrant'
}
override.vm.box = "dummy"
override.ssh.username = "ubuntu"
override.ssh.private_key_path = ENV['SSH_PRIVATE_KEY_PATH'] || "~/.ssh/id_rsa"
end
end
end

View File

@ -1,2 +0,0 @@
#!/bin/sh
ansible -i .vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory --private-key=~/.vagrant.d/insecure_private_key -u vagrant unglueit -a $1

View File

@ -1,8 +0,0 @@
#!/bin/sh
ansible-playbook -vvvv \
-i .vagrant/provisioners/ansible/inventory/ \
--private-key=/Users/raymondyee/.ssh/id_rsa \
-e aws_access_key=$AWS_ACCESS_KEY \
-e aws_secret_key=$AWS_SECRET_ACCESS_KEY \
-u ubuntu $1

View File

@ -1,2 +0,0 @@
#!/bin/sh
ansible-playbook -vvvv -i .vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory --private-key=.vagrant/machines/unglueit/virtualbox/private_key -u vagrant $1

View File

@ -1,6 +0,0 @@
[defaults]
library = ./library
inventory = .vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory
private-key = ~/.vagrant.d/insecure_private_key
remote_user = vagrant
timeout = 15

View File

@ -1,9 +0,0 @@
- name: test
hosts: localhost
tasks:
# to run: ansible-playbook create_commonpy.yml
# create settings/common.py (locally)
- name: create settings/keys/common.py locally
template: src=templates/common.py.j2 dest=../settings/keys/common.py
delegate_to: localhost

View File

@ -1,545 +0,0 @@
- name: route53 setup
hosts: 127.0.0.1
vars:
aws_access_key: "{{ lookup('env','AWS_ACCESS_KEY_ID') }}"
aws_secret_key: "{{ lookup('env','AWS_SECRET_ACCESS_KEY') }}"
target: '{{vname}}'
dev_ssh_host: "{{ hostvars[target]['ansible_ssh_host'] }}"
tasks:
- name: print dev_ssh_host
debug: msg="dev_ssh_host {{hostname}}"
- name: get DNS record for dev
route53:
command: get
zone: unglue.it
record: "{{hostname}}"
type: A
aws_access_key: "{{aws_access_key}}"
aws_secret_key: "{{aws_secret_key}}"
when: "{{setdns | default('false')}}"
- name: set DNS record for dev
route53:
command: create
zone: unglue.it
record: "{{hostname}}"
type: A
ttl: 60
value: "{{dev_ssh_host}}"
overwrite: yes
aws_access_key: "{{aws_access_key}}"
aws_secret_key: "{{aws_secret_key}}"
when: "{{setdns | default('false')}}"
- name: dev setup
hosts: '{{vname}}'
vars:
user: "{{ ansible_ssh_user }}"
aws_access_key: "{{ lookup('env','AWS_ACCESS_KEY_ID') }}"
aws_secret_key: "{{ lookup('env','AWS_SECRET_ACCESS_KEY') }}"
target: '{{vname}}'
migrate: "{{do_migrate | default('true')}}"
sudo: yes
gather_facts: False
pre_tasks:
- name: Install python for Ansible
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal)
register: output
changed_when: output.stdout != ""
tags: always
- setup: # aka gather_facts
- name: check apt last update
stat: path=/var/cache/apt
register: apt_cache_stat
- name: update apt if needed
apt: update_cache=yes
when: ansible_date_time.epoch|float - apt_cache_stat.stat.mtime > 60*60*12
tasks:
# add repo to get latest version of python 2.7
# - name: add-apt-repository ppa:fkrull/deadsnakes-python2.7
# apt_repository: repo='ppa:fkrull/deadsnakes-python2.7' state=present update_cache=true
# when: class in ['please', 'just', 'prod']
- name: do apt-get update --fix-missing
command: apt-get update --fix-missing
- name: installing dependencies
apt: pkg={{ item }} update_cache=yes state=present
with_items:
- python2.7
- python-pip
- git-core
- apache2
- cronolog
- libapache2-mod-wsgi
- mysql-client
- python-virtualenv
- python-mysqldb
- redis-server
- python-lxml
- python-dev
- libjpeg-dev
- libmysqlclient-dev
- libxml2-dev
- libxslt1-dev
- python-setuptools
- python-dev
- postfix
- mailutils
- libffi-dev
- build-essential
- libssl-dev
tags: install
- name: make {{user}} group
group: name={{user}}
- name: make {{user}} user
user: name={{user}} shell=/bin/bash group={{user}} generate_ssh_key=yes
# create celery user and group
# also put {{user}} into celery group
- name: make celery group
group: name=celery
- name: create celery user
user: >
name=celery
createhome=no
group=celery
generate_ssh_key=no
- name: add {{user}} to celery, www-data groups
user: name={{user}} groups=celery,www-data append=yes
# - name: add www-data to {{user}} group
# user: name=www-data groups={{user}} append=yes
- name: install some python modules to use
#pip: name={{item}} virtualenv=/home/{{user}}/venv
pip: name={{item}}
with_items:
- PyGithub
- name: create /opt/regluit
file: path=/opt/regluit state=directory owner={{user}} group={{user}} mode=0745
- name: git config
command: "{{item}}"
with_items:
- git config --global user.name "Raymond Yee"
- git config --global user.email "rdhyee@gluejar.com"
- name: ssh-keygen
#command: pwd
command: ssh-keygen -b 2048 -t rsa -f /home/{{user}}/.ssh/id_rsa -P ""
sudo: no
args:
creates: /home/{{user}}/.ssh/id_rsa
- name: create deploy key for repo
action: github_deploy_key
sudo: no
args:
github_auth_key: "{{github_auth_key}}"
repo_name: Gluejar/regluit
key_name: "{{hostname}} {{ ansible_date_time.iso8601 }}"
key_path: /home/{{user}}/.ssh/id_rsa.pub
- name: postfix install
raw: DEBIAN_FRONTEND='noninteractive' apt-get install -y -q --force-yes postfix
- name: clone the regluit git repo into /opt/regluit
sudo: no
git: repo=ssh://git@github.com/Gluejar/regluit.git dest=/opt/regluit accept_hostkey=True force=yes version={{branch | default("master")}}
# installing mysql
# https://github.com/bennojoy/mysql --> probably the right way
# how do you make use of other people's playbooks in the right way?
# https://stackoverflow.com/a/7740571/7782
- name: mysql setup
raw: debconf-set-selections <<< 'mysql-server-5.5 mysql-server/root_password password {{mysql_root_pw}}'
args:
executable: /bin/bash
when: class == 'please'
- raw: debconf-set-selections <<< 'mysql-server-5.5 mysql-server/root_password_again password {{mysql_root_pw}}'
args:
executable: /bin/bash
when: class == 'please'
- raw: apt-get -y install mysql-server
when: class == 'please'
- name: Create regluit database
mysql_db: db=regluit state=present encoding=utf8 collation=utf8_bin login_user=root login_password={{mysql_root_pw}}
when: class == 'please'
# GRANT ALL PRIVILEGES ON regluit.* TO 'regluit'@'localhost' WITH GRANT OPTION; (covered?)
- name: Create database user
mysql_user: >
user={{SECRET_KEYS.DATABASE_USER}}
password={{SECRET_KEYS.DATABASE_PASSWORD}}
host={{SECRET_KEYS.DATABASE_HOST}}
priv=*.*:ALL
state=present
login_user=root
login_password={{mysql_root_pw}}
when: class == 'please'
# running stuff within a virtualenv
# https://stackoverflow.com/a/20572360
# https://stackoverflow.com/questions/20575084/best-way-to-always-run-ansible-inside-a-virtualenv-on-remote-machines?rq=1
#sudo("ln -s /opt/regluit/deploy/please.conf /etc/apache2/sites-available/please")
- name: create apache conf for sites-available from template
template: src=templates/apache.conf.j2 dest="/etc/apache2/sites-available/{{class}}.conf" owner={{user}} group={{user}} mode=0664
#run('pip install -r requirements_versioned.pip')
- name: upgrade pip
pip: >
name={{item}}
virtualenv=/opt/regluit/ENV
virtualenv_command=virtualenv
extra_args="--upgrade"
with_items:
- pip
sudo: no
- name: pip requirements
pip: >
requirements=/opt/regluit/requirements_versioned.pip
virtualenv=/opt/regluit/ENV
virtualenv_command=virtualenv
virtualenv_site_packages=yes
sudo: no
#run('echo "/opt/regluit/" > ENV/lib/python2.7/site-packages/regluit.pth')
#run('echo "/opt/" > ENV/lib/python2.7/site-packages/opt.pth')
- name: establish regluit.pth
lineinfile: create=yes dest=/opt/regluit/ENV/lib/python2.7/site-packages/regluit.pth line="/opt/regluit/"
sudo: no
- name: establish opt.pth
lineinfile: create=yes dest=/opt/regluit/ENV/lib/python2.7/site-packages/regluit.pth line="/opt/"
sudo: no
#sudo('mkdir /var/www/static')
#sudo('chown ubuntu:ubuntu /var/www/static')
- name: create /var/www/static
file: path=/var/www/static state=directory owner={{user}} group={{user}} mode=0755
#
#run('django-admin.py syncdb --migrate --noinput --settings regluit.settings.please')
# provide a directory for django log file
- name: make /var/log/regluit
file: path=/var/log/regluit state=directory owner={{user}} group=www-data mode=2775
# create the wsgi script from the appropriate template
- name: create the wsgi script from the appropriate template
template: src=templates/{{class}}.wsgi.j2 dest=/opt/regluit/deploy/{{class}}.wsgi owner={{user}} group={{user}} mode=0664
when: class in ['please', 'just', 'prod']
- name: restart_here
debug: msg="provision restart here"
- name: Create /settings/keys/
file: path=/opt/regluit/settings/keys/ state=directory mode=0755
# create settings/keys/common.py
- name: create settings/keys/common.py
template: src=templates/common.py.j2 dest=/opt/regluit/settings/keys/common.py owner={{user}} group={{user}} mode=0755
# create settings/keys/host.py
- name: create settings/keys/host.py
template: src=templates/host.py.j2 dest=/opt/regluit/settings/keys/host.py owner={{user}} group={{user}} mode=0755
when: class in ['please', 'just', 'prod']
- name: create empty settings/keys/__init__.py
copy:
content: ""
dest: /opt/regluit/settings/keys/__init__.py
force: no
group: "{{user}}"
owner: "{{user}}"
mode: 0755
#Run syncdb on the application
# TO DO: syncdb might be deprecated
# https://stackoverflow.com/a/29683785
- name: django syncdb
django_manage: >
command=syncdb
app_path=/opt/regluit/
settings="regluit.settings.{{class}}"
virtualenv=/opt/regluit/ENV
sudo: no
when: migrate
notify:
- restart apache2
- name: django migrations
django_manage: >
command=migrate
app_path=/opt/regluit/
settings="regluit.settings.{{class}}"
virtualenv=/opt/regluit/ENV
sudo: no
when: migrate
notify:
- restart apache2
#run('django-admin.py collectstatic --noinput --settings regluit.settings.please')
- name: django collectstatic
django_manage: >
command=collectstatic
app_path=/opt/regluit/
settings="regluit.settings.{{class}}"
virtualenv=/opt/regluit/ENV
sudo: no
notify:
- restart apache2
- name: copy STAR_unglue_it.crt
copy: >
src=files/ssl_cert/STAR_unglue_it.crt
dest=/etc/ssl/certs/server.crt
owner={{user}}
group={{user}}
mode=0644
notify:
- restart apache2
- name: copy server.key
copy: >
src=files/ssl_cert/server.key
dest=/etc/ssl/private/server.key
owner={{user}}
group={{user}}
mode=0600
notify:
- restart apache2
- name: copy STAR_unglue_it.ca-bundle
copy: >
src=files/ssl_cert/STAR_unglue_it.ca-bundle
dest=/etc/ssl/certs/STAR_unglue_it.ca-bundle
owner={{user}}
group={{user}}
mode=0600
notify:
- restart apache2
- name: remove /etc/logrotate.d/apache2
file: path=/etc/logrotate.d/apache2 state=absent
notify:
- restart apache2
- name: a2dissite 000-default
command: a2dissite 000-default
notify:
- restart apache2
- name: a2ensite dev
command: a2ensite "{{class}}"
notify:
- restart apache2
- name: a2enmod ssl rewrite headers
command: a2enmod ssl rewrite headers
notify:
- restart apache2
# - name: show django_secret_key
# debug: msg="{{django_secret_key}}"
# out-dated: no more injecting secret key into local.py
#- name: insert SECRET_KEY into /opt/regluit/settings/local.py
# lineinfile: create=yes dest=/opt/regluit/settings/local.py line="SECRET_KEY=u'{{django_secret_key}}'"
# notify:
# - restart apache2
# sudo: no
#
#sudo ("/etc/init.d/apache2 restart")
#
- name: turn on ports 22, 80, 443
ufw: rule=allow port={{ item }} proto=tcp
with_items:
- 22
- 80
- 443
- name: enable ufw
ufw: state=enabled
# create directories for celery
# /var/log/celery and /var/run/celery
- name: create /var/log/celery
file: path=/var/log/celery state=directory owner=celery group=celery mode=0775
- name: create /var/run/celery
file: path=/var/run/celery state=directory owner=celery group=celery mode=0775
# set up celeryd
- name: set up /etc/init.d/celeryd (from deploy/celeryd)
command: cp /opt/regluit/deploy/celeryd /etc/init.d/celeryd
# still need?
- name: set mode on /etc/init.d/celeryd
file: path=/etc/init.d/celeryd mode=0755
- name: copy deploy/celeryd.conf
command: cp "/opt/regluit/deploy/celeryd_{{class}}.conf" /etc/default/celeryd
- name: set mode on /etc/default/celeryd
file: path=/etc/default/celeryd mode=0644
# - name: just before launching celeryd
# pause: prompt='Press return to continue. Press Ctrl+c and then "a" to abort'
# start up celeryd
# sudo ("/etc/init.d/celeryd start")
# old way with root
# - name: start celeryd
# command: /etc/init.d/celeryd start
# - name: start celery queue with celery multi
# command: /opt/regluit/ENV/bin/django-admin.py celeryd_multi restart w1
# sudo: no
- name: celeryd_multi
django_manage: >
command="celeryd_multi restart w1"
app_path=/opt/regluit/
settings="regluit.settings.{{class}}"
virtualenv=/opt/regluit/ENV
sudo: no
# - name: just after attempt to launch celeryd
# pause: prompt='Press return to continue. Press Ctrl+c and then "a" to abort'
# sudo ("cp deploy/celerybeat /etc/init.d/celerybeat")
# sudo ("chmod 755 /etc/init.d/celerybeat")
# https://stackoverflow.com/questions/24162996/how-to-move-rename-a-file-using-an-ansible-task-on-a-remote-system
# set up celerybeat
- name: copy deploy/celerybeat
command: cp /opt/regluit/deploy/celerybeat /etc/init.d/celerybeat
- name: set mode on /etc/init.d/celerybeat
file: path=/etc/init.d/celerybeat mode=0775
- name: copy deploy/celerybeat,conf to /etc/default/celerybeat
command: cp "/opt/regluit/deploy/celerybeat_{{class}}.conf" /etc/default/celerybeat
- name: set mode on /etc/default/celerybeat
file: path=/etc/default/celerybeat mode=0775
- name: create /var/log/celerybeat
file: path=/var/log/celerybeat state=directory owner=celery group=celery mode=0775
# - name: just before launching celerybeat
# pause: prompt='Press return to continue. Press Ctrl+c and then "a" to abort'
- name: start celerybeat
command: /etc/init.d/celerybeat start
sudo: no
# - name: just after attempt to launch celerybloeat
# pause: prompt='Press return to continue. Press Ctrl+c and then "a" to abort'
# run data loading script
- name: run data loading script
script: "load_data_{{class}}.sh"
when: class in ['please']
# set up crontab
- name: crontab
command: crontab "/opt/regluit/deploy/crontab_{{class}}.txt"
sudo: no
- name: add ssh keys from /opt/regluit/deploy/public_keys/
authorized_key: user="{{user}}" key={{ lookup('file', item) }} state=present
with_fileglob:
- "../deploy/public_keys/*.pub"
sudo: no
- name: add ssh keys from public_key directory
authorized_key: user="{{user}}" key="{{item}}" state=present
with_items:
- https://github.com/rdhyee.keys
- https://github.com/eshellman.keys
sudo: no
- name: set up script file to load environment for interactive use
command: cp "/opt/regluit/deploy/setup-{{class}}.sh" /home/{{user}}/setup.sh
sudo: no
- name: set up script to dump database
command: cp "/opt/regluit/deploy/dump_db_{{class}}.sh" "/home/{{user}}/dump.sh"
when: class in ['prod']
sudo: no
- name: chmod +x dump.sh
file: path="/home/{{user}}/dump.sh" state=file owner="{{user}}" group="{{user}}" mode=0745
when: class in ['prod']
- name: put an empty file in main dir to help identify this instance
command: touch "/home/{{user}}/{{class}}_{{ ansible_date_time.iso8601 }}"
sudo: no
- name: apply upgrade
command: sudo unattended-upgrade
- name: check whether reboot needed
stat: path=/var/run/reboot-required
register: reboot_required
- name: restart machine
shell: sleep 2 && shutdown -r now "Ansible updates triggered"
async: 1
poll: 0
sudo: true
ignore_errors: true
when: reboot_required
- name: waiting for server to come back
local_action: wait_for host="{{ inventory_hostname }}" state=started delay=30 timeout=300
sudo: false
when: reboot_required
handlers:
- name: restart apache2
service: name=apache2 state=restarted

View File

@ -1,210 +0,0 @@
$ANSIBLE_VAULT;1.1;AES256
30636262636630653738383536613136363733643931316362326266656433376333386239373962
6635343138326335313430623566656130663136393531310a343562653666623235336539316561
31386163663632383436343735376266356134386335363637383536613531323231626535313236
6163326630306530360a663636393463303062316331623630353235383137333831333239393134
64353830366463376130633831633835313034643930636166396436373063623039316465613964
61333538656264353735613034356533353331313735393965363164616331306538383231303932
31373838363862343931643034643863313738636238376634363430613365356136323237613530
34323339323337383539363462303863663163373465373262636161346662333738663532316363
65313464333363643461353539306662353364643663373032346531633362373230653061646436
34393462326137336163316361363937323738663632386662643338626433626433633235323838
65653036643961626131383264393138316263366534656663386264376638393639636164323661
61646166376637396131356339313162343762636234643236316363643063326638366536656534
31616164313164373336666634356639653831623966333739356462656137363161663635353136
30653665353334646165663333643863643539373331613263386561353030363862666264353933
64643439336236386631393934623839626163373463653134656539376262316233626130363663
65636534303431616631633534643030346534633635393563366266356138383938636264383632
33616365333863393733646565643236613064616462633661303630613963666236663265636361
61376336346262346632313833633735356364636239366439393265613866316439643732326330
38396332363666656636646164646262303162656331636661393738626263383563646261323036
63363634616362323965616639373961333966303366363937333233356631393938383339613262
39393461316563383131666539333938313437336462376233353464303739356463323265366665
64316161333431353264336236373466613230363237316633386661303538666536366462323666
32373164626330313665653133356563383436663765666437636138343163663533646331346631
31643638373537653533353036653766663935663636663561343239383666333661343830353133
34363363333466393761643863393436386231626134663236326335336438633338313963646363
30623262386437313733353038353231353163326133643139633963303864633739383935363664
61336265656666643037316139306534323135333763383230633261336139636362396539643539
34303937656634653862383665356530643064383832363163343331383538623236366535393061
38373738393064376539343837356335326132363135323935333964383635383965656462383636
63663661626632396663383838353633663839303936646537363266346661373033663064326435
62646130376163623363346232346530376638613934623831303636366365313331613436626337
61346262333933363366653166326330663638643230373364653161333263323035366263623330
66636532616234636263323366626432363337326564663531323663356166303930653661313030
32363133313162313331623138356432653630663263623935303739663363323130646133613735
66333933393266663265333036616465353338656664313230643761303439363035663566393930
31303633396665316330623962643439313132633531656362333630653537393061316663356566
39376230643830333035316439346336313464623238373739623636313236316162356337313339
62376533663138613962306331313066383439373039636631633431316232643266326361666134
64383437636561323964346134663032663466333831663836393039353562663065643337303330
62356666353662386439353563643735633730613463666263666539323333613130633765393834
32343439306636306131386537373164363636386330623534373535323631396464626661323361
38353935623566373834643661616631373333303735393835643737626234643337653130396365
65666332323665356330396238633866653761346531303439666236653264323661626135353238
36643562623266636333623831303439336366646133653332313130336436386537653234666435
31343863376233623335366333363232653966316230363836613231613130613166643864373565
35356264383335623539643630323534623265313631383130643739306533663330396434653236
64376166373639363731663437663331346338373539363637353933386239373738373565353030
64353261366232643061356165323961383537626239623732393936623461393961353837633733
34356166393938346232396532353166373534623530646335633338633636336636646630356561
32363061356632313661386535306339636135623834333231303433343037353633613365326333
37666235323239383661323536353830383833326565346564663631336465313664346533323337
38613961313233623033386166336235383362393463393832646538373139333533313266303937
62346532356632316136633533373665373839623336383435353163386531366466646664326565
30303639393933373361623333326432366332396137396238336464376131323631343637306531
37343933373139333333623233386334636436356432303764653235353133366566383031633136
34616133336663623664616432336265323534373163316338386561623864623861343835633062
34343738616134366164356337663566326462303933386139643734376332313066613230326363
66623837323238356366333836386662366435626236333835346662623631373636663033623733
38316639343638313937353636616638396261333561313032383130393538663366636630376539
63353566613835343964356635303939343764396631393738646432313765666564316363626431
65346637656137363266346266616666316361383231343666643063353131386163356638346636
30383932633264373031373935616230323933373863663564363233313232363066326662303165
63346532313837396365353365636663313334626433303732326164363330303438636333636163
35656537623165323666633435386465303063633534656630306664343637336164626433373361
65376530333361303337623634353434373164626133626263613561613436303161626432626239
37343536313531626233343530633634613166633735613233393962323165623166366161356336
35386635366631326266343432386161663033323962313763343163663137643631393166333031
39346564656665343835616464663231333562616661643234326663633563303964386131656363
63666363356562383830646633396238623537336439326162376135633665653165326536353037
37313362666531333837633439643165356534383265643637363933366463343839333961376235
63333063643634623735363233646334633235373132646139313365303336646264633061643131
32616465633131356130396465643235353530326564373136313133613064313562306333313965
38396237653430353533353462373130303262663564653361313465353934353864656235653135
34613639613633633234386639633230653537393965323363623338656465326531346432333637
64343436373436356535333865643865373539393036626137626538626635653637666362356162
30313632396539623962346562646563316264613232343730643565386135346664646363333330
66656661636235633730393063343634636138383264336535326533356231626530613565336161
35626232343436616535373230653039303065343432343738616363626635383364373266323333
33376364666638313564366237356635653731623566626661373961663736666638343061646134
35313438356531383433636565326365313063383834613837666330396331353738323237363333
63363963666465313137386537356462663636323737306362326362363266343062626130616230
64363433343738343632636633373330386464396364383031343531663432363563653032336332
65366364333133386139636165303964366165326336316534323636633462356335633066643165
34613030323234383965396233373333393336653237613062323530353762633931343333323865
30663862373132633834353039653032373737313564333638333762303335636265646162313931
66393662653933363832623061633634626661356437663331373937396631356131333462656666
32303166396533643261646130306161326561326533626531663038643565376439633339333432
64333437366566666366303230616539663564333463666631646163356235636333363633663639
37666332346161376239656137306430623463653466626663636539666532373565373731613165
62663532383165656432313762376235333331343738646532373265353066363262333261626137
31396332383963353066336666366133336138653363613863653833653964663164313831333065
35333738383232656634356564643634346633313137333863363766643433363631333630643731
65363161303235323830376638303135613630663362653566363965313436323033643366306630
39303935636639333961666135633962653362666536663333623430356164376262346662643635
33323663333832316633373035386334623134326536366236636561373635353366386237323933
62393435363235396262653065656562383063663236323134313833363833396131643533666235
37386366343933376338336533316239383430343566626434303537653431626261363438336334
35363961656332336230386535386531363761303766313563333832633033646461393635376339
39633630336366373663666239623030326331346361323132363565366366616236346230636632
38376534363933383965386338313835356135663035326536343532643930383466633538316538
31353038656533336335376265626139333364633537633662653362393666346163386431326261
35393261353230373034633666663638306134643066643533323761666264326162343630376661
65613733343866306364333665353639646263323863663562333965636335613966323564373535
39363939383031393265613035376635663962386530663639356331393830383130626439346666
31393532316431393666616535363430636637366134366636643730636431343034336539616135
38633063333063383766386265336363386362383136653536616663376463333935356162343930
36383831666537313936393033363738666335653739646431363039373939626538343037633631
39383439373336336561663431626265666434646565356438336530643863656464323034353565
36366563323836336162373465313938646239373637613066333238323533346338353834636631
30333262376638336537623466643736653562336336663436333963366464666131303862313335
61353862656435653939343362393934303633303333366231646431656234656638613033383133
31353262353231663633633063663537353536383138366132646364353661363135336333323133
64613231626662666364313232333633386265353935363065333933666165633862393965326637
63623962616164626237303466623565623032666431383633323233633861326132346263386631
64386364653633363965356664636434393031383663393137343733343732363239633436663636
64346237653966363538303632363461663030396237623661356438653562396232313935626164
64326162363264323831663965383639393937613931663239316663323164306537326363376339
33333063373464363065336132613230643831303937373163386263646562313361306133306639
36636264373638326663613236353439383532323032393431373333626330313235623362643137
30636462643536363638613936383931363663343964363038373834343164633062343265666137
30373734396232343936326330623362316636616535643136313765356439323934386364643631
34316630366332366432373739363637623437363132646330326361363366313633343634383132
34626633343163613136343665373931363065306232313336356461373366623934306563383935
35373930633334343864306165653034386133393636386662303737303136613432333531313461
62323065343037386231656335326364363761396532346661343664636637633334383131613833
34306465643133383239306534383035303363353766613631643464383264656536323866326464
38666665613166653638633039666261326135363833393832373564333765353134636138343266
64373536313666353332613535633061363835363839323430333430643863343461643236333937
62346262396331613536343539653766323561343639643766653535353335383736333464613331
61336337613737356236636333393236653263663065353431633537666161373638663861363863
36393364616566343561393364313531356134626431646261346363343939616332313631636331
31393435373265313836653533323237613336333061306330636665626233613537383932316235
35646633653664313834376466306335653465613866393939323265316436333062646662656462
36313861306533326163306266353538396436386365393464613335646432366461326331623664
35616665666337663163663631393539663731376333393339373065643363326535643563383532
63656466623939376632636433316661613730386363363930613830386638653837323938373030
34653565386564333866336337316164663931396630333634336130383465643061633239656638
66666166303835326365353433636130653038643938653365333431646561306536623037666231
30333830376637653932613961353931363537336462643030376537386539623636303038363862
34373036393931303465626563623664663532666166336334653234346561303538313036343565
61363734333737393131643661326331383036333363653333373536373134306436646139636561
61386462323832653061313034616532643265343636313366346537356164346461313436373637
34316663356135636231613330323431316566323361363636633436653864633564366366383339
61633266343336643430623138326436383361636161326264346365643536343838333138646563
65383230373361663461383236313832366334303632313935313263646266393030313238613334
66626631323033383334636561313666653165356135366435613438323662353135633234346662
33333336646166643862396361383636306431353439333562633533303265303266613662306162
34383062333166393739656365303738373361373436343064323636336634353232383232356334
35633561383735316663383333303334633631346339323562353634396533343636653963653462
61393039303366626563393737306336376437666138393562373933333335633435396632333232
39666435383832663462626563646162666565393530393164373963386161666436343263316639
30343064663133616135613164653937366636353062303139366261313165373362643365316663
33653630633732623466343236646136663730663938333234613163663835393036363161386332
62383833396164313132633535323530633937626437383462663866346163623234663564306533
65326362636433333930623663653031313438363930373462663639366434633665656138303866
35626333336532346663366530303061343835376239643466326361613030613730326130633165
39333465393466336231333335616662386238346537633164666636333133306266613064343165
39653963346133333234353266323065656237303233623264376233616334623665323433623632
63316262306337386535653233336635616438356565343433393662653036663736663663666435
33333433343566623331333961613662306236386439386135653138333638366566313534383934
62626261303530306237653637363933393634663330336462393932353230313730336362376134
35343530363431323366613361643636663961366238636537616237633965666639633265376437
63363930353064346664323435313136316132373237356332383537623032633831353563326230
65626166336166363164613130393165356139353439353436666537346362326635386136313464
34383633336636376137643733313637373535643966376435353339363535653139313739313362
65343434343364666639306663663665356533323635316534316561313263663662623764326138
38386434316535653262616530643164663335323436386365313361656430616535346463643765
64613231623333363835386337643334333039363835343731316165346438363234666134343263
63663036663566373734656661613432623761393964313166393532396664326230363230303161
36373364663137373234383134363966633935666365303430343539663461623561383236626137
66623964333766323534316439643666323666336539393566316331363862666561656634326166
64383236633638663163666236633531346330643066353566336337646265623361326261373862
32626538316631303465396436643236376161613232666339373537383438633630316365363065
31653433326333613431303936333137323632383163323561313636396331376664656365326536
39323632623861333466333530643864616166623261346237356431326335343431373164633366
34363932656234613431306135323434353164323461346262656337336137616430386533313933
65306566373634363933616233316562643930666161643234323864336631343032326462623365
65363036633061643463343637313933396436636333663861393333353732383736633534303864
62376339343938383639626237373961623931616264353264353337333133396564623831643338
39653962623766643239393061643938643066386564613932656565306564303066316165336230
62363330653137616666343333323636663462643264656364396138626265623964663730636561
31356339323934366637623165623039323439333434653336623962643734653436376462386232
64393863353164373734313262383638393961623466653034626666353361393230623933373336
35323661333330393835363064396564613766626665623866346334643463663865323264386661
33663561616131616134333564343334343765373061393131376231653536353163643435613564
32376466363230363930393734663433313133646238396366356361663636343362313237303766
63613538383836646333366664313637333537303333373537646130393631656636623461383533
31333661376236323736666136393062643566313131383165663965656637303634366330666539
61336265356662336236626432643738343038396263393665396337633837303761613332623436
33313235323938333333666437613731376562376233353664313362356433383938376436373863
32633131386462333838323536333439323733393266376632386530366363633337323963353437
37653334626434616433643930363765366439613236373731343339613237633962356531303433
38333261613062323963366131633738613463363364653531663639626234383263633963336635
65343330636330353363356134363138333031393838623635343335393462343036316638623861
30323638373032653331616361383338333761386264623435656561623337303863323536633932
61613964363538313435363231613834323333336364353962346265646233613935313632343738
65303732376561643763336162333962353136663136613466666631323063646432323130616266
65663431626562646537366661393638346538336538666466343261396431383232356238353062
37653031653766333931393763346366356563393261363438363535303163303962306630306665
62346633356463653465363965396164323437346132396138316562316237303033396233636336
30623039326132393534633937623363656666663366643130633161646566386135303939383762
33356334636565643761323638346162373636323433306436303331336432333830623739643237
64646432366466326139306663356438613433366534616462383938646239643262373836363032
61623735666238626435316530363833366135633563663530643631623539333832343561323138
32383138303464393265373665333736303861646464373861613730653861353463323837383737
30356437653833376631303636393739636663663936656663393130616637303332393636363431
38663837393231326536643033376663316138363234306637613135396365616636656236646335
33633962626135343564633337663936393031316133646334303635653130626131646531396134
38343631613562393435326139366330373064393839636138323466646533303538

View File

@ -1,100 +0,0 @@
$ANSIBLE_VAULT;1.1;AES256
66366138323934613133623237633539616236326462373461303832393739313466373236323765
3461353265343631356335643139363335356262346238360a383136303237393662303762393766
61346362386338663037396631633932373834303265383662356539323766393466656564633465
3835623862356266390a646463633764653431353537643265363764653934656430646363373335
32343135303266623365656532633061373564623664616564343638636138623433363964303366
63323939396365363539366562626135626662336236313963613233633637313731313465363636
39386237393034383263346164623036646535623463306330663034383632373836333661666435
61656662353762653266363036373430343333653835646365613835303935396230363032636164
64613730663339316261313664633636613763313631653839313465336562633663306563633561
38613661333766366633333463376162306365323330356339613266326331353866316638363237
33646165313865313431666163613234366133616263396630303362333336323638373131396334
39656534616331643530646530316335633730323166373830353262366465306631636339316266
32303162313438373531616439356563303030383136613531353561316234353632646232396433
38643463333836326435303733373239626562363264653532323334356262346133633361373963
64396564313630393164323231313937643435613234376436386563623435633666616331643530
39366536616165303562663638313739353763656134316132616162303161623130616263306366
65613264623935333134383733353637653336636532383165646338303633353330623231383239
39343834643038656539623162353561646364393162323839643533333363616437393239313034
61356134643031356536653262663833336361653632626364336565616163376238326334663661
35623338393730636237616161383032353762383965633962343330353235643363346633313462
36653365346263323062653239373132323734626363623337393635373738663931656363383136
62613836356562363866623436393131323130306636356235343035333534326331343337383431
38613565383365666632326238363165313631373262336234666434313065363363346636653339
36363432306639303266366665643934346562663934666665343030396233666534633438396332
31323662363130616338333233373961316639633436313737353530646135373533613433353034
62346432623261346334623738663835666639616564373961643439336432316365666665393135
38623936616361313634333339353133633165663936616332323938396533393235636435376439
62633537633136386366313934373263383730633334343636373035316638343334356530613530
63396438343139383439666539383531386437313865303864316437363563663065643266353138
66323133646463653066323466653662653736306162636565326663386362366332303761653564
31383133396131663563343339623563363239363763643530383833353263646264363565656535
64343737663261653530623836356430666462633964353832663964396462363430623336646336
65356566653938376132663230333033376261376538306266643565613561373636383532616139
30396564613564333964303262656162313839663435666539393734376639653562643735393037
34613864353764303661653561383466663730333932663139616164333239633961326632346230
30316138626562346434643033303333333234396533626633333437316636323062643035623664
38626434366261326663393839343765363133623339373738313563653736373565336164356435
37623837343437623833623137373662653934363133633366636436663831653737376631376431
34363461323535323337343632653430333961343165633864346132343938313361373864363565
32663734626631323930613638323133396135313562643536343038366233373136653330626239
65313933636136303365353466646533353236343934356330356161343433643139383764393134
32356331653831633832376262356238336634353362373837646563653835613634356463653466
30383361356631616538333565646435656361313839346165376231643633643634313863663137
61333236313436383464663439366637643663356535613861343831663737623364303339643733
36373461323130333639613235373961313736303436666361613134323265386165616237393164
34366530363034376437393866333861646636396434636631343033633565396164663833623331
32666161636163333266393361383838653333326437303235326565306663356366613430303237
65343937653439353334343834303234643136656565366461393838653739336233613234616437
62643065356462306565363964663332663564313734336239633833306135613662633535666662
36616639323332353864383733393561666464313466393535373961613831313463306461663266
37653230663732393061616365656638623830346536373932636461663532343532366566343436
63376365643061623839393139333661643439376363396564363237346461393264663131616162
32396464363231613231363561373334646362636536343732396364653132663664366434313538
39396262333232383934396335653461346338316564303563626363646136633266393937343434
34396234363362336232653136666639613466663833303062356264633461643932613162303031
33663539366332643538353632336433393564366565323034393531626236353432623531383033
64613435623761623562363563323364396166353265363039663932626431666339376632353539
63656330626438653366396635353236663762666439613237623638663731306331313564333239
37363663366134303037376433323735366266613831356635663932626162343639306366386439
61643831336139303133336366366165303934646362303665643135386462353565303932383930
33393334353235306534366339613066633434393038636331366265336163306334323638393264
64313538316632373430656532623532313063613337626165353365303832373566316131666336
62353062343565633836306235343134323433303633346130363362633263343564616535396263
65666666646231336636616364646565303538343361653932356135393161316335343333653439
61373266633033653931623631643430613137393633393063353833306463663630333434616462
33653230613639616531666335336131373636323065616239313733323664623138313964303930
35366665626362303161396562306639613435396331366363616138613735383030366362396337
66356666643131393433343237346533383335376462383566643035616438396366633737393133
66323630656539363237646663363764363536373266383036636166333834366663613863663533
62393235666666653433613665376431306439616138633533656362323436613231303264303764
30336665336661393866343935313465626264303139353632356137663439373232326339393136
64306365353639626565653965666133346364613538333135653831663032613135653263353965
63373532323062653630646363323063383065646562313539373637623463313333313535323866
32363631613035653637663935313535626333333433623735663439383239373231613037303736
39633436383361356633373037333362363861346263313038373131653938663930666538306432
34386163316163623064376132653062333535396631393363393265303964356431663439636234
64636138333031656364656565346163663533353333353666373466373734633263626439316230
65313031396564613163333364376637303539343563613133613133376239623066303139393866
32623135396134396439653061386561666433613536336566613530656530333433343537623866
31333364636631336264636531343365633264633433643661353164653831343836323763343033
37386131306563626437343034333330623932303639646631613239303331646364323465616562
62353030633765393237653161636165363465336136333264373832616537356531313066643263
38346331383061373133353132646562313630643335376565396662653830656538356165356137
31396232326666613236313961636334383962373533613566333930313866373334613064376561
65313565303630326531613131316463386636623830346131656532363632613032303466623334
33353633663730306638623566326533363065663363373537353130393938313936383763663966
34336535663565633162313732376237336463343833303939353965653665356563326534643033
34343638666463363462363235343731346461336235306264643866366235663961363461373930
63326334323363656263616531373861633936636339623835323936373661373364336233316631
66366462643663316162383438376162663065633333353138363836353331343162396636623130
62383461626534386664633166323764303631373731366133633930643232303934666535393237
35373462313561353561643866623761313839316662373134363431373562373062313430613462
37333635313037656433656363313864653037313732656232323639383838326263323564643263
38373337353635353836366136326334343661393064316139373431313330653966323763306337
62333066323961623535336232303234636138306630313732373364613363663434633734346231
64663930633162313937343130343961356437353366306338663636366631326366663938363531
63353863306137653237656330656237356563346337343262363664313339323863616438373537
63643235306137363264383238316434313331336337356364366261313835656562643566666130
633536646634326262663866316566376638

View File

@ -1,89 +0,0 @@
$ANSIBLE_VAULT;1.1;AES256
32373237336239343336393066383464393861636235623430343533636365306430323738643234
3538336532623734333038333832393735343363363566340a643638636634653735656635336338
39396461646661353061373636313032333065373562373036336232346133313334333862353034
6337653431323235650a663536386561366531623363303963353539326339393034313961393362
30306235623461326365646365373835333235303965336635363361366336303236333237383539
61383438316464336338633163366532323435616563343463623266346632393930353332626137
34396538653134373433333461373337333639393530383738373764353731363264373835626364
35393163333462343562303136313264653764333038343838656562653133353934336666643534
63366264393462643065323865303033636133663164366334313564333262633736626263363338
39376164343330666332333534313634633137653432343232656464363066356336623166303030
34653432366563663432343164636665373139346435396135303736653030653930393963663538
36333636623832633630386235623365363065343936363031613165383534353837353231373164
37373038363361633330653633396562323738663739316634666137306161313233633561383064
30323236643635663766393862343363653866303431346535626565356162353433623132363031
62656332383835386136656534636135346234326561623037396239303034353961396134396334
35303463366439363336363666623064623564323032646337366332666536373064353962373461
63306166616535356231396566316433633062376164303434323639376339643731393461393536
65633363616235343532386435323736313138666661666434643935623266323133336463326532
33326364346364626165666262396133343736656335353732666362613234343163343465326361
33383136636364383466363666316131383366623665323561636130343337613539383134646535
31383131623237636433313133336162633537653533383435336461616439343035336164333363
31623638333465306538313637636436626132656534313064383663393230653132333938343537
65343339333037613332316534336133373864666130303166393038373531396266303832383632
65343531616661303363303966303230353630356437336164383038366563363166363763396464
37386330653563613063323438363737313565363130353264613236346565323837326631363935
31346365653938653566646437623333326533646235343966383031656132396539616661393461
65333235306432666539623964393132616436653430383236353033333366336363323539333636
64616563376464646534343838616437306232393262313065353936356235373231613561323866
61383536636361363039656138306131383732326464613931363837376234326433376533643861
32616434383536373532383238663263643862373738333338343332303735663863346331663037
35643637356531323639623533313865656132353139323436363661643263323633363161653235
37636635623865303536353264313263373938366165623364643337313831653161623231343764
33386162623531396234623937633465653930636637623837653138373365346132323731346130
64613338386662653833653034313066636566333839306539666161333333616261653537313363
64656632333462633232396236373666366464623464653434383832333365376532626531313735
30313335353664643566313437393834393262333665666366326463663761626135326434363931
36306439376138313838613532343663383938366333316432303930326239646232623633373564
62316632383131626432333461323330366165366331303735333330363335366265316330663563
64393231393136626162386335626433336337373765623933346237643532366662616434366163
37373832303664303836373434343032313731323362353031346438643335323131366538653334
33643432646339383865386238666134383861616437663238366365663737623663323137613865
63633965323933366332363131313834653564636336303966656663366361353731316336633233
32623339343838373639343534326365346135393137303736346634303863333664376332636634
30303938353536636365353338393932353435383635326435666133353430323464333531356563
31353733323331656538373932643332316332386437373938373635633832383662316537346132
35316339343538343462363237666332376461363262623438623738623732383337373738346235
64333335396336333337643235616436373736623339366236313938653433343661366332646265
34636530666636363764366533643739653561626134393936616632616264663230616164376132
30656336633230323535653766636361626562306262326265626166343036643034303730306164
63356131333739333338353835363430363864333063363238303861323033643534366264623433
30653639633862376232393065626636396137343635343030316630313863323365363764616630
38346336663932626430613437656437313462633039393934653532386535323836366465383761
39323732666339386565653836323461623238316564323333363461396161643338633137646335
66373461633233333337663332323064373662636535376433613232653137353834373630663366
61343066303366666362353837343337386631653461646230656533663965626135383131346635
31623131653264353861353630646662303835643738323565383233336334356264353939373933
31303964346563636437633532383762383234303130366331313864386330653130653437356466
38373135333066336139336332643666373932666565303062636465326236623963323337633634
66646633366532646232326435663065393035386438343030323038663033356639356264663532
61396130643135666266366664323234353065303031343531366532633532363534646536646235
62383531393832643137633332353364333230383361663264623564366539323132623639623939
61323263373866343933653734323661383634636139383833323837303236326364666466386336
34316465346261366131316535303563623238346530643264326539653432633237656133613532
30663738313139333461346163626130343535306538623763343134623832346132656666393761
35316164646635613032326565353163656134616366386364306436303134386339346462653262
61383961656334653564623262366265316364366538353362313233343239396265383235303534
33666366323466303534333165653334343437316435613566326338666336326664616133313062
66333339346335626663323335373939303163623331303133643937653362666430323930623462
30393239633763666463643066393161353235386461633066306235376261346139363330663235
31643539616335396331656364383265346333323661333066353732653336616330303931376164
37643931313337646337333236323939613333303834356662373836633631393736616462363338
31623064303936306330343361313763336239316362633732326564653566313265616566336135
61616538653365313666613366313064623232653563383465386535636530643831633735323433
30353239333166343366643738363834613230316463636339666434633961386335623238353030
34356536376164613338376534353438383039383930316439653732643339653531316530393534
35326165666439396537396464656339333366333535366530353064396436663966333465616630
33666233313537363165333738393362656631386564376365616266393137633931643833343232
62393663663836303563386235383363623966316635366133353165346635373063383666373833
35633264666139616463333339653733376431363761653433653138356364383865633937363433
33313361653536633066656164616331343033373339336334666635353630636532323632323261
39303937626633613434653835376538356164396631326163346465663337386230656139396237
36613762346462626135323233393537616539646234663866353433396530383966613333376137
37373461333561313966303239633834663837656230613830303433353639643431323930633238
63383161313938663737396539663163303161633732393130363737303732313166623534303339
65323162386430393639303435653436656239303032663761626462633565626161656632626162
62386631316434383239303631343536363034626663626430633635353933313533316337613532
33383335326637626535336664626663376332316236633735663339373131373630643665356133
31393664663737326638

View File

@ -1,58 +0,0 @@
$ANSIBLE_VAULT;1.1;AES256
65656166313438643163366632316530386139623538636439633638636566383566646239306131
3938333565313734613639376539323233353932373635640a313831613637383734636539666463
64306331656564626233383831633862623861346364366632313733623263306464636264363965
3933326435396164390a646439366537323232633232373339343538616431343137373338326166
65373365613465616631623463313364396332366539386462333737623737343330393662646533
62353663306531663935623765353838333138346630313333373066303835323461383630306662
34316363316661613865616163393133626139663162393336356665373465353766656661633731
37373563396437366661373134623664393430616532353530303861336238666539306562343662
32613431393331306234643362323961343261376238353635366132623638663463343730343730
37323733313739636238376538323264333238643532306439366463626233613237313933383333
31373064343036616239616562373264653163396265613935656638613662663364633866393638
62303563363763356433376634626234663234323636366232616431646534383730346233333963
31616263353462653932343537343863326337643037326265666433623965646264303066316139
31653864383331626231313736623563316330393563376562303933313237383939396438623231
65383666336565393236326433646561346635356661356136306165323432383531646264323064
31353738663861306135636131333261333964663338636637306665333663313164393537396663
36666663616634323137333835626133383737666632316336313661656434376239616437346636
62643035376637373031636330646638356562643962313336653964616337643064346562366531
33613935656630633736386632616162663535366466663637313339323939646136636165656166
38346562346331323738393934396362316361643538653163333935656139356535363432313532
38633336646332386661643464666263646432373134306639306561663134373164326632613531
64313162303263333534666436333634663262623632366631633865336433303564363138353566
36303862656531343765643965666531613231343035636537373030613932303039623131363830
37346263666637373639643930303438316430663462333430613335613131396566303533343864
62373439663236636232353230343433336137613930623133303936323562313061336637306566
34383336646336663263373334323131316262613136353239616630303264633238383266323464
37623864646331363735306132393936306162393463313736366166656439343039626434353739
37613532393830323431393964333437306366313335393434323463346133343237303732343962
33373164363135363335323435636666386231363463373864663933373430656239366539643164
30323038323739373965616630336166356362653833303132336230323661373737666232346630
38393933303736306537383364356162656339613461333262656137636662303532663737636237
36333661663734643363636661353337616162396666356663393432633361313534333537393161
66666165363635346162623965333061386563663166643736653134303638613332313637333064
65333438333661343664303361316631643763323164386330636139353932646635393963656336
36343362323332336130633533663234343236393639323062663962633336626435653137306539
63633866616438623764616631663533363233346362336132303861653039386133323965643863
30633932646132633862666266323761656438343935636332326263653437333366306338636137
65303538613661373538313437646466393536313665623666396235353962306634386261396337
61376439636531383631383234313230303731653435393964393835393236653739316634623363
61363730333632323039326438366633336462656135366164663434383561356337393636353661
64616435386238316265386565633938623935663332633062316163356337303765366262313534
61396361326333616136366435666662346637663864326561653634313030303033303132366132
64353635383932633733303333636137323237393764396136313661353463306137316563303232
32363063626630343230333065376638626236653532383766363161313862616336396334303764
38393262613531343134653130313237343036383464393739353631636235343930653537373935
63306431643132643362656433313061303838306164643236316166303331313636376431326239
66386635333631653232383664343864383739663364363131373062623835363635393930326639
33303733353761336638363935316232336533366339396166383539363963373536346232663865
39613463386138363364316365373161313130316638616635313235363235396166323935353664
39646163306161323536366532333231373530636234643764366134306164333431336636333533
32333966393634393135333031356533666531613262313432346366373262373565323962323939
36343764303866653638336134653263616561396332643030356434383531343166356466646633
37336564613131633534313064303933633134393131656536383439393633366164376636353634
34663236663163633338303838303733643262363834633064313532626631646239306564313361
62616331306330636366306633366430353964376466313032356434346532366362356136376536
33613962316539376138323033623736366531643261386535653733303465333331383131666530
38336561353633303639616635656566323130616561656235393135616631356334

View File

@ -1,11 +0,0 @@
$ANSIBLE_VAULT;1.1;AES256
34396634353236366232316262326532383330346466656632396266363962363330323331656538
6463386133646665623738313130636139363361323839350a653766666239353962633534353261
37343761653238333833316131373035663266336336383564613230366639663861656631646362
3462383738373136630a303131383066613030653564316335656332373534396336323538393933
39383232613833393763663564633738376436626665623333663163306630393866343236613230
66376334653631663365323432363364303431326336623266376535393338393733643964363462
63333031376134623632383865653136393766346637346563313231393766363331656336663639
35363461646561616136616334306232376165363364323931313539373438613564633630376237
66323936356136646233373662323030376130356337326263353239323338653330623830663432
6434393837656430346632383766636664613436373339396430

View File

@ -1,51 +0,0 @@
$ANSIBLE_VAULT;1.1;AES256
66646230643466316437343665656535396535613863396639333265316636633339303663393064
3133353537366632303931353265396364373865373562300a643733396562363463623630623930
63376533663434653439366163333333303131343562313836336465643561613435613938383438
3434346462663264630a313761383664326362346638383639336131393239313338616565663933
39326632333833653331376462393639376561306233663132376565646364363464376464646436
36613238323331396234306561653438303031313965333266336537303532313661336236653962
32393361356334613064663739366164383733666330613565663132306239303864626431653161
32343436376533353339656163646165663639396238303938376662393234313138663261663662
39393465633062306565353630366362376330643236333639343439346330623130353831366563
65653537383233623962396532336134373934656135666539663532363963393738323264666265
62383263643733633662333236623432313630353030306336653931376334633263356638386631
34393935353035366332353132646432383536316137386530336233623161393834636561646437
37653732313233333838313738373031643631323961323332323935356436386430323163373032
31373839346638303731363131623530303939323462643236303830306430343466343365336536
34356165623564333163623061316462306534326132396566323439373364386536323764316435
61623365656335343564366530346562343436313739613263653164343865643333343737643431
31353334643563353762626536346138643833313430323238393231386139653736373964656566
31333565643730616661306234323965336333383130346638343934343063616166623361633566
33383733323230616234313766333463356262333231303830323535343062313439353031326234
34303135613666333031343234356466306161623738366163373939376662366138643838393431
33626436343763363465393330343061303234616338386637313832663664323061646634616432
36653835626664333366633836656430666433363262303934323465313731653333373733326532
63313233633062636363616336646264316162623565643333636535616566623037653832653261
65336636343961643032633836333164383232323932653538366235323166623563663531383033
39633862623437393563633863666338663532363439623736353034666338363565343065323039
63623934613262373233663465346666333930343830386634633164326135386561633735643263
30353139376663346633643938666462353034303737343163623133313236386335633231623735
35306331613330343932646531393566383366656239633232653731366661383232616332316236
31396335313130633938323766326464363862653934343137616131393065303463613838643436
32376265653161306435303835376565643566613162353764373434663030323863323261333763
63353732313161373735343066303965316239343963376232663939626463646466343862626631
64343039623462343561333035626162636239343435636338306239613961663737313039643832
30666539396535653536613264326266323533363831343539653363353033393436656564303439
64316537623436336135643063633337636634323538616364646661346262373430656163623566
63633332346239323362343165366137623264386132616239373636636330613031333466383165
64373037623630643263623030633435623131313466343762643531623063323230613733643262
65373066616333656133613563636337366366386133636533643931663532393266613433646534
62353166326232366166333763653062626533356131623366336537623662393866393162383938
36326232313831346664346635623362313563323661663636353163343065356261313235303330
61346364363066653831643430613566383265613534653635313637623634326366303634313832
33393439366538383235383137633531336434303063396635626230653536613964336361393337
62306330376463393561333735636431333732363862666137313739666339643937663162646536
31653931376637316364393462333433323061656263323233653733313966613132643664326362
66383635303666626137636566353636643539313663396133663235353231393534656637666665
35333235626362396536373064363061366231656337356563386438343362633666323138316631
65363238373532383062316634353763306231653932663132333030326364396661396464333033
37353964313932326265623830353532643766613036623434353236666266316439623535333530
39303766343162346566646333373561626562643037346363343434393762323735663231636331
64373435303436363735356130636565636663366633646364383566303561353837333136653530
6438343339663436356535303434343832393366303263666535

View File

@ -1,6 +0,0 @@
- name: test
hosts: 127.0.0.1
sudo: no
roles:
- hello_world

View File

@ -1,13 +0,0 @@
- name: Hello Ansible
hosts: localvm
vars:
user: "{{ ansible_ssh_user }}"
sudo: yes
pre_tasks:
- name: Hello server
shell: date > now.txt
roles:
- role: mysql

View File

@ -1,136 +0,0 @@
$ANSIBLE_VAULT;1.1;AES256
32636230316261363062326338363338386265623431633263313431373432616230646334313062
3836363231306431333533326538386636383561343565660a663539313233313537383136613434
35303864346335386338353633366338383134623139306338363065316232323463626264636335
6134346134386531370a353234353061386364306232663231646362653838383539393931346466
31353966373761653365363464636336326464623736343630343136353066353331393731646236
38646663653862363435343338623731373532303261313661393538643761346638376238616530
63363238613961316332363733653837343662376433636261336565316231393533383038653936
31323664363839656561346431333166623263383737363964396564663164393439613634663636
31346566626332363963656434333634353233356533323863623939383730333061613639383539
39303530373033366635303531353662366339373937313663623138323836353064326637613737
36313430363465656538666534333364366663316537323639363239353561306530316130303133
32356636326130346630376134393264316461383464336261313734656333653036636534303961
35663631643132646334393539663365326664343636326163653161653137646663663466363035
63666530353438636231383332333235626431636531643036373935666132633433643838633132
35386561343366336535396538343630613632623938323963366562613733626238356334383432
32656536666539313462643738656531373438623631393230646661613731616466613439313038
63333538643662343837666239376430333562373065316266336131343532646239346634663263
33323235663965326439343534396461376236373962666530396466616265346266343935633566
39396432343163303666343762643934323461313935343531626432353762623236326162643939
64663831653962626633356430633232393737343237323134616333393436313337666165366634
32623861626630303137656331643738643562323531336564383466666532303636383538313630
30623763333430343762393164353131373733336230323432313266356536383361333537343937
32636532613134303234313531646436666633613431616338663263316337303635376361306338
39333764376136363664303165393938646366333832333261313337623337303138616661663362
61343663376135613036313736653964343963616439636239663261393037323439323061366339
30323130333431323534643635663531366266393062363362623930633139366164326236636232
65363562393063666334613136306166616232313333633337373965383631386165613261363662
65316466613465313332626139363365383262653731633162366639323239346239363930363761
30663839663830363462663136336432346233383934383538343334623335313033386462393135
64326633643965643366666331336362623137626166616237303464323135643634653662303335
30386237313338333532666236393637663131313939393939666265303264666466363962653166
62626231616463346134346337323132316331313862336665613261626532666130356433336265
64633136666433653532333964393861316235646434623733653961343034356165663065666330
39376239343462396361323731376632323936396332393461646238623531323332623937323862
30373932656463333161306336323166393964376637366236393137323432383432313736323464
61666634306564343865646438346664363563643531623064346234316533306431303735323866
32623762643230366631396431393862623363343331626136336131386636336439376661376235
31643761336332303933613936393365343035396332376663656632343739343264646565646466
37353031366661333134313134333137343530623235616239386439643539346636656362616333
31646535323362306139356332333536653839646234316231346535343538336432363261353534
36373634346131346132306366336136623163623039623231363739653730346135613631346335
36303036383335623635383363383733353135653665643239613939333931386539386161623762
33613133303763303431666564633031323162336230653661383730336664353233353530323237
33663466303163363165326234306561383634316130386637363866323732623233396363343065
37303862383764616231356234666633366337363961326339613031346135636633616566393337
65353339386439393965313866363533633633656463643364393134653339656135353436316139
36313663386566666133626466396539366566643130363439333732663465316162633132646234
62363139666331363962366430383233333731383031633437623166386337653436376639616435
35363561373162396362613136353537623935613136373633303965393533336461626366646366
61373036663837323839356163613538613032346437316433663534396333313966616231623964
37633735306561303861666237616438663232653866623637616561323365373966326530623161
31633139386533333661373734333232623961613464646130323735643232333666633832336334
38373066306238353866346230376265633839323831383563346438393436633430316636333434
37653937333365633332613735363032376536666230643462646435613533363166303930653566
65643634633936653530313662363139303133383933333866366237646435323131613131663564
32616532633965666234383766613534613830396465333933393963393238663535316366646630
31316234333934353035623661636230376566313338653832353661646135663037666333303464
33623732353136376136616131343430336665636331663665373134353634343233383738393066
66313635666538663861633563323032356465343465393933666631643230663661626430383630
62326436343831666462613031333266663139333838366630346135303633386632306235643165
34353439646163613966656434313930366136366132653039346663343963333135363965663664
64376462356163336430313565643538383732623134633135396636656161323465616238376163
38313931333062666137376338613732353634393063396438363239316662623535663533376664
63343262653232343039373266346330623466326462636632336565383536323862323661663936
31663466353339313339343862653134323135333339646634303633346436323930396137343162
36333336313331366432373165376633623137303535356462353866373865363533383065656238
31383039643833313837373139366366663737656530633164393838313339323665386265306566
63383632393337613434393338346463363835363164393630653964383832653466303164306263
30633462316231323533633364623962343361663235626236373738356133623461316665366332
65366166333066366638323732303362633735333439396661306162646534396564386639613533
39303735316234356533383733383435613766326639336533663238333465653437323638623537
35363962636433616130666537616664343462313863313735343237663034323564353961383662
30386461386532323065373663363631613134663038303437373635333632643261666330613230
65613335303335326163396432313837323866623639616632383437613939623132613864396432
30656631313466656665623433643038366332656165383532343162386465313565303532396233
36646430623935303264346466376661386130323063303630323662306565313730663537333436
61356235343939386337643065636238346531653931373531376464373862316236656161396632
66663331343365636266623661373637383262383264313931343162666231353732366231646634
32333166353231346662373062663633383961376633316633396464386331663962313435666131
39633835333035636330376239616130666434393735393561623263646638303966636139633732
39363165613732393535623365316461303934343233663064306163316130326161663636373861
35353638633833613730336565383862633232386436356462313466323835326530666430663630
39666164376666663638643133343439336136613432323861653135613330333661366539316262
31386664623664383334633033303439313663323832383862656333366337323564613532616336
64313565333638633733613132393565316463393130336331383865643061313435656135613362
66316664623938616266323738633565386561396366346461653532613039316635303133303737
64303037653431626631366361373364343834306231393066343736386662633935393162646530
38653236353937393139613330643066386638303536373333306530343933366335336263636666
32653138616363666630613431386239313030306161653565633638373632313139323832393434
65333137636663373532646130313932306436666363366335316330396431323363346437613561
33343036333136616330343364643833313465326432346535313232373066633763656161306138
38383038353037376330643934393665663966396461633462643735643233323165373830633439
30383233616466613563333666393734326366373462336533356165636464376432326464643738
35336664313161663232303130303334353431363134303936623335323863633038373861363931
65363764316339333065656466313337373135626430326266353432633637346364393330306331
37376464653333636135363761346430336238666261323866353739376231643934336238623266
66303962313166363133643164316466396662623233363539363332633433373762313237613532
65623264323961346661326639366665303939363261363436633266313165323361333135353530
34376266656364323633396533326564613331333731326563343735343463303731303939613538
62626361616265643563643232356139316633363537373863646166653166626536353630323734
37313131656435313866333239393531313162333263366233373930333263643035643061666332
63386639653737336262653234346466326137376234323539393466363363663231636131656262
65323034613235326664356436343339633832383966336436323038383335323861356638306235
36376163383364323834356130393664356566313464326566336461656566326135326163376533
38343365323862346139336336326630376330393236636363653761626337313132393739323165
62313462666232326562366264666165613234393036653231636639663061326266303839306236
38313331386536656334323732396532303565383431313631666632373934623634313463306533
65306638616466336266646464323539376637336232363738613462646264626430323266663830
37303162656666383336633264393233306365316164366265626637303961646262663066306164
36306534326461313866316532633561623862383863626162396564316265323034643661363066
33663166393866303839393361623031613665636637613035366463643166313662373635333737
32363230346234313965353833373339646463313166343736313563323434316134666132646566
63663764663764393865636365653336323664356166343032373138356630326461346632386230
63373864643565323430666462386464653239666362363134663332636233656631386232366638
62316139343266353065613632393437393138623337366661643362323235316332666261313830
63393961636336653639656236643464333765646261393834383865346233643361666461623437
65316137633833613666626561313630393233376666626330353264333536313932646232633938
37613163616531653830326334353236353062376563343961646163313766663033643234633135
35666531353432666662386663613534396136666434363034666361383837316532393432616639
36316232353565396539646636326638383164356531363136666365313335313038343237643964
30336137616436323332383035323432333563373732613762643137656532323035646338343430
35333539333433353539306236626131353330663466313564376231646632663361653335343439
34353334653531663634656665346536623861656564353938313236383434346137396364316665
36316434363830373337343530386135623234363435353964346534643637346430616336383561
64353332353263613530323363366163616633323232333561663038656338643934303839633161
61356630353463393138343038303732653461346535383462643066323733373863343763346337
39333763333836356531373065376161396431396663663037636462616564323138366566333633
39643437653637303333316634386462323533363862393463623133626530396239396533313133
36663266303065373234636231383162373231623936363863363466636331653961336639373337
34616635613337666235376133346233623462626331323533643230646665366161653334636565
31313738663838366235633966373665383865393536396333353066333930646335376561383732
66393466653664393933303066373765383730666235326539653032303935373734663934353531
64356466613035363464643463386135316438353131383935303637333636383164633563666637
63333266343234656437363436313762316364623831376135653737316431363864363437366665
323963393638666636623065313162323939

View File

@ -1 +0,0 @@
../just/secrets.yml

View File

@ -1,93 +0,0 @@
$ANSIBLE_VAULT;1.1;AES256
64346437633164303231353763353632353638376565623935303562383939306134356238643662
3863623565353533333032343339616464393235393735640a616438353833353930663639393262
61303932623163343666383238386137343631353032333339376339613464626263346530376166
3333663433643530300a366165343831343435396134343162656432313035626333396465373066
37623635396630363335653438643037303662643733386262356134633563326536303064623164
35356339643466613931636430376561616438616535653936316238626430333637313966333330
65653033386636623538316162663539393064383061653163343766363237626438353662373661
38343966326661323466393634343561666463623766663331346361643538393234336163386462
38343664323166616332353637343064396332333663353165313661366134333239316166313761
33346161316130353432386132373633356430306237393937326432396630333239306339643239
66306133386131376366353836326164613030323133373561363334623964346265363861343833
31663963313336323463643931663364663437616335653534663130623137613638336333663333
36353331616466386439633363383861323232626562386362376262356338663935386434623663
65653833623163376231323232316239353432616663346637616434313931386265633933333339
30343662316365346533316333636131303434633039346139373032373533313164346232623734
39653262633432383063313231383465633039653237646235663466386230663135376330333432
35643931666135353234396439303664376236646238363335303762653335316266376363633130
61396665333432313461653666336637623039383439316332333034346530383763623166626530
61383036393530633636383764653937323463656563306131666130636161366531313838633438
66313261343165333430343233393861646138373931363831336636663239363535306533623034
34306232613932323065316630363262373437626230323563626339306630633034663765366161
39396535303262653264633135656264386539363239636630626330343864663635616530323062
31333365393538346432313335616138316538663237306364656232333137666165313861376361
39383830336637326466316432303232323165303633343866623963343234636439623434643435
38633361356238313263663235323237643733646637313035316462393935396562376366386538
38396665303831393838663435353435663631383062326533353236396439383531623464636537
34356239663635373439393137346430386135306166313931313665353631613930663663313862
66616164616463663963383263626333383962373262643837636530366230303562383938333961
64323565393830646633383262313466363736646637396336343236333439396638643931636162
63313338366332623131386539353435653234336632663631383939356161346664656265643563
33633661393566303835643530616465316530613161363663313631613436633461323861313138
61346665363130376639356235633031646633303838393963333030353962333466626633616131
32643762623630613237313535636337306636356530336339663932333361313733333861306436
66346631656665626439353566393034303833326630616532656434396639373335353162343936
64633665613139623435303164363536326630373838613261616534326534666631613962653962
35333264396235343931633066653763356666393065653933353032623231366564643939363437
64646631613339326432336363626538393162663161646661333532383462663733383237636230
32613661653931346231613137353731633833303630356532623635313538386364663366303261
38383761336530326663613231353164343535613962633835643462366262336137633162333762
37353964346562626133616235363661343166613062353934636132363631306266323031646637
31356633653766376137663139373362373631653338613263306462343130613461333230646461
33646132663135626231613937353065373034383131353733333131313930616235376134643663
65366638636366646363386130663838306331623035626334373639313539666661663364316532
65313334333965336531353233336135303439653538633266393065656235643166373432346362
63653864376634353336353338353964643931353763646665363034316532623031663762666663
32353934643961393536303864373761356534333462343866333161396236326531383563613435
33333965313062366436666337323831653361383530343130643065613232356263393334386234
63386162343838363465383037326163643165323038343936303061653837373934343662656337
38353530666366303765336439383562666666623164336233333532306530393437626461373935
61363830376266666438383766303832393630623033666565363432613631343239326563366136
64666539666134373430333537343963623366633039336339626437636638323262373431333936
63633932346539376463336232623565306262656239366433313264376538646365653065316534
34623635623336636438373232383063393166653932353331386162643332326265383837666432
63623262353434333437333863393930336337616337626337623531626462356538663531366432
34363030343363316461393866323034353432656636326164333532626534363434313635663362
37626435303134353435366437393435633565656166646165633531323965623234623035346236
35346239333133313663643231356233303530303034313230333039613963366237373961623036
31313438356239336437653035633133626166633066643663333935653038356638393461316261
34343861633664656263656133326333653065393731346537613064393565303861613433386230
35646165363662386538653139656264616565313562363534376637396432313233343133633038
64343631613563623939303234313631333533623033376633376330643666623563376564326333
65326663386664613465363161353431653465663333633436343031323464383533313532316465
64363835663835363933666230353362636635333063663731643139633939626234656336333836
34376338343237636433313939623036346635643735373735626530333761376436396238393266
38646163653265303732623962303733346161646437366135633565373432616261353964633730
33313935333532333336623631366466623231396538373134616137643333616437396534373837
61633065613864653163333738626664303036353733306464353263366233633731393664383065
66363533643363363365653662323038383864383664636137613163323932646433353066663331
32386562633532366435393833623537626664396164303830653539373362376330323463316436
32303830323332333131366164316164303836383238643636373838666462366233626661336461
31623235323165303339303737343363396136656161666531653866316461363439303737363665
34373235356632326562343563633735373834626665396362353732636232316139326665383063
66653336303036363864663533633262363937373566306135626430653065393638656662633233
32643938663030363436633463646562653961383332306462353933396335333765303936366230
35396266653135346334323632633235626663626330343063666233643136343435383366393233
33333761333937373164613861353039393633616361613339366633643439386365316162393264
38313035613033626330323535666531323939313437383666323730343065366138303930643362
36663863623534633930346336343761383632633737386332623533363632333262616330613063
33333765633335636132646663306431313138356538366464643062663032343830653131633932
65343265373939303433646333336133313132346535363064343261353463666137393362303862
37363633336430666236646161643863633932343564353937386463366561613239656638666536
34303961306333303938373666316637393964386231363736663731306435353833373032636135
33303065383235363639383031323431363764306636633435323638616666313135633135303065
64303531323030323430663762396132373037303363366333366639303164643335393861343035
39356363623466633638633663393734363534313531356361663564376330343263393066353064
31323965386231393736393631626438616635666130333630343461303339356537333165306338
62643765656638626162356236383163363863653863613437633634323461313063623230323063
38346131303737643233313435303361616165663138326431363361613536366366643831333362
61383236613438373862373739656661323537616463386466333035646166383065343263343339
36353233363266633435366630303463393430316134313965353262626631396230396462353030
66653234343439353061623738663830663937363932623530653962633138323365623766386365
31303933636438653532

View File

@ -1,159 +0,0 @@
$ANSIBLE_VAULT;1.1;AES256
37303235636630316435383233653430366438623337383033636361383766666232616330303263
3138326465636535373638353765616237306265656639620a343362663063326666313237653263
65383565353338303137316563346636356535616365343762633762643136653736646131626264
3132633030623562390a663936353138313262653431336238656662366462373961393739373639
35616533346132346462663633356636363134363737663834316466393435313366666138376435
32323862663864616463346239663432646430643765386633643432356462333263386665326438
31346632636166323163323730343937336563313235396265393261326339636263316438396461
38316238633932326664386235313365613430313761646162383265613030356434633631336365
62323830346631656635623438646162323136633038643233663963376163306661393332376130
65346234343566613836306461613261623561313765663237353962663834396635393161626138
65663731663162623062633436303238626631326632613339343335353036313231626331373538
32393062363665666131646337613231383934323132326332396338396361323832353263623938
66393635323836656365663866616637613335646163353065626538386639393365373366363163
65643266363537313237373765366665643863363239383330646233366333363462396233393733
31376464623436623165316365613665643236316136633337663762323363386163396364636332
30343065623238313139343839653633316664313634636535666435366230333961343163613839
61646666313136613734663238306563633837613134376362633966353233636433363166383363
31363962636633616433646236626132633534663430653631356538336139613430653366353061
33383634316137323132396336383062633866616639366633616363393161656361363834326435
33373561396466383638613665376137653738616461333236323463313264643334313662363337
61663434303464633163353366323965643865623931383565623165343565393665396239386533
34353431313561336630663963363933666639636237323033343566626132386138363433346435
32353761313765616230383639633061386161343363333938646163363732346337393930363761
61396237633065366135386263613463663633303734313438383965613964316232633265636631
65623236323930353665313165653764393263613339666634353364303165346432313739646537
62333632383139666436313135653130643562643936323336626361336364313764346263316231
30613730356133333762356631383032366538393139643337303963646630643934333431303234
63636536633763616434623432646137376639616535313535373835363933613265363236346438
62393331653435333539623461343239393230653462333463633538393063343139343564626234
64323337336366643362613563333835353839386333613361383937633166333633333763646133
35353031303734313161396430646137653636363631646465663739316334663339643832373836
36316131356366633834393130393834643138663361366562313139313862393464306462336165
34623335303831323336366265393938313738303837653435633735613139383738386561386639
66633333373466313063643063623332383566656366336531326632396162333835653865663934
33306139633462613661323861363563393334653662376565616437636436653263316536303532
33663339636561646135383962666237666630663130623665653864383436356462613466393034
64623033653966666533323465346230313662613237343035303033616263383165633865633535
35366334376335313831303030336637636462656534353830623431363536643361663366656361
31623162373161383866623465306162346534336435393639623536316662346531386434326537
64383931663034656633636563386561396164636232363037316230393132303237333132383339
66303665353839626462396132366666356339666238626132663531323236346532363866623530
64386561646661336162656264346539343866343763616439306436636635663264613237366462
66343337383265343832393139633562323738313232333762313131373636306234303266316435
62663433323166386532643337666262656430663530643564303334393732653666656138303232
38363835333137643537666561653030626633666263336661326437636464363261343938373335
65346237323231653338366235393831653237393634633064353133323539306263336430373061
66663134363931663263303031383736353135613839333638643435386234663334376366663139
36663432653036666430313333343639316430613036393338326338373862653931383338376339
62656236613764326636623238663030613864386633656337373064626632323733333164383238
62363462336366396632626237663033383533313832353161393238336131353566323566396339
62376566326535376532306632623531643138313334343165356665353631363033303730613935
30633032343134353937653638373130343237613632303238333065663135633661383865336632
31393138353535376538326466656132373666326332336364356530613862653562303765333832
31386565393538656236626263356436393437353133663032613139333261373239356465353432
33643635346334393136346236396636343861316364616465366339356637623061383830313863
33333230643435356334376634363931653933666262383464643861373539326439396438333132
62363166346664326264633163363134636331643130336232313565666664363062653863323165
35396333396561316233353839643332633639303939663033386563313831366238666136393464
61623662373638656336623962336461626161363261613935643965333938616265396635323433
34323431333837323163313730323537653135663633333366376238643930663863636262303838
38663034653339366237303830336537353137333866393033383463323931373135633538303234
39353664623839386633636430636565333631633531383362396131336534376664326139326535
38613434373737636464663737313430323536393737393262653866656463336561386566646133
61393239636633616332643336383438396536383932633266303361393066393830663237393137
66316437653865393561633862633061643635306334613432633839633332356638356461383961
31376531373866303231313463653661656636623235613639666439323661316230313937333038
36333362353638383332343438363330333263666566356263336639626332313363346539393362
61333136396136313737633234353466383933376537346365393665633739636439313430323037
62666331613034346137333334376165613162623432346461646561613233393235363631656431
37666632643837353238306235613766613131333239316434656237663965616431383761653966
36346130633765306336393033326135323336326530396635333264306535353965353031306662
34663766373935653464353561636430626538653464363030653335613231643733303831646437
65396136306330663432613932623932383566346636643932393036613030636139323730376639
30663132323431396339663963666566383765393935616335393030366332313665383035646631
37313166396636363464333763316235613562363164643133303930616632366434656531633536
65376430313631373934316330316234666336613263643133323632653761623035343966356165
32323231646537366565623963373630353735343463663361373837306261373337656363633166
64393930326431613433316232343461363530663761666166376665656130643665633238396264
32643933353666383365323262623733353033653766623734353837333430333664306662636434
34623635353536333539373032323835383638393033316661366661316565396161666334323830
31353631313165393230353438623132323339303664373264666464656336633966313539636564
37616636646334663133376130663731653461373664343966306637346632386262656133663432
37353062633434643063623136356364623833336336666235366366656666366232623136383739
37626436643562646430633564396439323730623563616366303137653765666533306331643331
66633934386430383631623166386539313035326632386639646261643236366333663539643330
30613535666238623137626236313038656335353863623031366466303934616438336135656433
36653966333236326636663763393766643265366164303930326361313265326430333766366139
64356138666230303263383061376138613938353039313163646662336435313966316239313662
31353334303532646164313634316666663562613037373564646566646136633638326333613834
64383131356433653837353132623263313330376338613836633365353965383965666239313066
62623462376566613039343235653635353064393861326134653535373932623962376339613637
30646461646230333330623832356166653866633731306465663566653733363630653037643638
64326462663830653335663932616665313064333333626433616637656662663834653935393531
31313062326639393231303064636262386361643635353737383261333035646638383030343963
62393963346464383966663766363262396636656163633638306361373166633762613963666339
37353130666463653634333233633334666364623834313532363237396233613834653237653365
62356432633539363530393131323865366464383465623065333637613733313935663661393665
33313364643833336131353962373361363162373863356463316132356135316561313564383636
65316364636666333063666232363164656139623636636661646433613964656631346438366163
30343931633234633137616235303563643039663035623334316631376533323132623334376135
33353137313534323335333464306336626139373532356536323630393066303633373836326636
63636263343061366233323134356131316232616162313361656639306332313438316436353236
65643239333730666633313962386236393663393537613435333935336331353664386538346139
39616532653239656135393535306261656563386331313734633633333161326333353331613637
66656662393830343435303462393865386337353539346663303535633738336639396337336466
65383661626462653037326636356537313039313066613862386462643634326331326236366631
31303238613531393766363165306534383037623534323232313463343766336661383637616538
38343864386532303736316638663038636332633264353464393662336532353635643165633533
63373632653066613133653962356439663966326333623332333737323934346139346330343634
63613130376533656633356532613963386666306435366237643135613937633032656431353833
31393033656531643761313431623638383038356233643531343466613637376661343463633437
63336233623034303038343636333566306331343966393865643234613233316539313762396161
34316638383163366435643535633834613930393432616464336434363230353964646433613433
31623064393733393065653662613334313239366333323438396365666335666666306363396133
35356131666132336134386237666633653231636361633930663065346666656137376661613137
66333564653232303266386435333734316535333162323338323265363439373935666138666438
30623161353134353964373334383530613663643061323864363662393035336136666135646330
63363737643538643935613962643866663936323264333864393764376130386233663334366431
38356438623238313966623130626139313664623139656166366334326238333031363539363037
36313930633037353835326635376164633239643737326161646634653933333239313637626662
61313762346539383036336330313665623337356639326237376330613465653736396138316466
36326538313161663935306166653864386637613432316266633534396365336338303939346536
31623664353935333930366236666634363133316438633439336637376366366331373339653835
31343637643838656465343037613561643063323563653263636532386633303966316364343461
32656464383661666335323037656436373132306566366262353037353438396337316364313666
66363030306465616164343035376337636431636339663531333239663864316465373332373534
65313462376535333661343931623966336435633730313035353631383436333162623030373061
31383239333164363538356430373934356161633634613432623834396562616134643665373064
39656364303962363035333835616463636331666336616335383035626538663266633330363231
34636630373534613033616165383935343436386661626161633336366265333738376663333233
38623438376434306133323365636635643234616533333063323565313036313739626464643535
38333662646635373337396666376638346337346536656263656663333266653932323936336633
64643366386161323037653335663533613066313862333630653530323765646233643861653837
61656231333039633463653762343463366334623137663032613861646539343732376264336139
38366138383762383531386336333463663839333064623765306363356536323362346433343665
64616261653933376561393632316139313534376233313036313963613534623539353232376534
66646362316364373334323533326433383230326332343765623566653035336266383634353238
66353164623565306230353834396434633233396335333930353237633663353862346437343436
37383666666263646538616665646264643535333532376662396538393062393238376263326235
30323437623261356565636466313032343135346166663934656537663837383639323638323937
38323562323565306336636131313430656231376339666535633035363861373639633535343533
39313563353863663439616132316136393231353266396638643761653363653564376335646365
34393338323462356363613661313536333233653965323434336361633730346666393034613966
30353437323366653738376461346531316137376164616164363766386131313332323535656236
39633038303636393536363938643638383037383130663263313832653064396330316134613736
32316663393832373133306435616364656633646565326661633535396634643861323831633661
65303737663731653066343531336330633732376563303163653065326663366264303537646238
34663833363538646236646263383634366133376365336638633962343864393131326565363333
39666636626461346632643361643862323233613963323266623434303338383366656436653832
35633865663062386437336665323566616538623265323365616666373062306331643835316564
61643962373131366432616562323463383534376534636132653761663232613765353132313964
33356634636335373837396530663830613331383235323965356165356235623036303631376139
32313532636433653433646662633664383666633566313335613530346564353161376536646466
62353533366434366534353261383363633762653532333431383930323637623736613637653930
33623037373439623736356264346562383533323330323164633638343364383035376463633831
38626634393937356534653237303835336666623338646361313333303462653661623133356236
37636133363863633765396561363163343365613030633638393630653165323861333337313231
6536633566373865643733383466646439383065636532336431

View File

@ -1 +0,0 @@
../prod/secrets.yml

View File

@ -1,4 +0,0 @@
github_auth_key:
mysql_root_pw: unglueit_pw_123
mysql_regluit_pw: regluit

View File

@ -1,395 +0,0 @@
- name: just setup
hosts: just
vars:
user: "{{ ansible_ssh_user }}"
sudo: yes
pre_tasks:
- name: check apt last update
stat: path=/var/cache/apt
register: apt_cache_stat
- name: update apt if needed
apt: update_cache=yes
when: ansible_date_time.epoch|float - apt_cache_stat.stat.mtime > 60*60*12
tasks:
- name: set DNS record for just.unglue.it
route53:
command: create
zone: unglue.it
record: just.unglue.it
type: A
ttl: 60
value: "{{ansible_ssh_host}}"
overwrite: yes
aws_access_key: "{{ lookup('env','AWS_ACCESS_KEY_ID') }}"
aws_secret_key: "{{ lookup('env','AWS_SECRET_ACCESS_KEY') }}"
# TEMPORARILY TURN OFF
# sudo add repo to get latest version of python 2.7
#- name: add-apt-repository ppa:fkrull/deadsnakes-python2.7
# apt_repository: repo='ppa:fkrull/deadsnakes-python2.7' state=present update_cache=true
- name: do apt-get update --fix-missing
command: apt-get update --fix-missing
- name: installing dependencies
apt: pkg={{ item }} update_cache=yes state=present
with_items:
- python2.7
- git-core
- apache2
- cronolog
- libapache2-mod-wsgi
- mysql-client
- python-virtualenv
- python-mysqldb
- redis-server
- python-lxml
- python-dev
- libjpeg-dev
- libmysqlclient-dev
- libxml2-dev
- libxslt1-dev
- python-setuptools
- postfix
tags: install
- name: make {{user}} group
group: name={{user}}
- name: make {{user}} user
user: name={{user}} shell=/bin/bash group={{user}} generate_ssh_key=yes
- name: install some python modules to use
#pip: name={{item}} virtualenv=/home/{{user}}/venv
pip: name={{item}}
with_items:
- PyGithub
- name: create /opt/regluit
file: path=/opt/regluit state=directory owner={{user}} group={{user}} mode=0745
- name: git config
command: "{{item}}"
with_items:
- git config --global user.name "Raymond Yee"
- git config --global user.email "rdhyee@gluejar.com"
- name: ssh-keygen
#command: pwd
command: ssh-keygen -b 2048 -t rsa -f /home/{{user}}/.ssh/id_rsa -P ""
sudo: no
args:
creates: /home/{{user}}/.ssh/id_rsa
- name: create deploy key for repo
action: github_deploy_key
sudo: no
args:
github_auth_key: "{{github_auth_key}}"
repo_name: Gluejar/regluit
key_name: vagrant_ansible_test
key_path: /home/{{user}}/.ssh/id_rsa.pub
- name: postfix install
raw: DEBIAN_FRONTEND='noninteractive' apt-get install -y -q --force-yes postfix
- name: clone the regluit git repo into /opt/regluit
sudo: no
git: repo=ssh://git@github.com/Gluejar/regluit.git dest=/opt/regluit accept_hostkey=True force=yes version=sysadmin
## installing mysql
## https://github.com/bennojoy/mysql --> probably the right way
## how do you make use of other people's playbooks in the right way?
## https://stackoverflow.com/a/7740571/7782
#
#- name: mysql setup
# raw: debconf-set-selections <<< 'mysql-server-5.5 mysql-server/root_password password {{mysql_root_pw}}'
#- raw: debconf-set-selections <<< 'mysql-server-5.5 mysql-server/root_password_again password {{mysql_root_pw}}'
#- raw: apt-get -y install mysql-server
#
#- name: Create regluit database
# mysql_db: db=regluit state=present encoding=utf8 collation=utf8_bin login_user=root login_password={{mysql_root_pw}}
#
# # GRANT ALL PRIVILEGES ON regluit.* TO 'regluit'@'localhost' WITH GRANT OPTION; (covered?)
#- name: Create database user
# mysql_user: >
# user=regluit
# password={{mysql_regluit_pw}}
# host=localhost
# priv=*.*:ALL
# state=present
# login_user=root
# login_password={{mysql_root_pw}}
# running stuff within a virtualenv
# https://stackoverflow.com/a/20572360
# https://stackoverflow.com/questions/20575084/best-way-to-always-run-ansible-inside-a-virtualenv-on-remote-machines?rq=1
## hard coding of just
#sudo("ln -s /opt/regluit/deploy/just.conf /etc/apache2/sites-available/just")
- name: link just.conf into sites-available
file: src=/opt/regluit/deploy/just.conf dest=/etc/apache2/sites-available/just state=link
#run('pip install -r requirements_versioned.pip')
- name: pip install requests (to see whether in right place)
pip: >
executable=/opt/regluit/ENV/bin/pip
name={{item}}
virtualenv=/opt/regluit/ENV
virtualenv_command=virtualenv
with_items:
- requests
- census
sudo: no
- name: pip requirements
pip: >
executable=/opt/regluit/ENV/bin/pip
requirements=/opt/regluit/requirements_versioned.pip
virtualenv=/opt/regluit/ENV
virtualenv_command=virtualenv
virtualenv_site_packages=yes
sudo: no
#run('echo "/opt/regluit/" > ENV/lib/python2.7/site-packages/regluit.pth')
#run('echo "/opt/" > ENV/lib/python2.7/site-packages/opt.pth')
- name: establish regluit.pth
lineinfile: create=yes dest=/opt/regluit/ENV/lib/python2.7/site-packages/regluit.pth line="/opt/regluit/"
- name: establish opt.pth
lineinfile: create=yes dest=/opt/regluit/ENV/lib/python2.7/site-packages/regluit.pth line="/opt/"
#sudo('mkdir /var/www/static')
#sudo('chown ubuntu:ubuntu /var/www/static')
- name: create /var/www/static
file: path=/var/www/static state=directory owner={{user}} group={{user}} mode=0755
#
#run('django-admin.py syncdb --migrate --noinput --settings regluit.settings.just')
#Run syncdb on the application
- name: django syncdb
django_manage: >
command=syncdb
app_path=/opt/regluit/
settings="regluit.settings.just"
virtualenv=/opt/regluit/ENV
sudo: no
notify:
- restart apache2
- name: django migrations
django_manage: >
command=migrate
app_path=/opt/regluit/
settings="regluit.settings.just"
virtualenv=/opt/regluit/ENV
sudo: no
notify:
- restart apache2
#run('django-admin.py collectstatic --noinput --settings regluit.settings.just')
- name: django collectstatic
django_manage: >
command=collectstatic
app_path=/opt/regluit/
settings="regluit.settings.just"
virtualenv=/opt/regluit/ENV
sudo: no
notify:
- restart apache2
- name: copy STAR_unglue_it.crt
copy: >
src=/Volumes/ryvault1/gluejar/other_keys/unglue_it/STAR_unglue_it.crt
dest=/etc/ssl/certs/server.crt
owner={{user}}
group={{user}}
mode=0644
notify:
- restart apache2
- name: copy server.key
copy: >
src=/Volumes/ryvault1/gluejar/other_keys/unglue_it/server.key
dest=/etc/ssl/private/server.key
owner={{user}}
group={{user}}
mode=0600
notify:
- restart apache2
- name: copy STAR_unglue_it.ca-bundle
copy: >
src=/Volumes/ryvault1/gluejar/other_keys/unglue_it/STAR_unglue_it.ca-bundle
dest=/etc/ssl/certs/STAR_unglue_it.ca-bundle
owner={{user}}
group={{user}}
mode=0600
notify:
- restart apache2
- name: remove /etc/logrotate.d/apache2
file: path=/etc/logrotate.d/apache2 state=absent
notify:
- restart apache2
- name: a2dissite default
command: a2dissite default
notify:
- restart apache2
- name: a2ensite just
command: a2ensite just
notify:
- restart apache2
- name: a2enmod ssl rewrite headers
command: a2enmod ssl rewrite headers
notify:
- restart apache2
#
#sudo ("/etc/init.d/apache2 restart")
#
- name: turn on ports 22, 80, 443
ufw: rule=allow port={{ item }} proto=tcp
with_items:
- 22
- 80
- 443
- name: enable ufw
ufw: state=enabled
#with cd("/opt/regluit"):
#
# sudo ("yes | adduser --no-create-home celery --disabled-password --disabled-login")
- name: make celery group
group: name=celery
- name: create celery user
user: >
name=celery
createhome=no
group=celery
generate_ssh_key=no
# sudo ("cp deploy/celeryd /etc/init.d/celeryd")
# sudo ("chmod 755 /etc/init.d/celeryd")
- name: copy deploy/celeryd
command: cp /opt/regluit/deploy/celeryd /etc/init.d/celeryd
- name: set mode on /etc/init.d/celeryd
file: path=/etc/init.d/celeryd mode=0755
# sudo ("cp deploy/celeryd.conf /etc/default/celeryd")
- name: copy deploy/celeryd_just.conf
command: cp /opt/regluit/deploy/celeryd_just.conf /etc/default/celeryd
- name: set mode on /etc/default/celeryd
file: path=/etc/default/celeryd mode=0644
# sudo ("mkdir /var/log/celery")
- name: make /var/log/celery
file: path=/var/log/celery state=directory owner=celery group=celery mode=0755
# sudo ("mkdir /var/run/celery")
# sudo ("chown celery:celery /var/log/celery /var/run/celery")
- name: make /var/run/celery
file: path=/var/run/celery state=directory owner=celery group=celery mode=0755
# sudo ("/etc/init.d/celeryd start")
- name: start celeryd
command: /etc/init.d/celeryd start
# sudo ("cp deploy/celerybeat /etc/init.d/celerybeat")
# sudo ("chmod 755 /etc/init.d/celerybeat")
# https://stackoverflow.com/questions/24162996/how-to-move-rename-a-file-using-an-ansible-task-on-a-remote-system
- name: copy deploy/celerybeat
command: cp /opt/regluit/deploy/celerybeat /etc/init.d/celerybeat
- name: set mode on /etc/init.d/celerybeat
file: path=/etc/init.d/celerybeat mode=0755
# sudo ("cp deploy/celerybeat.conf /etc/default/celerybeat")
- name: copy deploy/celerybeat_just.conf
command: cp /opt/regluit/deploy/celerybeat_just.conf /etc/default/celerybeat
- name: set mode on /etc/default/celerybeat
file: path=/etc/default/celerybeat mode=0755
# sudo ("mkdir /var/log/celerybeat")
# sudo ("chown celery:celery /var/log/celerybeat")
- name: make /var/log/celerybeat
file: path=/var/log/celerybeat state=directory owner=celery group=celery mode=0755
# sudo ("/etc/init.d/celerybeat start")
- name: start celerybeat
command: /etc/init.d/celerybeat start
# run data loading script (not on just)
#- name: run data loading script
# script: load_data_just.sh
# add setup_django.sh script to root dir
- name: add setup_django.sh script to root dir
command: cp /opt/regluit/vagrant/setup_django_just.sh /home/{{user}}/setup_django.sh
sudo: no
# set up crontab
- name: crontab for just
command: crontab /opt/regluit/deploy/crontab_just.txt
sudo: no
# deal with SSH keys
#- name: add RY ssh key
# authorized_key: user={{user}} key="{{ lookup('file', '/Users/raymondyee/.ssh/id_rsa.pub') }}" state=present
- name: add ssh keys from public_key directory
authorized_key: user={{user}} key={{item}} state=present
with_fileglob:
- /opt/regluit/deploy/public_keys/*
sudo: no
- name: add ssh keys from github (redundant?)
authorized_key: user={{user}} key="{{item}}" state=present
with_items:
- https://github.com/rdhyee.keys
- https://github.com/eshellman.keys
sudo: yes
handlers:
- name: restart apache2
service: name=apache2 state=restarted

View File

@ -1,82 +0,0 @@
#!/Users/raymondyee/anaconda/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Raymond Yee <raymond.yee@gmail.com>
import json
import base64
DOCUMENTATION = '''
---
module: MODULE_NAME
short_description: MODULE_SHORT_DESCRIPTION
description:
- Adds service hooks and removes service hooks that have an error status.
version_added: "1.4"
options:
user:
description:
- Github username.
required: true
oauthkey:
description:
- The oauth key provided by github. It can be found/generated on github under "Edit Your Profile" >> "Applications" >> "Personal Access Tokens"
required: true
author: Raymond Yee, raymond.yee@gmail.com
'''
EXAMPLES = '''
# Example creating a new service hook. It ignores duplicates.
- github_hooks: action=create hookurl=http://11.111.111.111:2222 user={{ gituser }} oauthkey={{ oauthkey }} repo=https://api.github.com/repos/pcgentry/Github-Auto-Deploy
# Cleaning all hooks for this repo that had an error on the last update. Since this works for all hooks in a repo it is probably best that this would be called from a handler.
- local_action: github_hooks action=cleanall user={{ gituser }} oauthkey={{ oauthkey }} repo={{ repo }}
'''
def main():
module = AnsibleModule(
argument_spec=dict(
oauthkey=dict(required=True),
repo=dict(required=True),
user=dict(required=True),
validate_certs=dict(default='yes', type='bool'),
content_type=dict(default='json', choices=['json', 'form']),
)
)
action = module.params['action']
hookurl = module.params['hookurl']
oauthkey = module.params['oauthkey']
repo = module.params['repo']
user = module.params['user']
content_type = module.params['content_type']
if action == "list":
(rc, out) = _list(module, hookurl, oauthkey, repo, user)
if action == "clean504":
(rc, out) = _clean504(module, hookurl, oauthkey, repo, user)
if action == "cleanall":
(rc, out) = _cleanall(module, hookurl, oauthkey, repo, user)
if action == "create":
(rc, out) = _create(module, hookurl, oauthkey, repo, user, content_type)
if rc != 0:
module.fail_json(msg="failed", result=out)
module.exit_json(msg="success", result=out)
# import module snippets
from ansible.module_utils.basic import *
from ansible.module_utils.urls import *
main()

View File

@ -1,36 +0,0 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Raymond Yee <raymond.yee@gmail.com>
import os
import json
# import module snippets
from ansible.module_utils.basic import *
from ansible.module_utils.urls import *
DOCUMENTATION = '''
---
module: filetest
short_description: tests for existence of a path
description:
- Checks on the existence of a given path
#options:
# path:
# description:
# - path to test.
# required: true
author: Raymond Yee, raymond.yee@gmail.com
'''
def main():
cwd = str(os.getcwd())
print ( json.dumps({
"cwd" : cwd
}))
main()

View File

@ -1,92 +0,0 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Raymond Yee <raymond.yee@gmail.com>
import os
import json
import base64
from StringIO import StringIO
from github import Github
DOCUMENTATION = '''
---
module: github_deploy_key
short_description: create a deploy key to a github repository
description:
- create a deploy key to a github repository
options:
repo_name:
description:
- the repository to write key to
required: true
github_auth_key:
description:
- The oauth key provided by github. It can be found/generated on github under "Edit Your Profile" >> "Applications" >> "Personal Access Tokens"
required: true
key_path:
description:
- location of the key to upload
key_name:
description:
- name for the key
author: Raymond Yee, raymond.yee@gmail.com
dependency: pygithub
'''
def main():
module = AnsibleModule(
argument_spec=dict(
github_auth_key=dict(required=True),
repo_name=dict(required=True),
key_path=dict(required=True),
key_name=dict(required=True),
)
)
github_auth_key = module.params['github_auth_key']
repo_name = module.params['repo_name']
key_path = module.params['key_path']
key_name = module.params['key_name']
failed = True
try:
g = Github(github_auth_key)
s = open(key_path).read()
repo = g.get_repo(repo_name)
key = repo.create_key(key_name, s)
failed = False
except Exception, e:
failed = False
# error handling and what to return with success?
if not failed:
msg = "None:success"
else:
msg = str(e) + " " + str(e.message) + " " + str(e.get(args))
module.exit_json(
changed = True,
github_auth_key = github_auth_key,
repo_name = repo_name,
key_path = key_path,
key_name = key_name,
msg = msg,
failed = failed
)
# import module snippets
from ansible.module_utils.basic import *
from ansible.module_utils.urls import *
main()

View File

@ -1,13 +0,0 @@
#!/bin/bash
cd /opt/regluit
source ENV/bin/activate
export DJANGO_SETTINGS_MODULE=regluit.settings.please
# sysadmin/drop_tables.sh | django-admin.py dbshell
# cat test/campaign_starter.sql | django-admin.py dbshell
# django-admin.py makemigrations
# django-admin.py migrate --fake-initial --noinput
# load Pride and Prejudice
echo -e "django-admin.py shell_plus << EOF\nfrom regluit.core import bookloader; w = bookloader.add_by_isbn('9781909621657')\nEOF\n" | sh

View File

@ -1,280 +0,0 @@
- name: localvm setup
hosts: localvm
vars:
user: "{{ ansible_ssh_user }}"
config_name: localvm
sudo: yes
pre_tasks:
- name: check apt last update
stat: path=/var/cache/apt
register: apt_cache_stat
- name: update apt if needed
apt: update_cache=yes
when: ansible_date_time.epoch|float - apt_cache_stat.stat.mtime > 60*60*12
roles:
# base setup
- role: common
- role: mysql
# installing mysql
# https://github.com/bennojoy/mysql --> probably the right way
# how do you make use of other people's playbooks in the right way?
# https://stackoverflow.com/a/7740571/7782
post_tasks:
# running stuff within a virtualenv
# https://stackoverflow.com/a/20572360
# https://stackoverflow.com/questions/20575084/best-way-to-always-run-ansible-inside-a-virtualenv-on-remote-machines?rq=1
## hard coding of {{config_name}}
#sudo("ln -s /opt/regluit/deploy/{{config_name}}.conf /etc/apache2/sites-available/{{config_name}}")
- name: link {{config_name}}.conf into sites-available
file: src=/opt/regluit/deploy/{{config_name}}.conf dest=/etc/apache2/sites-available/{{config_name}} state=link
- name: link {{config_name}}.conf into sites-available (with .conf)
file: src=/opt/regluit/deploy/{{config_name}}.conf dest=/etc/apache2/sites-available/{{config_name}}.conf state=link
#run('pip install -r requirements_versioned.pip')
- name: pip install requests (to see whether in right place)
pip: >
executable=/opt/regluit/ENV/bin/pip
name={{item}}
virtualenv=/opt/regluit/ENV
virtualenv_command=virtualenv
with_items:
- requests
- census
sudo: no
- name: pip requirements
pip: >
executable=/opt/regluit/ENV/bin/pip
requirements=/opt/regluit/requirements_versioned.pip
virtualenv=/opt/regluit/ENV
virtualenv_command=virtualenv
virtualenv_site_packages=yes
sudo: no
#run('echo "/opt/regluit/" > ENV/lib/python2.7/site-packages/regluit.pth')
#run('echo "/opt/" > ENV/lib/python2.7/site-packages/opt.pth')
- name: establish regluit.pth
lineinfile: create=yes dest=/opt/regluit/ENV/lib/python2.7/site-packages/regluit.pth line="/opt/regluit/"
- name: establish opt.pth
lineinfile: create=yes dest=/opt/regluit/ENV/lib/python2.7/site-packages/regluit.pth line="/opt/"
#sudo('mkdir /var/www/static')
#sudo('chown ubuntu:ubuntu /var/www/static')
- name: create /var/www/static
file: path=/var/www/static state=directory owner={{user}} group={{user}} mode=0755
#
#run('django-admin.py syncdb --migrate --noinput --settings regluit.settings')
#Run syncdb on the application
- name: django_syncdb
django_manage: >
command=syncdb
app_path=/opt/regluit/
settings="regluit.settings.{{config_name}}"
virtualenv=/opt/regluit/ENV
sudo: no
notify:
- restart apache2
- name: django migrations
django_manage: >
command=migrate
app_path=/opt/regluit/
settings="regluit.settings.{{config_name}}"
virtualenv=/opt/regluit/ENV
sudo: no
notify:
- restart apache2
#run('django-admin.py collectstatic --noinput --settings regluit.settings.{{config_name}}')
- name: django collectstatic
django_manage: >
command=collectstatic
app_path=/opt/regluit/
settings="regluit.settings.{{config_name}}"
virtualenv=/opt/regluit/ENV
sudo: no
notify:
- restart apache2
- name: create self-signed SSL cert
command: openssl req -new -nodes -x509 -subj "/C=US/ST=NJ/L=Montclair/O=Gluejar Inc./CN=localhost" -days 365 -keyout /etc/ssl/private/server.key -out /etc/ssl/certs/server.crt creates=/etc/ssl/certs/server.crt
sudo: yes
notify:
- restart apache2
- name: set mode on /etc/ssl/certs/server.crt
file: path=/etc/ssl/certs/server.crt mode=0644
notify:
- restart apache2
- name: set mode on /etc/ssl/private/server.key
file: path=/etc/ssl/private/server.key mode=0600
notify:
- restart apache2
- name: remove all default enabled sites
shell: rm /etc/apache2/sites-enabled/*
sudo: yes
ignore_errors: yes
notify:
- restart apache2
- name: a2ensite {{config_name}}
command: a2ensite {{config_name}}
notify:
- restart apache2
- name: a2enmod ssl rewrite headers
command: a2enmod ssl rewrite headers
notify:
- restart apache2
#
#sudo ("/etc/init.d/apache2 restart")
#
- name: turn on ports 22, 80, 443
ufw: rule=allow port={{ item }} proto=tcp
with_items:
- 22
- 80
- 443
- name: enable ufw
ufw: state=enabled
#with cd("/opt/regluit"):
#
# sudo ("yes | adduser --no-create-home celery --disabled-password --disabled-login")
- name: make celery group
group: name=celery
- name: create celery user
user: >
name=celery
createhome=no
group=celery
generate_ssh_key=no
# sudo ("cp deploy/celeryd /etc/init.d/celeryd")
# sudo ("chmod 755 /etc/init.d/celeryd")
- name: copy deploy/celeryd
command: cp /opt/regluit/deploy/celeryd /etc/init.d/celeryd
- name: set mode on /etc/init.d/celeryd
file: path=/etc/init.d/celeryd mode=0755
# sudo ("cp deploy/celeryd.conf /etc/default/celeryd")
- name: copy deploy/celeryd_{{config_name}}.conf
command: cp /opt/regluit/deploy/celeryd_{{config_name}}.conf /etc/default/celeryd
- name: set mode on /etc/default/celeryd
file: path=/etc/default/celeryd mode=0644
# sudo ("mkdir /var/log/celery")
- name: make /var/log/celery
file: path=/var/log/celery state=directory owner=celery group=celery mode=0755
# sudo ("mkdir /var/run/celery")
# sudo ("chown celery:celery /var/log/celery /var/run/celery")
- name: make /var/run/celery
file: path=/var/run/celery state=directory owner=celery group=celery mode=0755
# sudo ("/etc/init.d/celeryd start")
- name: start celeryd
command: /etc/init.d/celeryd start
# sudo ("cp deploy/celerybeat /etc/init.d/celerybeat")
# sudo ("chmod 755 /etc/init.d/celerybeat")
# https://stackoverflow.com/questions/24162996/how-to-move-rename-a-file-using-an-ansible-task-on-a-remote-system
- name: copy deploy/celerybeat
command: cp /opt/regluit/deploy/celerybeat /etc/init.d/celerybeat
- name: set mode on /etc/init.d/celerybeat
file: path=/etc/init.d/celerybeat mode=0755
# sudo ("cp deploy/celerybeat.conf /etc/default/celerybeat")
- name: copy deploy/celerybeat_{{config_name}}.conf
command: cp /opt/regluit/deploy/celerybeat_{{config_name}}.conf /etc/default/celerybeat
- name: set mode on /etc/default/celerybeat
file: path=/etc/default/celerybeat mode=0755
# sudo ("mkdir /var/log/celerybeat")
# sudo ("chown celery:celery /var/log/celerybeat")
- name: make /var/log/celerybeat
file: path=/var/log/celerybeat state=directory owner=celery group=celery mode=0755
# sudo ("/etc/init.d/celerybeat start")
- name: start celerybeat
command: /etc/init.d/celerybeat start
# run data loading script
- name: run data loading script
script: load_data_{{config_name}}.sh
# add setup_django.sh script to root dir
- name: add setup_django.sh script to root dir
command: cp /opt/regluit/vagrant/setup_django_{{config_name}}.sh /home/{{user}}/setup_django.sh
sudo: no
# set up crontab
- name: crontab for {{config_name}}
command: crontab /opt/regluit/deploy/crontab_{{config_name}}.txt
sudo: no
# deal with SSH keys
#- name: add RY ssh key
# authorized_key: user={{user}} key="{{ lookup('file', '/Users/raymondyee/.ssh/id_rsa.pub') }}" state=present
#- name: add ssh keys from public_key directory
# authorized_key: user={{user}} key={{item}} state=present
# with_fileglob:
# - /opt/regluit/deploy/public_keys/*
# sudo: no
#
- name: add ssh keys from public_key directory
authorized_key: user={{user}} key="{{item}}" state=present
with_items:
- https://github.com/rdhyee.keys
- https://github.com/eshellman.keys
sudo: yes
handlers:
- name: restart apache2
service: name=apache2 state=restarted

View File

@ -1,418 +0,0 @@
- name: route53 setup
hosts: 127.0.0.1
vars:
aws_access_key: "{{ lookup('env','AWS_ACCESS_KEY_ID') }}"
aws_secret_key: "{{ lookup('env','AWS_SECRET_ACCESS_KEY') }}"
please_ssh_host: "{{ hostvars['please']['ansible_ssh_host'] }}"
tasks:
- name: print please ansible_ssh_host
debug: msg="please.ansible_ssh_host {{please_ssh_host}}"
- name: get DNS record for please.unglue.it
route53:
command: get
zone: unglue.it
record: please.unglue.it
type: A
aws_access_key: "{{aws_access_key}}"
aws_secret_key: "{{aws_secret_key}}"
- name: set DNS record for please.unglue.it
route53:
command: create
zone: unglue.it
record: please.unglue.it
type: A
ttl: 60
value: "{{please_ssh_host}}"
overwrite: yes
aws_access_key: "{{aws_access_key}}"
aws_secret_key: "{{aws_secret_key}}"
- name: please setup
hosts: please
vars:
user: "{{ ansible_ssh_user }}"
aws_access_key: "{{ lookup('env','AWS_ACCESS_KEY_ID') }}"
aws_secret_key: "{{ lookup('env','AWS_SECRET_ACCESS_KEY') }}"
sudo: yes
pre_tasks:
- name: check apt last update
stat: path=/var/cache/apt
register: apt_cache_stat
- name: update apt if needed
apt: update_cache=yes
when: ansible_date_time.epoch|float - apt_cache_stat.stat.mtime > 60*60*12
tasks:
# sudo add repo to get latest version of python 2.7
- name: add-apt-repository ppa:fkrull/deadsnakes-python2.7
apt_repository: repo='ppa:fkrull/deadsnakes-python2.7' state=present update_cache=true
- name: do apt-get update --fix-missing
command: apt-get update --fix-missing
- name: installing dependencies
apt: pkg={{ item }} update_cache=yes state=present
with_items:
- python2.7
- git-core
- apache2
- cronolog
- libapache2-mod-wsgi
- mysql-client
- python-virtualenv
- python-mysqldb
- redis-server
- python-lxml
- python-dev
- libjpeg-dev
- libmysqlclient-dev
- libxml2-dev
- libxslt1-dev
- python-setuptools
- python-dev
- postfix
tags: install
- name: make {{user}} group
group: name={{user}}
- name: make {{user}} user
user: name={{user}} shell=/bin/bash group={{user}} generate_ssh_key=yes
- name: install some python modules to use
#pip: name={{item}} virtualenv=/home/{{user}}/venv
pip: name={{item}}
with_items:
- PyGithub
- name: create /opt/regluit
file: path=/opt/regluit state=directory owner={{user}} group={{user}} mode=0745
- name: git config
command: "{{item}}"
with_items:
- git config --global user.name "Raymond Yee"
- git config --global user.email "rdhyee@gluejar.com"
- name: ssh-keygen
#command: pwd
command: ssh-keygen -b 2048 -t rsa -f /home/{{user}}/.ssh/id_rsa -P ""
sudo: no
args:
creates: /home/{{user}}/.ssh/id_rsa
- name: create deploy key for repo
action: github_deploy_key
sudo: no
args:
github_auth_key: "{{github_auth_key}}"
repo_name: Gluejar/regluit
key_name: vagrant_ansible_test
key_path: /home/{{user}}/.ssh/id_rsa.pub
- name: postfix install
raw: DEBIAN_FRONTEND='noninteractive' apt-get install -y -q --force-yes postfix
- name: clone the regluit git repo into /opt/regluit
sudo: no
git: repo=ssh://git@github.com/Gluejar/regluit.git dest=/opt/regluit accept_hostkey=True force=yes version=dj16ry
# installing mysql
# https://github.com/bennojoy/mysql --> probably the right way
# how do you make use of other people's playbooks in the right way?
# https://stackoverflow.com/a/7740571/7782
- name: mysql setup
raw: debconf-set-selections <<< 'mysql-server-5.5 mysql-server/root_password password {{mysql_root_pw}}'
args:
executable: /bin/bash
- raw: debconf-set-selections <<< 'mysql-server-5.5 mysql-server/root_password_again password {{mysql_root_pw}}'
args:
executable: /bin/bash
- raw: apt-get -y install mysql-server
- name: Create regluit database
mysql_db: db=regluit state=present encoding=utf8 collation=utf8_bin login_user=root login_password={{mysql_root_pw}}
# GRANT ALL PRIVILEGES ON regluit.* TO 'regluit'@'localhost' WITH GRANT OPTION; (covered?)
- name: Create database user
mysql_user: >
user=regluit
password={{mysql_regluit_pw}}
host=localhost
priv=*.*:ALL
state=present
login_user=root
login_password={{mysql_root_pw}}
# running stuff within a virtualenv
# https://stackoverflow.com/a/20572360
# https://stackoverflow.com/questions/20575084/best-way-to-always-run-ansible-inside-a-virtualenv-on-remote-machines?rq=1
## hard coding of please
#sudo("ln -s /opt/regluit/deploy/please.conf /etc/apache2/sites-available/please")
- name: link please.conf into sites-available
file: src=/opt/regluit/deploy/please.conf dest=/etc/apache2/sites-available/please state=link
#run('pip install -r requirements_versioned.pip')
- name: upgrade pip
pip: >
executable=/opt/regluit/ENV/bin/pip
name={{item}}
virtualenv=/opt/regluit/ENV
virtualenv_command=virtualenv
extra_args="--upgrade"
with_items:
- pip
sudo: no
# - name: pip install requests (to see whether in right place)
# pip: >
# executable=/opt/regluit/ENV/bin/pip
# name={{item}}
# virtualenv=/opt/regluit/ENV
# virtualenv_command=virtualenv
# with_items:
# - requests
# - census
# sudo: no
- name: pip requirments
pip: >
executable=/opt/regluit/ENV/bin/pip
requirements=/opt/regluit/requirements_versioned.pip
virtualenv=/opt/regluit/ENV
virtualenv_command=virtualenv
virtualenv_site_packages=yes
sudo: no
#run('echo "/opt/regluit/" > ENV/lib/python2.7/site-packages/regluit.pth')
#run('echo "/opt/" > ENV/lib/python2.7/site-packages/opt.pth')
- name: establish regluit.pth
lineinfile: create=yes dest=/opt/regluit/ENV/lib/python2.7/site-packages/regluit.pth line="/opt/regluit/"
- name: establish opt.pth
lineinfile: create=yes dest=/opt/regluit/ENV/lib/python2.7/site-packages/regluit.pth line="/opt/"
#sudo('mkdir /var/www/static')
#sudo('chown ubuntu:ubuntu /var/www/static')
- name: create /var/www/static
file: path=/var/www/static state=directory owner={{user}} group={{user}} mode=0755
#
#run('django-admin.py syncdb --migrate --noinput --settings regluit.settings.please')
#Run syncdb on the application
- name: django syncdb
django_manage: >
command=syncdb
app_path=/opt/regluit/
settings="regluit.settings.please"
virtualenv=/opt/regluit/ENV
notify:
- restart apache2
- name: django migrations
django_manage: >
command=migrate
app_path=/opt/regluit/
settings="regluit.settings.please"
virtualenv=/opt/regluit/ENV
notify:
- restart apache2
#run('django-admin.py collectstatic --noinput --settings regluit.settings.please')
- name: django collectstatic
django_manage: >
command=collectstatic
app_path=/opt/regluit/
settings="regluit.settings.please"
virtualenv=/opt/regluit/ENV
notify:
- restart apache2
- name: copy STAR_unglue_it.crt
copy: >
src=/Volumes/ryvault1/gluejar/other_keys/unglue_it/STAR_unglue_it.crt
dest=/etc/ssl/certs/server.crt
owner={{user}}
group={{user}}
mode=0644
notify:
- restart apache2
- name: copy server.key
copy: >
src=/Volumes/ryvault1/gluejar/other_keys/unglue_it/server.key
dest=/etc/ssl/private/server.key
owner={{user}}
group={{user}}
mode=0600
notify:
- restart apache2
- name: copy STAR_unglue_it.ca-bundle
copy: >
src=/Volumes/ryvault1/gluejar/other_keys/unglue_it/STAR_unglue_it.ca-bundle
dest=/etc/ssl/certs/STAR_unglue_it.ca-bundle
owner={{user}}
group={{user}}
mode=0600
notify:
- restart apache2
- name: remove /etc/logrotate.d/apache2
file: path=/etc/logrotate.d/apache2 state=absent
notify:
- restart apache2
- name: a2dissite default
command: a2dissite default
notify:
- restart apache2
- name: a2ensite please
command: a2ensite please
notify:
- restart apache2
- name: a2enmod ssl rewrite headers
command: a2enmod ssl rewrite headers
notify:
- restart apache2
#
#sudo ("/etc/init.d/apache2 restart")
#
- name: turn on ports 22, 80, 443
ufw: rule=allow port={{ item }} proto=tcp
with_items:
- 22
- 80
- 443
- name: enable ufw
ufw: state=enabled
#with cd("/opt/regluit"):
#
# sudo ("yes | adduser --no-create-home celery --disabled-password --disabled-login")
- name: make celery group
group: name=celery
- name: create celery user
user: >
name=celery
createhome=no
group=celery
generate_ssh_key=no
# sudo ("cp deploy/celeryd /etc/init.d/celeryd")
# sudo ("chmod 755 /etc/init.d/celeryd")
- name: copy deploy/celeryd
command: cp /opt/regluit/deploy/celeryd /etc/init.d/celeryd
- name: set mode on /etc/init.d/celeryd
file: path=/etc/init.d/celeryd mode=0755
# sudo ("cp deploy/celeryd.conf /etc/default/celeryd")
- name: copy deploy/celeryd_please.conf
command: cp /opt/regluit/deploy/celeryd_please.conf /etc/default/celeryd
- name: set mode on /etc/default/celeryd
file: path=/etc/default/celeryd mode=0644
# sudo ("mkdir /var/log/celery")
- name: make /var/log/celery
file: path=/var/log/celery state=directory owner=celery group=celery mode=0755
# sudo ("mkdir /var/run/celery")
# sudo ("chown celery:celery /var/log/celery /var/run/celery")
- name: make /var/run/celery
file: path=/var/run/celery state=directory owner=celery group=celery mode=0755
# sudo ("/etc/init.d/celeryd start")
- name: start celeryd
command: /etc/init.d/celeryd start
# sudo ("cp deploy/celerybeat /etc/init.d/celerybeat")
# sudo ("chmod 755 /etc/init.d/celerybeat")
# https://stackoverflow.com/questions/24162996/how-to-move-rename-a-file-using-an-ansible-task-on-a-remote-system
- name: copy deploy/celerybeat
command: cp /opt/regluit/deploy/celerybeat /etc/init.d/celerybeat
- name: set mode on /etc/init.d/celerybeat
file: path=/etc/init.d/celerybeat mode=0755
# sudo ("cp deploy/celerybeat.conf /etc/default/celerybeat")
- name: copy deploy/celerybeat_please.conf
command: cp /opt/regluit/deploy/celerybeat_please.conf /etc/default/celerybeat
- name: set mode on /etc/default/celerybeat
file: path=/etc/default/celerybeat mode=0755
# sudo ("mkdir /var/log/celerybeat")
# sudo ("chown celery:celery /var/log/celerybeat")
- name: make /var/log/celerybeat
file: path=/var/log/celerybeat state=directory owner=celery group=celery mode=0755
# sudo ("/etc/init.d/celerybeat start")
- name: start celerybeat
command: /etc/init.d/celerybeat start
# run data loading script
- name: run data loading script
script: load_data_please.sh
# set up crontab
- name: crontab for please
command: crontab /opt/regluit/deploy/crontab_please.txt
#- name: add ssh keys from public_key directory
# authorized_key: user={{user}} key={{item}} state=present
# with_fileglob:
# - /opt/regluit/deploy/public_keys/*
# sudo: no
- name: add ssh keys from public_key directory
authorized_key: user={{user}} key="{{item}}" state=present
with_items:
- https://github.com/rdhyee.keys
- https://github.com/eshellman.keys
sudo: yes
handlers:
- name: restart apache2
service: name=apache2 state=restarted

View File

@ -1,72 +0,0 @@
# sudo add repo to get latest version of python 2.7
- name: add-apt-repository ppa:fkrull/deadsnakes-python2.7
apt_repository: repo='ppa:fkrull/deadsnakes-python2.7' state=present update_cache=true
- name: do apt-get update --fix-missing
command: apt-get update --fix-missing
- name: installing dependencies
apt: pkg={{ item }} update_cache=yes state=present
with_items:
- python2.7
- git-core
- apache2
- libapache2-mod-wsgi
- mysql-client
- python-virtualenv
- python-mysqldb
- redis-server
- python-lxml
- python-dev
- libjpeg-dev
- libmysqlclient-dev
- libxml2-dev
- libxslt1-dev
- python-setuptools
- postfix
tags: install
- name: make {{user}} group
group: name={{user}}
- name: make {{user}} user
user: name={{user}} shell=/bin/bash group={{user}} generate_ssh_key=yes
- name: install some python modules to use
#pip: name={{item}} virtualenv=/home/{{user}}/venv
pip: name={{item}}
with_items:
- PyGithub
- name: create /opt/regluit
file: path=/opt/regluit state=directory owner={{user}} group={{user}} mode=0745
- name: git config
command: "{{item}}"
with_items:
- git config --global user.name "Raymond Yee"
- git config --global user.email "rdhyee@gluejar.com"
- name: ssh-keygen
#command: pwd
command: ssh-keygen -b 2048 -t rsa -f /home/{{user}}/.ssh/id_rsa -P ""
sudo: no
args:
creates: /home/{{user}}/.ssh/id_rsa
- name: create deploy key for repo
action: github_deploy_key
sudo: no
args:
github_auth_key: "{{github_auth_key}}"
repo_name: Gluejar/regluit
key_name: localvm
key_path: /home/{{user}}/.ssh/id_rsa.pub
- name: postfix install
raw: DEBIAN_FRONTEND='noninteractive' apt-get install -y -q --force-yes postfix
- name: clone the regluit git repo into /opt/regluit
sudo: no
git: repo=ssh://git@github.com/Gluejar/regluit.git dest=/opt/regluit accept_hostkey=True force=yes version=sysadmin

View File

@ -1,6 +0,0 @@
- name: calculate date
shell: date
register: date_result
- name: show date_result
debug: msg="date_result {{date_result.stdout_lines[0]}}"

View File

@ -1,18 +0,0 @@
- name: mysql setup
raw: debconf-set-selections <<< 'mysql-server-5.5 mysql-server/root_password password {{mysql_root_pw}}'
- raw: debconf-set-selections <<< 'mysql-server-5.5 mysql-server/root_password_again password {{mysql_root_pw}}'
- raw: apt-get -y install mysql-server
- name: Create regluit database
mysql_db: db=regluit state=present encoding=utf8 collation=utf8_bin login_user=root login_password={{mysql_root_pw}}
# GRANT ALL PRIVILEGES ON regluit.* TO 'regluit'@'localhost' WITH GRANT OPTION; (covered?)
- name: Create database user
mysql_user: >
user=regluit
password={{mysql_regluit_pw}}
host=localhost
priv=*.*:ALL
state=present
login_user=root
login_password={{mysql_root_pw}}

View File

@ -1,41 +0,0 @@
#!/usr/bin/env python
from __future__ import print_function
import sh
import argparse
import vagrant
# compute: inventory, private key, user and pass along all the other parameters to ansible-playbook
parser = argparse.ArgumentParser(description='Run the ansible playbook, using vagrant ssh-config parameters')
parser.add_argument('node', metavar='n', type=str, nargs='?',
help='node to run playbook on')
parser.add_argument('playbook_path', metavar='f', type=str, nargs='?',
help='path for the ansible playbook')
(args, unknown) = parser.parse_known_args()
print (args.node, args.playbook_path)
# for now if not multimachine, ignore node parameter
v = vagrant.Vagrant()
if len(v.status()) > 1:
multimachine = True
private_key = v.keyfile(args.node)
user = v.user(args.node)
else:
multimachine = False
private_key = v.keyfile()
user = v.user()
params = ["=".join(p) for p in (
("--private-key", private_key),
("--user", user),
("--inventory-file",".vagrant/provisioners/ansible/inventory")
)] + unknown + [args.playbook_path]
for line in sh.ansible_playbook(*params, _cwd=".", _iter=True):
print(line, end="")

View File

@ -1,4 +0,0 @@
#!/bin/bash
cd /opt/regluit
source ENV/bin/activate
export DJANGO_SETTINGS_MODULE=regluit.settings.just

View File

@ -1,4 +0,0 @@
#!/bin/bash
cd /opt/regluit
source ENV/bin/activate
export DJANGO_SETTINGS_MODULE=regluit.settings.localvm

View File

@ -1,71 +0,0 @@
WSGIPythonHome /opt/regluit/ENV
WSGIPythonPath /opt/regluit/ENV/bin/python
WSGISocketPrefix /opt/regluit
<VirtualHost *:80>
ServerName {% if class == 'prod' %}unglue.it{% else %}{{class}}.unglue.it{% endif %}
ServerAdmin info@ebookfoundation.org
Redirect permanent / {% if class == 'prod' %}https://unglue.it{% else %}https://{{class}}.unglue.it{% endif %}
</VirtualHost>
<VirtualHost _default_:443>
ServerName {% if class == 'prod' %}unglue.it:443{% else %}{{class}}.unglue.it:443{% endif %}
ServerAdmin info@ebookfoundation.org
SSLEngine on
SSLProtocol All -SSLv2 -SSLv3
SSLCertificateFile /etc/ssl/certs/server.crt
SSLCertificateKeyFile /etc/ssl/private/server.key
SSLCertificateChainFile /etc/ssl/certs/STAR_unglue_it.ca-bundle
#SSLCertificateChainFile /etc/ssl/certs/gd_bundle.crt
WSGIDaemonProcess regluit processes=4 threads=4 python-eggs=/tmp/regluit-python-eggs
WSGIScriptAlias / /opt/regluit/deploy/{{class}}.wsgi
# generated using https://mozilla.github.io/server-side-tls/ssl-config-generator/
# intermediate mode
# 2015.03.04 (with Apache v 2.2.22 and OpenSSL 1.0.1 and HSTS enabled)
SSLProtocol all -SSLv2 -SSLv3
SSLCipherSuite ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA
SSLHonorCipherOrder on
# HSTS (mod_headers is required) (15768000 seconds = 6 months)
Header always add Strict-Transport-Security "max-age=15768000"
<Directory /opt/regluit/deploy>
<Files {{class}}.wsgi>
Require all granted
</Files>
</Directory>
<Directory /opt/regluit/static>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
Alias /static /var/www/static
BrowserMatch "MSIE [2-6]" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
# MSIE 7 and newer should be able to use keepalive
BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
ErrorLog "|/usr/bin/cronolog /var/log/apache2/%Y%m%d_error.log"
LogLevel warn
CustomLog "|/usr/bin/cronolog /var/log/apache2/%Y%m%d_access.log" combined
</VirtualHost>

View File

@ -1,6 +0,0 @@
import os
# all the COMMON_KEYS
{% for key in COMMON_KEYS %}
{{key}} = os.environ.get('{{key}}', '{{COMMON_KEYS[key]}}')
{% endfor %}

View File

@ -1,5 +0,0 @@
import os
# all the SECRET_KEYS
{% for key in SECRET_KEYS %}
{{key}} = os.environ.get('{{key}}', '{{SECRET_KEYS[key]}}')
{% endfor %}

View File

@ -1,15 +0,0 @@
#!/usr/bin/env python
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "regluit.settings.just")
os.environ['CELERY_LOADER'] = 'django'
{% for key in SECRET_KEYS %}
os.environ['{{key}}'] = '{{SECRET_KEYS[key]}}'
{% endfor %}
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

View File

@ -1,14 +0,0 @@
#!/usr/bin/env python
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "regluit.settings.please")
os.environ['CELERY_LOADER'] = 'django'
{% for key in SECRET_KEYS %}
os.environ['{{key}}'] = '{{SECRET_KEYS[key]}}'
{% endfor %}
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

View File

@ -1,13 +0,0 @@
#!/usr/bin/env python
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "regluit.settings.prod")
os.environ['CELERY_LOADER'] = 'django'
{% for key in SECRET_KEYS %}
os.environ['{{key}}'] = '{{SECRET_KEYS[key]}}'
{% endfor %}
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

View File

@ -1,357 +0,0 @@
- name: unglueit setup
hosts: please
vars:
user: "{{ ansible_ssh_user }}"
sudo: yes
pre_tasks:
- name: check apt last update
stat: path=/var/cache/apt
register: apt_cache_stat
- name: update apt if needed
apt: update_cache=yes
when: ansible_date_time.epoch|float - apt_cache_stat.stat.mtime > 60*60*12
tasks:
- name: set DNS record for please.unglue.it
route53:
command: create
zone: unglue.it
record: please.unglue.it
type: A
ttl: 60
value: "{{ansible_ssh_host}}"
overwrite: yes
aws_access_key: "{{aws_access_key}}"
aws_secret_key: "{{aws_secret_key}}"
# sudo add repo to get latest version of python 2.7
- name: add-apt-repository ppa:fkrull/deadsnakes-python2.7
apt_repository: repo='ppa:fkrull/deadsnakes-python2.7' state=present update_cache=true
- name: do apt-get update --fix-missing
command: apt-get update --fix-missing
- name: installing dependencies
apt: pkg={{ item }} update_cache=yes state=present
with_items:
- python2.7
- git-core
- apache2
- libapache2-mod-wsgi
- mysql-client
- python-virtualenv
- python-mysqldb
- redis-server
- python-lxml
- python-dev
- libjpeg-dev
- libmysqlclient-dev
- libxml2-dev
- libxslt1-dev
- python-setuptools
- python-dev
- postfix
tags: install
- name: make {{user}} group
group: name={{user}}
- name: make {{user}} user
user: name={{user}} shell=/bin/bash group={{user}} generate_ssh_key=yes
- name: install some python modules to use
#pip: name={{item}} virtualenv=/home/{{user}}/venv
pip: name={{item}}
with_items:
- PyGithub
- name: create /opt/regluit
file: path=/opt/regluit state=directory owner={{user}} group={{user}} mode=0745
- name: git config
command: "{{item}}"
with_items:
- git config --global user.name "Raymond Yee"
- git config --global user.email "rdhyee@gluejar.com"
- name: ssh-keygen
#command: pwd
command: ssh-keygen -b 2048 -t rsa -f /home/{{user}}/.ssh/id_rsa -P ""
sudo: no
args:
creates: /home/{{user}}/.ssh/id_rsa
- name: create deploy key for repo
action: github_deploy_key
sudo: no
args:
github_auth_key: "{{github_auth_key}}"
repo_name: Gluejar/regluit
key_name: vagrant_ansible_test
key_path: /home/{{user}}/.ssh/id_rsa.pub
- name: postfix install
raw: DEBIAN_FRONTEND='noninteractive' apt-get install -y -q --force-yes postfix
- name: clone the regluit git repo into /opt/regluit
sudo: no
git: repo=ssh://git@github.com/Gluejar/regluit.git dest=/opt/regluit accept_hostkey=True force=yes version=sysadmin
# installing mysql
# https://github.com/bennojoy/mysql --> probably the right way
# how do you make use of other people's playbooks in the right way?
# https://stackoverflow.com/a/7740571/7782
- name: mysql setup
raw: debconf-set-selections <<< 'mysql-server-5.5 mysql-server/root_password password {{mysql_root_pw}}'
- raw: debconf-set-selections <<< 'mysql-server-5.5 mysql-server/root_password_again password {{mysql_root_pw}}'
- raw: apt-get -y install mysql-server
- name: Create regluit database
mysql_db: db=regluit state=present encoding=utf8 collation=utf8_bin login_user=root login_password={{mysql_root_pw}}
# GRANT ALL PRIVILEGES ON regluit.* TO 'regluit'@'localhost' WITH GRANT OPTION; (covered?)
- name: Create database user
mysql_user: >
user=regluit
password={{mysql_regluit_pw}}
host=localhost
priv=*.*:ALL
state=present
login_user=root
login_password={{mysql_root_pw}}
# running stuff within a virtualenv
# https://stackoverflow.com/a/20572360
# https://stackoverflow.com/questions/20575084/best-way-to-always-run-ansible-inside-a-virtualenv-on-remote-machines?rq=1
## hard coding of please
#sudo("ln -s /opt/regluit/deploy/please.conf /etc/apache2/sites-available/please")
- name: link please.conf into sites-available
file: src=/opt/regluit/deploy/please.conf dest=/etc/apache2/sites-available/please state=link
#run('pip install -r requirements_versioned.pip')
- name: pip install requests (to see whether in right place)
pip: >
executable=/opt/regluit/ENV/bin/pip
name={{item}}
virtualenv=/opt/regluit/ENV
virtualenv_command=virtualenv
with_items:
- requests
- census
sudo: no
- name: pip requirments
pip: >
executable=/opt/regluit/ENV/bin/pip
requirements=/opt/regluit/requirements_versioned.pip
virtualenv=/opt/regluit/ENV
virtualenv_command=virtualenv
virtualenv_site_packages=yes
sudo: no
#run('echo "/opt/regluit/" > ENV/lib/python2.7/site-packages/regluit.pth')
#run('echo "/opt/" > ENV/lib/python2.7/site-packages/opt.pth')
- name: establish regluit.pth
lineinfile: create=yes dest=/opt/regluit/ENV/lib/python2.7/site-packages/regluit.pth line="/opt/regluit/"
- name: establish opt.pth
lineinfile: create=yes dest=/opt/regluit/ENV/lib/python2.7/site-packages/regluit.pth line="/opt/"
#sudo('mkdir /var/www/static')
#sudo('chown ubuntu:ubuntu /var/www/static')
- name: create /var/www/static
file: path=/var/www/static state=directory owner={{user}} group={{user}} mode=0755
#
#run('django-admin.py syncdb --migrate --noinput --settings regluit.settings.please')
#Run syncdb on the application
- name: django syncdb
django_manage: >
command=syncdb
app_path=/opt/regluit/
settings="regluit.settings.please"
virtualenv=/opt/regluit/ENV
notify:
- restart apache2
- name: django migrations
django_manage: >
command=migrate
app_path=/opt/regluit/
settings="regluit.settings.please"
virtualenv=/opt/regluit/ENV
notify:
- restart apache2
#run('django-admin.py collectstatic --noinput --settings regluit.settings.please')
- name: django collectstatic
django_manage: >
command=collectstatic
app_path=/opt/regluit/
settings="regluit.settings.please"
virtualenv=/opt/regluit/ENV
notify:
- restart apache2
- name: copy STAR_unglue_it.crt
copy: >
src=/Volumes/ryvault1/gluejar/other_keys/unglue_it/STAR_unglue_it.crt
dest=/etc/ssl/certs/server.crt
owner={{user}}
group={{user}}
mode=0644
notify:
- restart apache2
- name: copy server.key
copy: >
src=/Volumes/ryvault1/gluejar/other_keys/unglue_it/server.key
dest=/etc/ssl/private/server.key
owner={{user}}
group={{user}}
mode=0600
notify:
- restart apache2
- name: copy STAR_unglue_it.ca-bundle
copy: >
src=/Volumes/ryvault1/gluejar/other_keys/unglue_it/STAR_unglue_it.ca-bundle
dest=/etc/ssl/certs/STAR_unglue_it.ca-bundle
owner={{user}}
group={{user}}
mode=0600
notify:
- restart apache2
- name: a2dissite default
command: a2dissite default
notify:
- restart apache2
- name: a2ensite please
command: a2ensite please
notify:
- restart apache2
- name: a2enmod ssl rewrite
command: a2enmod ssl rewrite
notify:
- restart apache2
#
#sudo ("/etc/init.d/apache2 restart")
#
- name: turn on ports 22, 80, 443
ufw: rule=allow port={{ item }} proto=tcp
with_items:
- 22
- 80
- 443
- name: enable ufw
ufw: state=enabled
#with cd("/opt/regluit"):
#
# sudo ("yes | adduser --no-create-home celery --disabled-password --disabled-login")
- name: make celery group
group: name=celery
- name: create celery user
user: >
name=celery
createhome=no
group=celery
generate_ssh_key=no
# sudo ("cp deploy/celeryd /etc/init.d/celeryd")
# sudo ("chmod 755 /etc/init.d/celeryd")
- name: copy deploy/celeryd
command: cp /opt/regluit/deploy/celeryd /etc/init.d/celeryd
- name: set mode on /etc/init.d/celeryd
file: path=/etc/init.d/celeryd mode=0755
# sudo ("cp deploy/celeryd.conf /etc/default/celeryd")
- name: copy deploy/celeryd_please.conf
command: cp /opt/regluit/deploy/celeryd_please.conf /etc/default/celeryd
- name: set mode on /etc/default/celeryd
file: path=/etc/default/celeryd mode=0644
# sudo ("mkdir /var/log/celery")
- name: make /var/log/celery
file: path=/var/log/celery state=directory owner=celery group=celery mode=0755
# sudo ("mkdir /var/run/celery")
# sudo ("chown celery:celery /var/log/celery /var/run/celery")
- name: make /var/run/celery
file: path=/var/run/celery state=directory owner=celery group=celery mode=0755
# sudo ("/etc/init.d/celeryd start")
- name: start celeryd
command: /etc/init.d/celeryd start
# sudo ("cp deploy/celerybeat /etc/init.d/celerybeat")
# sudo ("chmod 755 /etc/init.d/celerybeat")
# https://stackoverflow.com/questions/24162996/how-to-move-rename-a-file-using-an-ansible-task-on-a-remote-system
- name: copy deploy/celerybeat
command: cp /opt/regluit/deploy/celerybeat /etc/init.d/celerybeat
- name: set mode on /etc/init.d/celerybeat
file: path=/etc/init.d/celerybeat mode=0755
# sudo ("cp deploy/celerybeat.conf /etc/default/celerybeat")
- name: copy deploy/celerybeat_please.conf
command: cp /opt/regluit/deploy/celerybeat_please.conf /etc/default/celerybeat
- name: set mode on /etc/default/celerybeat
file: path=/etc/default/celerybeat mode=0755
# sudo ("mkdir /var/log/celerybeat")
# sudo ("chown celery:celery /var/log/celerybeat")
- name: make /var/log/celerybeat
file: path=/var/log/celerybeat state=directory owner=celery group=celery mode=0755
# sudo ("/etc/init.d/celerybeat start")
- name: start celerybeat
command: /etc/init.d/celerybeat start
# run data loading script
- name: run data loading script
script: load_data_please.sh
# set up crontab
- name: crontab for please
command: crontab /opt/regluit/deploy/crontab_please.txt
handlers:
- name: restart apache2
service: name=apache2 state=restarted