summaryrefslogtreecommitdiff
path: root/salt/openbook/ansible/files/openbook.yaml
diff options
context:
space:
mode:
Diffstat (limited to 'salt/openbook/ansible/files/openbook.yaml')
-rw-r--r--salt/openbook/ansible/files/openbook.yaml44
1 files changed, 23 insertions, 21 deletions
diff --git a/salt/openbook/ansible/files/openbook.yaml b/salt/openbook/ansible/files/openbook.yaml
index a2d9688..1614194 100644
--- a/salt/openbook/ansible/files/openbook.yaml
+++ b/salt/openbook/ansible/files/openbook.yaml
@@ -117,7 +117,8 @@
owner: root
group: root
with_items:
- - { src: ci/{{ pillar["ci"]["files"]["openbook_ubuntu"]["path"] }}/{{ pillar["ci"]["files"]["openbook_ubuntu"]["name"] }}, dest: /etc/init.d/openbook, mode: "0755" }
+ - { src: ci/{{ pillar["ci"]["files"]["openbook_ubuntu_start"]["path"] }}/{{ pillar["ci"]["files"]["openbook_ubuntu_start"]["name"] }}, dest: /etc/init.d/openbook, mode: "0755" }
+ - { src: ci/{{ pillar["ci"]["files"]["openbook_ubuntu_debug"]["path"] }}/{{ pillar["ci"]["files"]["openbook_ubuntu_debug"]["name"] }}, dest: /etc/init.d/openbook-debug, mode: "0755" }
when: ansible_distribution == "Ubuntu"
- name: "Create Openbook init script: Redhat"
@@ -128,7 +129,8 @@
owner: root
group: root
with_items:
- - { src: ci/{{ pillar["ci"]["files"]["openbook_redhat"]["path"] }}/{{ pillar["ci"]["files"]["openbook_redhat"]["name"] }}, dest: /etc/init.d/openbook, mode: "0755" }
+ - { src: ci/{{ pillar["ci"]["files"]["openbook_redhat_start"]["path"] }}/{{ pillar["ci"]["files"]["openbook_redhat_start"]["name"] }}, dest: /etc/init.d/openbook, mode: "0755" }
+ - { src: ci/{{ pillar["ci"]["files"]["openbook_redhat_debug"]["path"] }}/{{ pillar["ci"]["files"]["openbook_redhat_debug"]["name"] }}, dest: /etc/init.d/openbook-debug, mode: "0755" }
when: ansible_distribution == "RedHat" or ansible_distribution == "CentOS"
- name: "Create Openbook init script: Gentoo"
@@ -139,12 +141,25 @@
owner: root
group: root
with_items:
- - { src: ci/{{ pillar["ci"]["files"]["openbook_gentoo"]["path"] }}/{{ pillar["ci"]["files"]["openbook_gentoo"]["name"] }}, dest: /etc/init.d/openbook, mode: "0755" }
- when: ansible_distribution == "Gentoo"
+ - { src: ci/{{ pillar["ci"]["files"]["openbook_gentoo_openrc_start"]["path"] }}/{{ pillar["ci"]["files"]["openbook_gentoo_openrc_start"]["name"] }}, dest: /etc/init.d/openbook, mode: "0755" }
+ - { src: ci/{{ pillar["ci"]["files"]["openbook_gentoo_openrc_debug"]["path"] }}/{{ pillar["ci"]["files"]["openbook_gentoo_openrc_debug"]["name"] }}, dest: /etc/init.d/openbook-debug, mode: "0755" }
+ when: ansible_distribution == "Gentoo" and ansible_service_mgr == "openrc"
+
+ - name: "Create Openbook systemd scripts: Gentoo"
+ template:
+ src: "../templates/{% raw %}{{ item.src }}{% endraw %}"
+ dest: "{% raw %}{{ item.dest }}{% endraw %}"
+ mode: "{% raw %}{{ item.mode }}{% endraw %}"
+ owner: root
+ group: root
+ with_items:
+ - { src: ci/{{ pillar["ci"]["files"]["openbook_gentoo_systemd_start"]["path"] }}/{{ pillar["ci"]["files"]["openbook_gentoo_systemd_start"]["name"] }}, dest: /etc/systemctl/system/openbook.service, mode: "0644" }
+ - { src: ci/{{ pillar["ci"]["files"]["openbook_gentoo_systemd_debug"]["path"] }}/{{ pillar["ci"]["files"]["openbook_gentoo_systemd_debug"]["name"] }}, dest: /etc/systemctl/system/openbook-debug.service, mode: "0644" }
+ when: ansible_distribution == "Gentoo" and ansible_service_mgr == "systemd"
- name: "Add service script to systemd"
shell: systemctl enable openbook
- when: ansible_distribution == "Ubuntu" or ansible_distribution == "RedHat" or ansible_distribution == "CentOS"
+ when: ansible_distribution == "Ubuntu" or ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or (ansible_distribution == "Gentoo" and ansible_service_mgr == "systemd")
- name: "Enable openbook service"
service:
@@ -165,16 +180,7 @@
when: openbook_install_database|string() == "True"
- name: "Stop Openbook"
- hosts: "{% raw %}{{ groups['target']|sort(reverse=True) }}{% endraw %}"
- serial: 1
- tasks:
- - name: "Stop Openbook"
- shell: |
- /etc/init.d/openbook stop
- for cont in $(docker ps | grep -v 'COMMAND' | awk '{print $1}'); do
- docker stop ${cont}
- done
- docker container prune -f
+ include: stop_start_openbook.yaml action=stop
- name: "Install Openbook"
hosts: target
@@ -216,9 +222,5 @@
executable: /bin/bash
- name: "Start Openbook"
- hosts: "{% raw %}{{ groups['target']|sort }}{% endraw %}"
- serial: 1
- tasks:
- - name: "Start Openbook"
- shell: /etc/init.d/openbook start
- when: openbook_start_app == True
+ include: stop_start_openbook.yaml action=start
+ when: openbook_start_app == True