From 7321e2f2d2bf383bd7f0d768118d20cb959074bf Mon Sep 17 00:00:00 2001 From: Mark Hamzy Date: Sun, 5 Feb 2017 08:12:13 -0600 Subject: [PATCH] Add start molteniron server --- tasks/molteniron_install.yml | 31 +++++++++++++++++++++++++++++++ vars/ubuntu-16.04.yml | 7 +++++++ 2 files changed, 38 insertions(+) diff --git a/tasks/molteniron_install.yml b/tasks/molteniron_install.yml index c641189..ffc23ff 100644 --- a/tasks/molteniron_install.yml +++ b/tasks/molteniron_install.yml @@ -100,3 +100,34 @@ password: openstack_citest priv: "*.*:ALL,GRANT" state: present + +- name: grab the contents of {{ moltenirond_pid_file }} + shell: cat {{ moltenirond_pid_file }} + ignore_errors: true + register: moltenirond_pid + +- debug: + var: moltenirond_pid + +- name: check to see if molteniron is running + shell: test -f {{ moltenirond_pid_file }}; + if [ $? -eq 0 ]; then echo RUNNING; else echo STOPPED; fi + register: moltenirond_pid_status + +- debug: + var: moltenirond_pid_status + +- name: start molteniron server + shell: | + . {{ molteniron_bin }}/activate + moltenirond-helper --conf-dir={{ molteniron_conf_dir }} start + when: moltenirond_pid_status.stdout == "STOPPED" + +- name: run the molteniron status command + shell: | + . {{ molteniron_bin }}/activate + molteniron --conf-dir={{ molteniron_conf_dir }} --output=result status --type=human + register: molteniron_result_status + +- debug: + var: molteniron_result_status diff --git a/vars/ubuntu-16.04.yml b/vars/ubuntu-16.04.yml index 9fb6bbd..833e64e 100644 --- a/vars/ubuntu-16.04.yml +++ b/vars/ubuntu-16.04.yml @@ -35,3 +35,10 @@ molteniron_developer_mode_distro_packages: - python2.7 - python3.5 - mysql-server + +moltenirond_pid_file: "/var/run/moltenirond.pid" + +molteniron_source_dir: "/home/ubuntu/molteniron" + +# molteniron_venv_tag instead? +molteniron_conf_dir: "/openstack/venvs/molteniron-{{ openstack_release }}/etc/molteniron"