Commit 287a26cc by Feanil Patel

Make the retire-hosts job be compatible with

systemd.

- Systemctl doesn't have a no-wait parameter.
- Shell instead of command to send logs to s3, command was failing on
  '||'
parent da578d17
...@@ -11,9 +11,11 @@ ...@@ -11,9 +11,11 @@
- name: Stop all services - name: Stop all services
hosts: "{{TARGET}}" hosts: "{{TARGET}}"
become: True become: True
gather_facts: False gather_facts: True
vars: pre_tasks:
STOP_ALL_EDX_SERVICES_EXTRA_ARGS: "--no-wait" - set_fact:
STOP_ALL_EDX_SERVICES_EXTRA_ARGS: "--no-wait"
when: ansible_distribution_release == 'precise' or ansible_distribution_release == 'trusty'
roles: roles:
- stop_all_edx_services - stop_all_edx_services
...@@ -23,7 +25,7 @@ ...@@ -23,7 +25,7 @@
gather_facts: False gather_facts: False
tasks: tasks:
- name: Terminate existing object store log sync - name: Terminate existing object store log sync
command: /usr/bin/pkill send-logs-to-object-store || true shell: /usr/bin/pkill send-logs-to-object-store || true
- name: "Ensure send-logs-to-object-store script is in the logrotate file" - name: "Ensure send-logs-to-object-store script is in the logrotate file"
shell: grep send-logs-to-object-store /etc/logrotate.d/hourly/tracking.log shell: grep send-logs-to-object-store /etc/logrotate.d/hourly/tracking.log
# We only force a rotation of edx logs. # We only force a rotation of edx logs.
......
...@@ -81,10 +81,10 @@ ...@@ -81,10 +81,10 @@
- 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 }}"
when: ansible_distribution_release == 'precise'
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:
......
...@@ -62,5 +62,13 @@ ...@@ -62,5 +62,13 @@
notify: notify:
- stop mongodb - stop mongodb
- name: Stop supervisor systemd
stat:
path: /etc/systemd/system/supervisor.service
register: stat_out
changed_when: stat_out is defined and stat_out.stat.exists
notify:
- stop supervisor
- shell: "true" - shell: "true"
notify: kill processes by user notify: kill processes by user
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