Commit 9385ebce28c1696e072e6c16baf30bcbfedc1cc7

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

add firefox the load-driver nodes, also improve selenium role structure

yml/roles/selenium/tasks/dist.yml
... ... @@ -0,0 +1,24 @@
  1 +---
  2 +- name: Load OS specific vars
  3 + include_vars: "{{ item }}"
  4 + with_first_found:
  5 + - "{{ ansible_os_family|lower }}.yml"
  6 + ignore_errors: true
  7 +
  8 +- name: Load distribution vars
  9 + include_vars: "{{ item }}"
  10 + with_first_found:
  11 + - "../vars/{{ ansible_distribution|lower }}.yml"
  12 + ignore_errors: true
  13 +
  14 +- name: Load major version vars
  15 + include_vars: "{{ item }}"
  16 + with_first_found:
  17 + - "../vars/{{ ansible_distribution|lower }}_{{ ansible_distribution_major_version|lower }}.yml"
  18 + ignore_errors: true
  19 + tags: debug
  20 +
  21 +- name: WARNING
  22 + debug: msg="your Linux distribution is quite outdated! Software version specified in your configuration may not be the one deployed"
  23 + when: warn_old
  24 +
... ...
yml/roles/selenium/tasks/main.yml
... ... @@ -0,0 +1,5 @@
  1 +---
  2 +- include: dist.yml
  3 +- include: packages.yml
  4 +- include: selenium.yml
  5 +
... ...
yml/roles/selenium/tasks/packages.yml
... ... @@ -0,0 +1,9 @@
  1 +---
  2 +- name: Software used with Selenium
  3 + apt:
  4 + name: "{{ item }}"
  5 + with_items:
  6 + - xvfb
  7 + - "{{ firefox_pkg }}"
  8 + when: ansible_pkg_mgr == "apt"
  9 +
... ...
yml/roles/selenium/tasks/selenium.yml
... ... @@ -13,11 +13,6 @@
13 13 dest: "/usr/local/share/selenium/selenium-server-standalone-{{ selenium_version }}.jar"
14 14 mode: 0644
15 15  
16   -- name: Install Pseudo X server
17   - apt:
18   - name: xvfb
19   - when: ansible_pkg_mgr == "apt"
20   -
21 16 - name: Add Selenium Hub init script
22 17 template:
23 18 src: sysvinit-hub
... ... @@ -41,3 +36,4 @@
41 36 - selenium-hub
42 37 - selenium-node
43 38 when: ( inventory_hostname in groups['selenium-hub'] and item == 'selenium-hub' ) or ( inventory_hostname in groups['load-driver'] and item == 'selenium-node' )
  39 +
... ...
yml/roles/selenium/vars/centos.yml
... ... @@ -0,0 +1 @@
  1 +firefox_pkg: firefox
... ...
yml/roles/selenium/vars/centos_7.yml
yml/roles/selenium/vars/debian.yml
... ... @@ -0,0 +1 @@
  1 +firefox_pkg: firefox-esr
... ...
yml/roles/selenium/vars/debian_7.yml
yml/roles/selenium/vars/debian_8.yml
yml/roles/selenium/vars/redhat.yml
... ... @@ -0,0 +1 @@
  1 +firefox_pkg: firefox
... ...
yml/roles/selenium/vars/ubuntu.yml
... ... @@ -0,0 +1 @@
  1 +firefox_pkg: firefox
... ...
yml/roles/selenium/vars/ubuntu_14.yml