Make sure the ARA systemd service is not running with apache

apache with mod_wsgi takes care of starting the app.
If the role is first ran with the defaults, the ara systemd service
will be running.
If we re-run the role and choose an apache deployment, we need to make
sure we're disabling it.

What this boils down to -- let's always set up the systemd service
but start it or disable it according to what we need to deploy.

Change-Id: I8fceed417d766a28564ad88a972de4f38c1b44ac
This commit is contained in:
David Moreau Simard 2018-05-09 18:05:58 -04:00
parent b526ed4c9a
commit 49bd5e1afa
5 changed files with 32 additions and 24 deletions

View File

@ -40,4 +40,4 @@
name: ara
state: restarted
when: ara.deployment.server == 'embedded' or
ara.deployment.server == 'nginx' and ara.deployment.type == 'embedded_proxy'
ara.deployment.server == 'nginx' and ara.deployment.type == 'embedded_proxy'

View File

@ -16,6 +16,14 @@
# You should have received a copy of the GNU General Public License
# along with ARA. If not, see <http://www.gnu.org/licenses/>.
- name: Ensure the embedded server service is not started and is disabled
become: true
systemd:
name: ara
state: stopped
enabled: no
masked: yes
- name: Install required dependencies for mod_wsgi
become: true
package:

View File

@ -16,28 +16,6 @@
# You should have received a copy of the GNU General Public License
# along with ARA. If not, see <http://www.gnu.org/licenses/>.
- name: Get the location of ara-manage
command: which ara-manage
environment:
PATH: "{{ path_with_virtualenv | default(omit) }}"
register: ara_manage
changed_when: false
- name: Copy systemd service template
become: true
template:
src: templates/ara_service.conf.j2
dest: /etc/systemd/system/ara.service
owner: root
group: root
mode: 0644
notify:
- reload systemctl daemon
- restart ara
- name: Flush handlers
meta: flush_handlers
- name: Ensure the embedded server service is started and enabled
become: true
systemd:

View File

@ -89,6 +89,28 @@
src: logrotate.conf.j2
dest: /etc/logrotate.d/ara
- name: Get the location of ara-manage
command: which ara-manage
environment:
PATH: "{{ path_with_virtualenv | default(omit) }}"
register: ara_manage
changed_when: false
- name: Copy systemd service template
become: true
template:
src: templates/ara_service.conf.j2
dest: /etc/systemd/system/ara.service
owner: root
group: root
mode: 0644
notify:
- reload systemctl daemon
- restart ara
- name: Flush handlers
meta: flush_handlers
- name: Include web server configuration
include_tasks: "{{ ara.deployment.server }}/{{ ara.deployment.type }}.yml"

View File

@ -28,7 +28,7 @@
set_fact:
ara: "{{ ara | combine(override, recursive=true) }}"
- name: Install the embedded server service
- name: Ensure the embedded server service is running
include_tasks: ../embedded/standalone.yml
- name: Set selinux boolean to allow nginx to reverse proxy