Commit 55bef11e by Feanil Patel

Merge pull request #1177 from edx/feanil/alton_redis

Feanil/alton redis
parents 696fb332 79481d6c
......@@ -22,7 +22,7 @@ ALTON_V2_TOKEN: 'HIPCHAT_V2_TOKEN'
ALTON_ROOMS: 'Hammer'
ALTON_NAME: 'Alton W. Daemon'
ALTON_HANDLE: 'alton'
ALTON_REDIS_URL: 'redis://fakeuser:redispassword@redis.url:port'
ALTON_REDIS_URL: 'redis://fakeuser:redispassword@localhost:6379'
ALTON_HTTPSERVER_PORT: '8081'
alton_role_name: alton
......@@ -35,7 +35,7 @@ alton_venv_dir: "{{ alton_venvs_dir }}/alton"
alton_venv_bin: "{{ alton_venv_dir }}/bin"
alton_source_repo: "https://github.com/edx/alton.git"
alton_version: "HEAD"
alton_version: "feanil/inspect_aws"
alton_requirements_file: "{{ alton_code_dir }}/requirements.txt"
alton_supervisor_wrapper: "{{ alton_app_dir }}/alton-supervisor.sh"
......
......@@ -21,3 +21,4 @@
dependencies:
- supervisor
- redis
......@@ -3,6 +3,7 @@
dest="{{ alton_code_dir }}" repo="{{ alton_source_repo }}"
version="{{ alton_version }}" accept_hostkey=yes
sudo_user: "{{ alton_user }}"
notify: restart alton
- name: install the requirements
pip: >
......@@ -11,6 +12,7 @@
state=present
extra_args="-i {{ COMMON_PYPI_MIRROR_URL }}"
sudo_user: "{{ alton_user }}"
notify: restart alton
- name: create the supervisor wrapper
template: >
......
---
#
# 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 redis
#
REDIS_PASSWORD: !!null
REDIS_BIND_IP: 127.0.0.1
REDIS_PERSISTENCE_DIR: "/var/lib/redis"
REDIS_MEMORY_LIMIT: "512mb"
REDIS_MAX_MEMORY_POLICY: "noeviction"
#
# vars are namespace with the module name.
#
redis_role_name: redis
redis_ppa: "ppa:rwky/redis"
redis_user: redis
redis_group: redis
#
# OS packages
#
redis_debian_pkgs:
- "redis-server=2:2.8.10-rwky1~precise"
redis_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 redis
#
# Overview:
#
#
- name: reload redis
service: name=redis-server state=restarted
---
#
# 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 redis
#
# Example:
#
# dependencies:
# - {
# role: my_role
# my_role_var0: "foo"
# my_role_var1: "bar"
# }
dependencies:
- common
---
#
# 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 redis
#
# Overview:
#
#
# Dependencies:
#
#
# Example play:
#
#
- name: add the redis ppa
apt_repository: repo="{{ redis_ppa }}"
- name: install redis system packages
apt: pkg={{ item }} install_recommends=yes state=present
with_items: redis_debian_pkgs
notify: reload redis
- name: update redis configuration
template: >
src=etc/redis/redis.conf.j2
dest=/etc/redis/redis.conf
owner=root
group={{ redis_group }}
mode=640
notify: reload redis
......@@ -23,6 +23,11 @@ Vagrant.configure("2") do |config|
# point Vagrant at the location of your playbook you want to run
ansible.playbook = "../../../playbooks/run_role.yml"
ansible.verbose = "extra"
ansible.extra_vars = { role: ENV['VAGRANT_ANSIBLE_ROLE'] }
ansible.extra_vars = {
role: ENV['VAGRANT_ANSIBLE_ROLE']
}
if ENV['VAGRANT_ANSIBLE_VARS_FILE']
ansible.raw_arguments = [ '-e@' + ENV['VAGRANT_ANSIBLE_VARS_FILE']]
end
end
end
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