summaryrefslogtreecommitdiff
path: root/salt/openbook
diff options
context:
space:
mode:
Diffstat (limited to 'salt/openbook')
-rw-r--r--salt/openbook/ansible/files/env.yaml.openbook.example1
-rw-r--r--salt/openbook/ansible/files/openbook.yaml80
2 files changed, 46 insertions, 35 deletions
diff --git a/salt/openbook/ansible/files/env.yaml.openbook.example b/salt/openbook/ansible/files/env.yaml.openbook.example
index 9a3bde5..a82bf04 100644
--- a/salt/openbook/ansible/files/env.yaml.openbook.example
+++ b/salt/openbook/ansible/files/env.yaml.openbook.example
@@ -4,6 +4,7 @@ globals:
ansible_python_interpreter: /usr/bin/python2
openbook_gcomm_addresses: ~
openbook_install_database: True|False
+ openbook_start_app: True|False
hosts:
- host1:
diff --git a/salt/openbook/ansible/files/openbook.yaml b/salt/openbook/ansible/files/openbook.yaml
index 46c4ff5..69a518c 100644
--- a/salt/openbook/ansible/files/openbook.yaml
+++ b/salt/openbook/ansible/files/openbook.yaml
@@ -2,6 +2,42 @@
- name: "Install Openbook"
hosts: target
tasks:
+ - name: "Install network tools"
+ apt:
+ pkg: "{% raw %}{{ item }}{% endraw %}"
+ state: present
+ with_items:
+ - netcat-openbsd
+ - lsof
+ when: ansible_distribution == "Ubuntu"
+
+ - name: "Install network tools"
+ yum:
+ name: "{% raw %}{{ item }}{% endraw %}"
+ state: present
+ with_items:
+ - nmap-ncat
+ - lsof
+ when: ansible_distribution == "RedHat" or ansible_distribution == "CentOS"
+
+ - name: "Install network tools"
+ portage:
+ package: "{% raw %}{{ item }}{% endraw %}"
+ update: yes
+ changed_use: yes
+ with_items:
+ - net-analyzer/netcat
+ - sys-process/lsof
+ when: ansible_distribution == "Gentoo"
+
+ - name: "Write hosts entry"
+ lineinfile:
+ dest: /etc/hosts
+ regexp: "{% raw %}{{ item.regexp }}{% endraw %}"
+ line: "{% raw %}{{ item.line }}{% endraw %}"
+ with_items:
+ - { regexp: '^127\.0\.0\.1.*$', line: "127.0.0.1 localhost {% raw %}{{ ansible_nodename }}{% endraw %}" }
+
- name: "Create Openbook directories"
file:
path: "{% raw %}{{ item.path }}{% endraw %}"
@@ -140,38 +176,12 @@
docker pull {{ pillar["registry"]["url"] }}/{{ pillar["admin_web_ui"]["image_name"] }}
docker pull {{ pillar["registry"]["url"] }}/{{ pillar["customer_web_ui"]["image_name"] }}
- - name: "Write hosts entry"
- lineinfile:
- dest: /etc/hosts
- regexp: "{% raw %}{{ item.regexp }}{% endraw %}"
- line: "{% raw %}{{ item.line }}{% endraw %}"
- with_items:
- - { regexp: '^127\.0\.0\.1.*$', line: "127.0.0.1 localhost {% raw %}{{ ansible_nodename }}{% endraw %}" }
-
- - name: "Install network tools"
- apt:
- pkg: "{% raw %}{{ item }}{% endraw %}"
- state: present
- with_items:
- - netcat-openbsd
- - lsof
- when: ansible_distribution == "Ubuntu"
-
- - name: "Install network tools"
- yum:
- name: "{% raw %}{{ item }}{% endraw %}"
- state: present
- with_items:
- - nmap-ncat
- - lsof
- when: ansible_distribution == "RedHat" or ansible_distribution == "CentOS"
-
- - name: "Install network tools"
- portage:
- package: "{% raw %}{{ item }}{% endraw %}"
- update: yes
- changed_use: yes
- with_items:
- - net-analyzer/netcat
- - sys-process/lsof
- when: ansible_distribution == "Gentoo"
+- name: "Start Openbook"
+ hosts: target
+ serial: 1
+ tasks:
+ - name: "Start openobok"
+ shell: |
+ /etc/init.d/openbook start
+ sleep 10
+ when: openbook_start_app == True