
Optionally run tox on each git repo (-t) and package resultant venv into a tarball on success (-p) tarball filename includes the short-sha1 of the repo. If tarball is created, screen is not run. if the -d option is given the cmdline incantation for kicking off the ansible deploy playbook will be provided. Later, this could be automated. A mysql role playbook is also included for single node db. stv3-api role is also included. Change-Id: Ib9f97a0035c228d4a163d7794ab7ce60043d572b
26 lines
995 B
YAML
26 lines
995 B
YAML
## Main task file for stv3-db role
|
|
---
|
|
- name: install mysql-server
|
|
apt: name=mysql-server update_cache=yes
|
|
|
|
- name: install python mysql lib
|
|
apt: name=python-mysqldb
|
|
|
|
- name: ensure mysql is running and starts on boot
|
|
service: name=mysql state=started enabled=true
|
|
# Need to do this for idempotency, see
|
|
# http://ansible.cc/docs/modules.html#mysql-user
|
|
- name: update mysql root password for all root accounts
|
|
mysql_user: name=root host=localhost password={{ root_db_password }}
|
|
# tricky ... could have already been change from a previous run?
|
|
ignore_errors: yes
|
|
|
|
- name: copy .my.cnf file with root password credentials
|
|
template: src=my.cnf.j2 dest=/root/.my.cnf owner=root mode=0600
|
|
|
|
- mysql_db: name=winchester state=present login_user=root login_password={{ root_db_password }}
|
|
|
|
- name: create winchester db user
|
|
mysql_user: name=winchester host=localhost password={{ winchester_db_password }} priv=*.*:ALL \
|
|
login_user=root login_password={{ root_db_password}}
|