Commit 2df236d1c5b1c655178bb97e5232e5309e8e5733

Authored by Alexandre Chapellon
1 parent 94ddcfdab1
Exists in master and in 1 other branch rheltarget

Move the Selenium start process to a handler

yml/roles/selenium/handlers/main.yml
... ... @@ -0,0 +1,13 @@
  1 +---
  2 +- name: Restart Selenium Hub
  3 + service:
  4 + name: selenium-hub
  5 + state: started
  6 + enabled: yes
  7 +
  8 +- name: Restart Selenium node
  9 + service:
  10 + name: selenium-node
  11 + state: started
  12 + enabled: yes
  13 +
... ...
yml/roles/selenium/tasks/selenium.yml
... ... @@ -19,6 +19,7 @@
19 19 dest: /etc/init.d/selenium-hub
20 20 mode: 0755
21 21 when: inventory_hostname in groups['selenium-hub']
  22 + notify: Restart Selenium hub
22 23  
23 24 - name: Add Selenium Node init script
24 25 template:
... ... @@ -26,11 +27,11 @@
26 27 dest: /etc/init.d/selenium-node
27 28 mode: 0755
28 29 when: inventory_hostname in groups['load-driver']
  30 + notify: Restart Selenium node
29 31  
30 32 - name: Enable Selenium service
31 33 service:
32 34 name: "{{ item }}"
33   - state: started
34 35 enabled: yes
35 36 with_items:
36 37 - selenium-hub
... ...