From 08e3b285186712914cc941abb7c120aece861869 Mon Sep 17 00:00:00 2001 From: MassiveHiggsField Date: Wed, 25 Oct 2017 15:18:02 +0200 Subject: [PATCH 1/9] added idea project file to gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 7b8cfb1..6eb02ab 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,7 @@ Thumbs.db *.komodoproject *.kpf /.idea +/*.iml # Other files # ############### From 305a137ce3e50bb4f2bda6c19e7ca81cd8ba6353 Mon Sep 17 00:00:00 2001 From: MassiveHiggsField Date: Wed, 25 Oct 2017 16:08:07 +0200 Subject: [PATCH 2/9] added test.sh to gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 6eb02ab..aa146bc 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,4 @@ Thumbs.db # Other files # ############### !empty +/tests/test.sh From d1ef67cc510b36b4a178bd1630d0393ea00f17e1 Mon Sep 17 00:00:00 2001 From: MassiveHiggsField Date: Wed, 25 Oct 2017 16:08:33 +0200 Subject: [PATCH 3/9] added better check for running selenium server --- tasks/main.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 16533ab..293fc49 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -93,14 +93,14 @@ when: "ansible_service_mgr == 'systemd'" tags: [configuration, selenium, selenium-install] -- name: Register systemd service status (for systemd systems) - shell: 'systemctl status selenium | grep "active (running)"' - when: "ansible_service_mgr == 'systemd'" - register: selenium_running - ignore_errors: yes - changed_when: false - -- name: Ensure selenium is running +- name: Start selenium service (for systemd systems) service: name=selenium state=started enabled=yes tags: [configuration, selenium, selenium-run] - when: selenium_running.failed is defined and selenium_running.failed == true + when: "ansible_service_mgr == 'systemd'" + +- name: Ensure selenium server is up and running (for systemd systems) + shell: 'systemctl status selenium' + register: result + until: result.stdout.find("Selenium Server is up and running") != -1 + retries: 3 + delay: 5 From d75ef5364a43702100cd656b50631092ce49202a Mon Sep 17 00:00:00 2001 From: MassiveHiggsField Date: Wed, 25 Oct 2017 16:09:11 +0200 Subject: [PATCH 4/9] added test.retry to gitignore --- .gitignore | 1 + .travis.yml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index aa146bc..f1ed4a6 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,4 @@ Thumbs.db ############### !empty /tests/test.sh +/tests/test.retry diff --git a/.travis.yml b/.travis.yml index 6741ad7..a316c01 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,4 +19,4 @@ script: notifications: email: false - webhooks: https://galaxy.ansible.com/api/v1/notifications/ +# webhooks: https://galaxy.ansible.com/api/v1/notifications/ From 6b84a1bdd81fbd725b0ece7b3b5faad762e51fda Mon Sep 17 00:00:00 2001 From: MassiveHiggsField Date: Wed, 25 Oct 2017 16:32:39 +0200 Subject: [PATCH 5/9] added missing check for systemd --- tasks/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/tasks/main.yml b/tasks/main.yml index 293fc49..e430d88 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -104,3 +104,4 @@ until: result.stdout.find("Selenium Server is up and running") != -1 retries: 3 delay: 5 + when: "ansible_service_mgr == 'systemd'" From 697b75668615c1aa2e975b941bc4cbbf13601ec5 Mon Sep 17 00:00:00 2001 From: MassiveHiggsField Date: Wed, 25 Oct 2017 16:41:50 +0200 Subject: [PATCH 6/9] added ignore change on ensuring task --- tasks/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/tasks/main.yml b/tasks/main.yml index e430d88..1d633c8 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -104,4 +104,5 @@ until: result.stdout.find("Selenium Server is up and running") != -1 retries: 3 delay: 5 + changed_when: false when: "ansible_service_mgr == 'systemd'" From e87dd4b28a035bf771c69ec67a4806dbff41103c Mon Sep 17 00:00:00 2001 From: MassiveHiggsField Date: Wed, 25 Oct 2017 17:26:28 +0200 Subject: [PATCH 7/9] fixes problems with special parameters in systemd service files by adding a start shell script --- tasks/main.yml | 11 +++++++++++ templates/selenium-start.j2 | 3 +++ templates/selenium-unit.j2 | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 templates/selenium-start.j2 diff --git a/tasks/main.yml b/tasks/main.yml index 1d633c8..e71ae26 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -83,6 +83,16 @@ when: "ansible_service_mgr != 'systemd'" tags: [configuration, selenium, selenium-install] +- name: Install start script (for systemd systems) + template: + src: "selenium-start.j2" + dest: /opt/selenium/start.sh + owner: root + group: root + mode: 0755 + when: "ansible_service_mgr == 'systemd'" + tags: [configuration, selenium, selenium-install] + - name: Install systemd unit file (for systemd systems) template: src: "selenium-unit.j2" @@ -105,4 +115,5 @@ retries: 3 delay: 5 changed_when: false + tags: [configuration, selenium, selenium-run] when: "ansible_service_mgr == 'systemd'" diff --git a/templates/selenium-start.j2 b/templates/selenium-start.j2 new file mode 100644 index 0000000..af817c5 --- /dev/null +++ b/templates/selenium-start.j2 @@ -0,0 +1,3 @@ +#!/bin/bash + +/usr/bin/xvfb-run {{ selenium_xvfb_args }} /usr/bin/java -client -jar {{ selenium_install_dir }}/selenium/selenium-server-standalone-{{ selenium_version }}.jar \ No newline at end of file diff --git a/templates/selenium-unit.j2 b/templates/selenium-unit.j2 index f25dfca..4731123 100644 --- a/templates/selenium-unit.j2 +++ b/templates/selenium-unit.j2 @@ -3,7 +3,7 @@ Description=selenium test framework After=syslog.target network.target [Service] -ExecStart=/usr/bin/xvfb-run {{ selenium_xvfb_args }} /usr/bin/java -client -jar {{ selenium_install_dir }}/selenium/selenium-server-standalone-{{ selenium_version }}.jar +ExecStart={{ selenium_install_dir }}/selenium/start.sh Restart=on-failure RestartSec=20s From bca67b65aed3ce9ec6a90d036a82821d81a3f440 Mon Sep 17 00:00:00 2001 From: MassiveHiggsField Date: Wed, 25 Oct 2017 18:59:08 +0200 Subject: [PATCH 8/9] reactivated notifications --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a316c01..6741ad7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,4 +19,4 @@ script: notifications: email: false -# webhooks: https://galaxy.ansible.com/api/v1/notifications/ + webhooks: https://galaxy.ansible.com/api/v1/notifications/ From 7527405be9a5fb3d78be503e8c5bfb10d9212e9d Mon Sep 17 00:00:00 2001 From: MassiveHiggsField Date: Wed, 25 Oct 2017 19:21:38 +0200 Subject: [PATCH 9/9] changed hardcoded path --- tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/main.yml b/tasks/main.yml index e71ae26..79c06d7 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -86,7 +86,7 @@ - name: Install start script (for systemd systems) template: src: "selenium-start.j2" - dest: /opt/selenium/start.sh + dest: "{{ selenium_install_dir }}/selenium/start.sh" owner: root group: root mode: 0755