Commit 0d4b1063 by Kevin Falcone

Merge pull request #2360 from edx/jibsheet/tag-reporting-role

Refactoring and cleanups that resulted from DEVOPS-3068
parents d4516917 1a41effe
...@@ -35,9 +35,12 @@ ad_hoc_reporting_debian_pkgs: ...@@ -35,9 +35,12 @@ ad_hoc_reporting_debian_pkgs:
# includes mysqldump and others # includes mysqldump and others
- mysql-client - mysql-client
- libmysqlclient-dev - libmysqlclient-dev
# for connecting to mongo # mongo client is installed as a separate step so it comes from the 10gen repo
- mongodb-clients
ad_hoc_reporting_pip_pkgs: ad_hoc_reporting_pip_pkgs:
# for running ansible mysql # for running ansible mysql
- mysql-python - mysql-python
MONGODB_APT_KEY: "http://docs.mongodb.org/10gen-gpg-key.asc"
MONGODB_REPO: "deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen"
mongo_version: 3.0.7
...@@ -21,28 +21,59 @@ ...@@ -21,28 +21,59 @@
# - user # - user
- name: install system packages - name: install system packages
apt: > apt:
pkg={{ item }} pkg: "{{ item }}"
state=present state: present
with_items: ad_hoc_reporting_debian_pkgs with_items: ad_hoc_reporting_debian_pkgs
tags:
- install:system-requirements
- name: add the mongodb signing key
apt_key:
id: 7F0CEB10
url: "{{ MONGODB_APT_KEY }}"
state: present
tags:
- install:system-requirements
- name: add the mongodb repo to the sources list
apt_repository:
repo: "{{ MONGODB_REPO }}"
state: present
tags:
- install:system-requirements
- name: install mongo shell
apt:
pkg: mongodb-org-shell={{ mongo_version }}
state: present
install_recommends: yes
force: yes
update_cache: yes
tags:
- install:system-requirements
- name: install python packages - name: install python packages
pip: > pip:
name="{{ item }}" state=present name: "{{ item }}"
extra_args="-i {{ COMMON_PYPI_MIRROR_URL }}" state: present
extra_args: "-i {{ COMMON_PYPI_MIRROR_URL }}"
with_items: ad_hoc_reporting_pip_pkgs with_items: ad_hoc_reporting_pip_pkgs
tags:
- install:app-requirements
- name: create directories - name: create directories
file: > file:
path="{{ item }}" path: "{{ item }}"
state=directory state: directory
owner=root owner: root
group=root group: root
mode=0755 mode: 0755
with_items: with_items:
- /edx/bin - /edx/bin
tags: tags:
- scripts - scripts
- install:base
#These templates rely on there being a global #These templates rely on there being a global
# read_only mysql user, you must override the default # read_only mysql user, you must override the default
...@@ -50,13 +81,17 @@ ...@@ -50,13 +81,17 @@
#Also, all of the *_REPLICA_DB_HOST vars are only defined #Also, all of the *_REPLICA_DB_HOST vars are only defined
# in secure config files. # in secure config files.
- name: install common mysql replica scripts - name: install common mysql replica scripts
template: > template:
src=edx/bin/mysql.sh.j2 src: edx/bin/mysql.sh.j2
dest=/edx/bin/{{ COMMON_ENVIRONMENT }}-{{ COMMON_DEPLOYMENT }}-{{ item.script_name }} dest: /edx/bin/{{ COMMON_ENVIRONMENT }}-{{ COMMON_DEPLOYMENT }}-{{ item.script_name }}
mode=0755 owner=root group=root mode: 0755
owner: root
group: root
when: COMMON_MYSQL_READ_ONLY_PASS is defined and item.depends_on when: COMMON_MYSQL_READ_ONLY_PASS is defined and item.depends_on
tags: tags:
- scripts - scripts
- scripts:mysql
- install:code
with_items: with_items:
- db_host: "{{ EDXAPP_MYSQL_REPLICA_HOST }}" - db_host: "{{ EDXAPP_MYSQL_REPLICA_HOST }}"
db_name: "{{ EDXAPP_MYSQL_DB_NAME }}" db_name: "{{ EDXAPP_MYSQL_DB_NAME }}"
...@@ -93,10 +128,12 @@ ...@@ -93,10 +128,12 @@
# read_only mongo user, you must override the default # read_only mongo user, you must override the default
# in order for these templates to be written out # in order for these templates to be written out
- name: install mongodb replica scripts - name: install mongodb replica scripts
template: > template:
src=edx/bin/mongo.sh.j2 src: edx/bin/mongo.sh.j2
dest=/edx/bin/{{ COMMON_ENVIRONMENT }}-{{ COMMON_DEPLOYMENT }}-{{ item.script_name }} dest: /edx/bin/{{ COMMON_ENVIRONMENT }}-{{ COMMON_DEPLOYMENT }}-{{ item.script_name }}
mode=0755 owner=root group=root mode: 0755
owner: root
group: root
with_items: with_items:
- db_hosts: "{{ EDXAPP_MONGO_HOSTS }}" - db_hosts: "{{ EDXAPP_MONGO_HOSTS }}"
db_name: "{{ EDXAPP_MONGO_DB_NAME }}" db_name: "{{ EDXAPP_MONGO_DB_NAME }}"
...@@ -108,4 +145,6 @@ ...@@ -108,4 +145,6 @@
script_name: forum-mongo.sh script_name: forum-mongo.sh
when: COMMON_MONGO_READ_ONLY_PASS is defined when: COMMON_MONGO_READ_ONLY_PASS is defined
tags: tags:
- scripts - scripts
\ No newline at end of file - scripts:mongo
- install:code
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment