From 7c194663e63e454bff06dc2d83839c80c6566962 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Thu, 15 Jun 2017 11:57:06 -0400 Subject: [PATCH] Systemd continued; start apache after eg start Signed-off-by: Bill Erickson --- evergreen/apache.yml | 17 ++++++----------- extras/start.yml | 17 +++++++++++++++-- settings.yml | 6 ++++-- 3 files changed, 25 insertions(+), 15 deletions(-) diff --git a/evergreen/apache.yml b/evergreen/apache.yml index 338e14621..45b864e63 100644 --- a/evergreen/apache.yml +++ b/evergreen/apache.yml @@ -1,7 +1,11 @@ # Apache -- name: Stop apache2 +- name: Stop Apache2 become: true service: name=apache2 state=stopped +- name: Stop Apache2 Websockets + become: true +# TODO: Use ansible 2.2 service: use=systemd + shell: systemctl stop apache2ctl-websockets - name: Setup eg.conf become: true copy: @@ -68,13 +72,4 @@ dest: /etc/apache2/apache2.conf regexp: 'KeepAliveTimeout .*' replace: 'KeepAliveTimeout 1' -- name: Restarting Apache - become: true - service: name=apache2 state=started -- name: Restarting Websockets - become: true -# service name=apache2ctl-websockets state=restarted FAILS -# ansible 2.2 supports a use=systemd flag that would likley resolve -# this, since this works: systemctl restart apache2-websockets - shell: apache2ctl-websockets restart - +# Leave Apache's stopped until Evergreen services are started. diff --git a/extras/start.yml b/extras/start.yml index 9929658bf..74913b951 100644 --- a/extras/start.yml +++ b/extras/start.yml @@ -4,6 +4,12 @@ environment: PATH: "{{ansible_env.PATH}}:{{eg_install_path}}/bin" shell: osrf_control --localhost --restart-all + when: not use_service_files +- name: Starting Services (systemd) + become: true +# NOTE: ansible 2.2 adds a service: use=systemd flag + shell: systemctl restart opensrf.service + when: use_service_files - name: Giving Services Time To Start... pause: seconds=10 - name: Running Autogen @@ -12,6 +18,13 @@ environment: PATH: "{{ansible_env.PATH}}:{{eg_install_path}}/bin" shell: autogen.sh -- name: Reloading Apache +- name: Restarting Apache + become: true + service: name=apache2 state=restarted +- name: Restarting Websockets become: true - service: name=apache2 state=reloaded +# service name=apache2ctl-websockets state=restarted FAILS +# ansible 2.2 supports a use=systemd flag that would likley resolve +# this, since this works: systemctl restart apache2-websockets + shell: systemctl restart apache2-websockets + diff --git a/settings.yml b/settings.yml index 70db80fb1..90e401057 100644 --- a/settings.yml +++ b/settings.yml @@ -39,8 +39,10 @@ use_rsyslog: true # Install and configure NGINX proxy use_nginx: true -# Install systemd service files and use them to stop/start services -use_service_files: true +# Install systemd service files and use them to stop/start services. +# Disabled by default since EG documentation generally refers to +# the osrf_control script instead. +use_service_files: false # Start Evergreen services when the install is complete. start_services: true -- 2.11.0