Commit ebae3a74 by e0d Committed by Kevin Falcone

Refactoring supervisor for 12.04 through 16.04 and docker

parent 2227e664
...@@ -77,13 +77,15 @@ ...@@ -77,13 +77,15 @@
- install:base - install:base
# adding chris-lea nodejs repo # adding chris-lea nodejs repo
# TODO: 16.04
- name: add ppas for current versions of nodejs - name: add ppas for current versions of nodejs
apt_repository: apt_repository:
repo: "{{ edxapp_chrislea_ppa }}" repo: "{{ edxapp_chrislea_ppa }}"
tags: tags:
- install - install
- install:base - install:base
when: ansible_distribution_release == 'precise'
- name: install system packages on which LMS and CMS rely - name: install system packages on which LMS and CMS rely
apt: apt:
name: "{{ item }}" name: "{{ item }}"
......
...@@ -115,13 +115,14 @@ ...@@ -115,13 +115,14 @@
- install - install
- install:base - install:base
# 12.04, 14.04, etc.
- name: Create supervisor upstart job - name: Create supervisor upstart job
template: template:
src: "etc/init/supervisor-upstart.conf.j2" src: "etc/init/supervisor-upstart.conf.j2"
dest: "/etc/init/{{ supervisor_service }}.conf" dest: "/etc/init/{{ supervisor_service }}.conf"
owner: root owner: root
group: root group: root
when: ansible_distribution == 'Ubuntu' and ansible_distribution_major_version|int < 16 when: ansible_distribution_release == 'precise' or ansible_distribution_release == 'trusty'
tags: tags:
- install - install
- install:base - install:base
...@@ -129,6 +130,8 @@ ...@@ -129,6 +130,8 @@
# This script is aws specific and looks up instances # This script is aws specific and looks up instances
# tags and enables services based on the 'services' tag # tags and enables services based on the 'services' tag
# on instance startup. # on instance startup.
# TODO: 16.04 this cannot simply be dropped, enabling needs to be moved somewhere
# also should not be here, should be in the aws role if it's aws specific
- name: create pre_supervisor upstart job - name: create pre_supervisor upstart job
template: template:
src: "etc/init/pre_supervisor.conf.j2" src: "etc/init/pre_supervisor.conf.j2"
...@@ -137,7 +140,7 @@ ...@@ -137,7 +140,7 @@
group: root group: root
when: > when: >
supervisor_service == "supervisor" and disable_edx_services and not devstack supervisor_service == "supervisor" and disable_edx_services and not devstack
and ansible_distribution == 'Ubuntu' and ansible_distribution_major_version|int < 16 and (ansible_distribution_release == 'precise' or ansible_distribution_release == 'trusty')
tags: tags:
- to-remove - to-remove
- aws-specfic - aws-specfic
...@@ -149,7 +152,7 @@ ...@@ -149,7 +152,7 @@
dest: "/etc/systemd/system/{{ supervisor_service }}.service" dest: "/etc/systemd/system/{{ supervisor_service }}.service"
owner: root owner: root
group: root group: root
when: not (ansible_distribution == 'Ubuntu' and ansible_distribution_major_version|int < 16) when: ansible_distribution_release == 'xenial'
tags: tags:
- install - install
- install:base - install:base
...@@ -213,11 +216,21 @@ ...@@ -213,11 +216,21 @@
- install - install
- install:configuration - install:configuration
# This command and the subsequent check in the when condition are related
# to this bug: https://github.com/ansible/ansible-modules-core/issues/593
- name: Are we in a Docker container
shell: echo $(egrep -q 'docker' /proc/self/cgroup && echo 'yes' || echo 'no')
ignore_errors: yes
register: docker_container
tags:
- install
- install:base
- name: Enable supervisor to start on boot - name: Enable supervisor to start on boot
service: service:
name: "{{ supervisor_service }}.service" name: "{{ supervisor_service }}.service"
enabled: yes enabled: yes
when: not (ansible_distribution == 'Ubuntu' and ansible_distribution_major_version|int < 16) when: ansible_distribution_release == 'xenial' and docker_container.stdout != 'yes'
tags: tags:
- install - install
- install:base - install:base
......
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