Commit a5420771 by e0d

minos role and play updates

parent 7edc113c
......@@ -5,6 +5,7 @@
vars:
roles:
- aws
- minos
- role: nginx
nginx_sites:
- lms
......
......@@ -4,6 +4,7 @@
gather_facts: True
roles:
- aws
- minos
- role: edxapp
celery_worker: True
- role: datadog
......@@ -12,3 +13,5 @@
when: COMMON_ENABLE_SPLUNKFORWARDER
- role: newrelic
when: COMMON_ENABLE_NEWRELIC
\ No newline at end of file
---
#
# edX Configuration
#
# github: https://github.com/edx/configuration
# wiki: https://github.com/edx/configuration/wiki
# code style: https://github.com/edx/configuration/wiki/Ansible-Coding-Conventions
# license: https://github.com/edx/configuration/blob/master/LICENSE.TXT
#
##
# Defaults for role minos
#
MINOS_GIT_IDENTITY: !!null
INSTALL_MINOS: false
#
# vars are namespace with the module name.
#
minos_role_name: minos
minos_service_name: "{{ minos_role_name }}"
minos_data_dir: "{{ COMMON_DATA_DIR }}/minos"
minos_app_dir: "{{ COMMON_APP_DIR }}/minos"
minos_venv_dir: "{{ minos_app_dir }}/venvs/"
minos_log_dir: "{{ COMMON_LOG_DIR }}/minos"
minos_cfg_file: "{{ COMMON_CFG_DIR }}/minos/minos.yml"
minos_voter_cfg: "{{ COMMON_CFG_DIR }}/minos/conf.d/"
minos_git_ssh: "/tmp/git.sh"
minos_git_identity: "{{ minos_app_dir }}/minos-git-identity"
minos_edx_server_tools_repo: "git@github.com/edx-ops/edx-minos.git"
minos_edx_server_tools_version: "release"
minos_requirement: "git+ssh://{{ minos_edx_server_tools_repo }}@{{ minos_edx_server_tools_version }}#egg=edx_server_tools"
#
# OS packages
#
minos_debian_pkgs: []
minos_redhat_pkgs: []
---
#
# edX Configuration
#
# github: https://github.com/edx/configuration
# wiki: https://github.com/edx/configuration/wiki
# code style: https://github.com/edx/configuration/wiki/Ansible-Coding-Conventions
# license: https://github.com/edx/configuration/blob/master/LICENSE.TXT
#
#
#
# Handlers for role minos
#
# Overview:
#
#
- name: notify me
debug: msg="stub handler"
---
#
# edX Configuration
#
# github: https://github.com/edx/configuration
# wiki: https://github.com/edx/configuration/wiki
# code style: https://github.com/edx/configuration/wiki/Ansible-Coding-Conventions
# license: https://github.com/edx/configuration/blob/master/LICENSE.TXT
#
##
# Role includes for role minos
#
# Example:
#
# dependencies:
# - {
# role: my_role
# my_role_var0: "foo"
# my_role_var1: "bar"
# }
dependencies:
- role: edx_service
edx_role_name: "{{ minos_role_name }}"
edx_service_name: "{{ minos_service_name }}"
\ No newline at end of file
---
#
# edX Configuration
#
# github: https://github.com/edx/configuration
# wiki: https://github.com/edx/configuration/wiki
# code style: https://github.com/edx/configuration/wiki/Ansible-Coding-Conventions
# license: https://github.com/edx/configuration/blob/master/LICENSE.TXT
#
#
#
# Tasks for role minos
#
# Overview:
#
#
# Dependencies:
#
#
# Example play:
#
#
- name: gather ec2 facts
action: ec2_facts
- name: create minos config directory
file: >
path={{ minos_voter_cfg }}
state=directory
owner=root
group=root
mode=0755
when: INSTALL_MINOS
- name: create minos config
template: >
dest={{ minos_cfg_file }}
src=edx/etc/minos/minos.yml.j2
mode=0755 owner=root group=root
when: INSTALL_MINOS
- name: create minos voters configs
template: >
dest={{ minos_voter_cfg }}/{{ item }}.yml
src=edx/etc/minos/conf.d/{{ item }}.yml.j2
mode=0755 owner=root group=root
with_items:
- "BellwetherVoter"
- "ProccessQuienscenceVoterCelery"
- "ProccessQuienscenceVoterGunicorn"
- "TrackingLogVoter"
when: INSTALL_MINOS
# Optional auth for git
- name: create ssh script for git (not authenticated)
template: >
src=tmp/git-identity.sh.j2 dest={{ minos_git_ssh }}
mode=750
when:
- INSTALL_MINOS
- MINOS_GIT_IDENTITY is not defined
- name: create ssh script for git (authenticated)
template: >
src=tmp/git-identity.sh.j2 dest={{ minos_git_ssh }}
mode=750
when:
- INSTALL_MINOS
- MINOS_GIT_IDENTITY is defined
- name: install read-only ssh key
copy: >
content="{{ COMMON_GIT_IDENTITY }}" dest="{{ minos_git_identity }}"
force=yes mode=0600
when: INSTALL_MINOS
- name : install python custom-requirements
pip: >
name="{{ item }}"
virtualenv="{{ minos_venv_dir }}"
state=present
extra_args="--exists-action w"
environment:
GIT_SSH: "{{ minos_git_ssh }}"
with_items:
- "{{ minos_requirement }}"
when: INSTALL_MINOS
\ No newline at end of file
BellwetherVoter:
config:
\ No newline at end of file
ProccessQuiescenceVoter:
config:
process_name: 'celery'
\ No newline at end of file
ProccessQuiescenceVoter:
config:
process_name: 'gunicorn'
\ No newline at end of file
ProccessQuiescenceVoter:
config:
process_name: 'celery'
\ No newline at end of file
ProccessQuiescenceVoter:
config:
process_name: 'gunicorn'
\ No newline at end of file
TrackingLogVoter:
config:
aws_profile: !!null
local_directory: '{{ COMMON_LOG_DIR }}/tracking'
s3_bucket: 'edx-{{ COMMON_ENVIRONMENT }}-{{ COMMON_DEPLOYMENT }}'
bucket_path: 'logs/tracking/{{ ansible_ec2_security_groups }}/{{ ansible_ec2_instance_id }}-{{ ansible_ec2_local_ipv4 }}'
---
aws_profile: !!null
s3_bucket: 'edx-{{ COMMON_ENVIRONMENT }}-{{ COMMON_DEPLOYMENT }}'
bucket_path: 'lifecycle/minos'
voter_conf_d: '{{ minos_voter_cfg }}'
#!/bin/sh
exec /usr/bin/ssh -o StrictHostKeyChecking=no {% if COMMON_GIT_IDENTITY %}-i {{ minos_git_identity }}{% endif %} "$@"
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