Commit 83c4aa31fb7d3e646a566907fccd5c5d6dfc14f8

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

changes to support RedHat based distributions

1 1 artifact_repo: https://nexus.alfresco.com/nexus/service/local/repositories/snapshots/content
2 2  
3   -bm_server_path: /org/alfresco/alfresco-benchmark-server/2.2.0-SNAPSHOT/alfresco-benchmark-server-2.2.0-20170403.100924-4.war
4   -bm_sample: /org/alfresco/alfresco-benchmark-sample/2.2.0-SNAPSHOT/alfresco-benchmark-sample-2.2.0-20170403.101041-4.war
5   -tests_signup_path: /org/alfresco/alfresco-benchmark-tests-ent-signup/2.5-SNAPSHOT/alfresco-benchmark-tests-ent-signup-2.5-20170306.103110-4.war
  3 +bm_server_path: /org/alfresco/alfresco-benchmark-server/2.2.0-SNAPSHOT/alfresco-benchmark-server-2.2.0-20170425.171932-5.war
  4 +bm_sample: /org/alfresco/alfresco-benchmark-sample/2.2.0-SNAPSHOT/alfresco-benchmark-sample-2.2.0-20170425.172045-5.war
  5 +tests_signup_path: /org/alfresco/alfresco-benchmark-tests-ent-signup/2.5-SNAPSHOT/alfresco-benchmark-tests-ent-signup-2.5-20170425.173139-5.war
6 6 tests_cmis_path: /org/alfresco/alfresco-benchmark-tests-cmis/1.7-SNAPSHOT/alfresco-benchmark-tests-cmis-1.7-20160818.133550-1.war
7   -tests_dataload_path: /org/alfresco/alfresco-benchmark-tests-dataload/2.8-SNAPSHOT/alfresco-benchmark-tests-dataload-2.8-20170306.105256-3.war
8   -tests_share_path: /org/alfresco/alfresco-benchmark-tests-share/5.2.0-SNAPSHOT/alfresco-benchmark-tests-share-5.2.0-20170424.155703-47.war
9   -tests_workflow_path: /org/alfresco/alfresco-benchmark-tests-workflow/1.3-SNAPSHOT/alfresco-benchmark-tests-workflow-1.3-20170403.102028-12.war
  7 +tests_dataload_path: /org/alfresco/alfresco-benchmark-tests-dataload/2.8-SNAPSHOT/alfresco-benchmark-tests-dataload-2.8-20170425.173217-4.war
  8 +tests_share_path: /org/alfresco/alfresco-benchmark-tests-share/5.2.0-SNAPSHOT/alfresco-benchmark-tests-share-5.2.0-20170425.173048-48.war
  9 +tests_workflow_path: /org/alfresco/alfresco-benchmark-tests-workflow/1.3-SNAPSHOT/alfresco-benchmark-tests-workflow-1.3-20170425.173133-13.war
10 10 tests_desktopsync_path: /org/alfresco/alfresco-benchmark-tests-desktop-sync/1.3-SNAPSHOT/alfresco-benchmark-tests-desktop-sync-1.3-20160615.142236-21.war
11 11  
12 12 # Use either Java 7 or 8
... ... @@ -36,7 +36,7 @@ java_version: "{{ java_ver | default(8) }}"
36 36 java_flavor: "{{ java_flav | default('openjdk') }}"
37 37 tomcat_version: "{{ tomcat_ver | default(7) }}"
38 38 tomcat_clean: "{{ tomcat_cln | default(False) }}"
39   -tomcat_port: "{{ tomcat_prt | default(8080) }}"
  39 +#tomcat_port: "{{ tomcat_prt | default(8080) }}"
40 40  
41 41 selenium_version: "{{ selenium_ver | default('2.53.0') }}"
42 42 selenium_release: "{{ selenium_version | regex_replace('\\.\\d+$','') }}"
... ...
yml/host_vars/rhalfbmsrv
1 1 index a99c53445d02c86fa76243530b2d0d4fb4629229..2f6f1c73a69406fbe7b6937883c5173665cef5a4 100644
2   --- a/yml/host_vars/alfmbm
  2 +++ b/yml/host_vars/rhalfbmsrv
  1 +---
1 2 tomcat_port: 9080
2 3  
... ...
yml/roles/common/tasks/dist.yml
... ... @@ -8,16 +8,16 @@
8 8 - name: Load distribution vars
9 9 include_vars: "{{ item }}"
10 10 with_first_found:
11   - - "../vars/{{ ansible_distribution|lower }}.yml"
  11 + - "{{ ansible_distribution|lower }}.yml"
12 12 ignore_errors: true
13 13  
14 14 - name: Load major version vars
15 15 include_vars: "{{ item }}"
16 16 with_first_found:
17   - - "../vars/{{ ansible_distribution|lower }}_{{ ansible_distribution_major_version|lower }}.yml"
  17 + - "{{ ansible_distribution|lower }}_{{ ansible_distribution_major_version|lower }}.yml"
18 18 ignore_errors: true
19 19  
20 20 - name: WARNING
21 21 debug: msg="your Linux distribution is quite outdated! Software version specified in your configuration may not be the one deployed"
22   - when: warn_old
  22 + when: warn_old is defined
23 23  
... ...
yml/roles/common/vars/debian.yml
1 1 common_pkg:
2 2 - python-lxml
  3 + - bzip2
  4 + - unzip
3 5  
... ...
yml/roles/common/vars/redhat.yml
1 1 common_pkg:
2   - - python-lxml
  2 + - python-lxml
  3 + - bzip2
  4 + - unzip
3 5  
... ...
yml/roles/mongodb/tasks/dist.yml
... ... @@ -8,16 +8,16 @@
8 8 - name: Load distribution vars
9 9 include_vars: "{{ item }}"
10 10 with_first_found:
11   - - "../vars/{{ ansible_distribution|lower }}.yml"
  11 + - "{{ ansible_distribution|lower }}.yml"
12 12 ignore_errors: true
13 13  
14 14 - name: Load major version vars
15 15 include_vars: "{{ item }}"
16 16 with_first_found:
17   - - "../vars/{{ ansible_distribution|lower }}_{{ ansible_distribution_major_version|lower }}.yml"
  17 + - "{{ ansible_distribution|lower }}_{{ ansible_distribution_major_version|lower }}.yml"
18 18 ignore_errors: true
19 19  
20 20 - name: WARNING
21 21 debug: msg="your Linux distribution is quite outdated! Software version specified in your configuration may not be the one deployed"
22   - when: warn_old
  22 + when: warn_old is defined
23 23  
... ...
yml/roles/mongodb/tasks/packages.yml
... ... @@ -5,12 +5,25 @@
5 5 id: 0C49F3730359A14518585931BC711F9BA15703C6
6 6 when: ansible_pkg_mgr == 'apt'
7 7  
8   -- name: Set up MongoDB reposirtory
  8 +- name: Set up MongoDB reposirtory (RedHat-like)
  9 + yum_repository:
  10 + name: mongodb-org
  11 + description: MongoDB Community repository
  12 + baseurl: "{{ mongo_repo_url }}"
  13 + gpgcheck: yes
  14 + gpgkey: "{{ mongo_repo_key }}"
  15 +
  16 +- name: Set up MongoDB reposirtory (Debian-like)
9 17 apt_repository:
10 18 repo: "{{ mongo_repo_url }}"
11 19 when: ansible_pkg_mgr == 'apt'
12 20  
13   -- name: Install MongoDB
  21 +- name: Install MongoDB (RedHat-like)
  22 + yum:
  23 + name: mongodb-org
  24 + when: ansible_pkg_mgr == 'yum'
  25 +
  26 +- name: Install MongoDB (Debian-like)
14 27 apt:
15 28 name: mongodb-org
16 29 when: ansible_pkg_mgr == 'apt'
... ...
yml/roles/mongodb/vars/redhat.yml
... ... @@ -0,0 +1,3 @@
  1 +mongo_repo_url: https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.4/x86_64/
  2 +mongo_repo_key: https://www.mongodb.org/static/pgp/server-3.4.asc
  3 +
... ...
yml/roles/selenium/handlers/main.yml
... ... @@ -11,3 +11,12 @@
11 11 state: restarted
12 12 enabled: yes
13 13  
  14 +# sshd should of course always be started but tasks without
  15 +# service name are only supported since 2.4
  16 +- name: Reload Systemd
  17 + systemd:
  18 + daemon_reload: yes
  19 + name: sshd
  20 + state: started
  21 + enabled: yes
  22 +
... ...
yml/roles/selenium/tasks/dist.yml
... ... @@ -8,17 +8,16 @@
8 8 - name: Load distribution vars
9 9 include_vars: "{{ item }}"
10 10 with_first_found:
11   - - "../vars/{{ ansible_distribution|lower }}.yml"
  11 + - "{{ ansible_distribution|lower }}.yml"
12 12 ignore_errors: true
13 13  
14 14 - name: Load major version vars
15 15 include_vars: "{{ item }}"
16 16 with_first_found:
17   - - "../vars/{{ ansible_distribution|lower }}_{{ ansible_distribution_major_version|lower }}.yml"
  17 + - "{{ ansible_distribution|lower }}_{{ ansible_distribution_major_version|lower }}.yml"
18 18 ignore_errors: true
19   - tags: debug
20 19  
21 20 - name: WARNING
22 21 debug: msg="your Linux distribution is quite outdated! Software version specified in your configuration may not be the one deployed"
23   - when: warn_old
  22 + when: warn_old is defined
24 23  
... ...
yml/roles/selenium/tasks/packages.yml
1 1 ---
2   -- name: Software used with Selenium
  2 +- name: Install dummy Xserver for the webdriver (Debian-like)
3 3 apt:
4 4 name: "{{ item }}"
5 5 with_items:
6 6 - xvfb
  7 + - x11vnc
7 8 when: ansible_pkg_mgr == "apt"
8 9  
  10 +- name: Install dummy Xserver for the webdriver (RedHat-like)
  11 + yum:
  12 + name: "{{ item }}"
  13 + with_items:
  14 + - xorg-x11-server-Xvfb
  15 + - tigervnc-server-minimal
  16 + when: ansible_pkg_mgr == "yum"
  17 +
9 18 - name: Firefox installation
10 19 unarchive:
11 20 src: https://ftp.mozilla.org/pub/firefox/releases/44.0/linux-x86_64/en-GB/firefox-44.0.tar.bz2
... ...
yml/roles/selenium/tasks/selenium.yml
... ... @@ -18,7 +18,7 @@
18 18 src: sysvinit-hub
19 19 dest: /etc/init.d/selenium-hub
20 20 mode: 0755
21   - when: inventory_hostname in groups['selenium-hub']
  21 + when: inventory_hostname in groups['selenium-hub'] and ( ansible_service_mgr == 'upstart' or ansible_service_mgr == 'init' )
22 22 notify: Restart Selenium hub
23 23  
24 24 - name: Add Selenium Node init script
... ... @@ -26,9 +26,29 @@
26 26 src: sysvinit-node
27 27 dest: /etc/init.d/selenium-node
28 28 mode: 0755
29   - when: inventory_hostname in groups['load-driver']
  29 + when: inventory_hostname in groups['load-driver'] and ( ansible_service_mgr == 'upstart' or ansible_service_mgr == 'init' )
30 30 notify: Restart Selenium node
31 31  
  32 +- name: Add Selenium Hub unit file
  33 + template:
  34 + src: unit-file_hub
  35 + dest: "{{ systemd_unit_prefix }}/systemd/system/selenium-hub.service"
  36 + mode: 0644
  37 + when: inventory_hostname in groups['selenium-hub'] and ansible_service_mgr == 'systemd'
  38 + notify:
  39 + - Reload Systemd
  40 + - Restart Selenium hub
  41 +
  42 +- name: Add Selenium Node unit file
  43 + template:
  44 + src: unit-file_node
  45 + dest: "{{ systemd_unit_prefix }}/systemd/system/selenium-node.service"
  46 + mode: 0644
  47 + when: inventory_hostname in groups['selenium-hub'] and ansible_service_mgr == 'systemd'
  48 + notify:
  49 + - Reload Systemd
  50 + - Restart Selenium node
  51 +
32 52 - name: Enable Selenium service
33 53 service:
34 54 name: "{{ item }}"
... ...
yml/roles/selenium/templates/sysvinit-node
... ... @@ -14,7 +14,7 @@ XVFB_RUN=/usr/bin/xvfb-run
14 14  
15 15 MAX_MEMORY="-Xmx1G"
16 16  
17   -DAEMON_OPTS="$MAX_MEMORY -jar $JAR_FILE -log $LOG_FILE -role node -hub http://${SELENIUM_HUB}:${SELENIUM_PORT}/grid/register -maxSession 500 -browser browserName=firefox,platform=ANY,maxInstances={{ ansible_processor_cores * 2 }} -port 5559 -avoidProxy"
  17 +DAEMON_OPTS="$MAX_MEMORY -jar $JAR_FILE -log $LOG_FILE -role node -hub http://${SELENIUM_HUB}:${SELENIUM_PORT}/grid/register -browser browserName=firefox,platform=ANY,maxInstances={{ ansible_processor_cores * 2 }} -port 5559 -avoidProxy"
18 18 XSERVER_ARGS="-screen 0 {{ xserver_res }}"
19 19  
20 20 NAME=selenium-node
... ...
yml/roles/selenium/templates/unit-file_hub
1 1 [Unit]
2   -Description=Selenium Hub
  2 +Description=Selenium grid Hub
3 3 After=syslog.target network.target
4 4  
5 5 [Service]
6 6 Type=simple
7 7 User=selenium
8 8  
9   -ExecStart=/usr/bin/java -jar /usr/local/share/selenium/selenium-server-standalone-{{ selenium_version }}.jar -role hub -newSessionWaitTimeout 5000 -timeout 300 -Xmx1G -port {{ selenium_hub_port }}
  9 +ExecStart=/usr/bin/java -jar /usr/local/share/selenium/selenium-server-standalone-{{ selenium_version }}.jar -role hub -newSessionWaitTimeout 5000 -timeout 300 -Xmx1G -port {{ selenium_hub_portnumber }}
10 10  
11 11 [Install]
12 12 WantedBy=multi-user.target
... ...
yml/roles/selenium/templates/unit-file_node
1 1 [Unit]
2   -Description=Selenium Grid Node on xvfb
  2 +Description=Selenium grid Node on xvfb
3 3 After=syslog.target network.target
4 4  
5 5 [Service]
6 6 User=selenium
7 7  
8   -ExecStart=/usr/bin/xvfb-run -a /usr/bin/java -jar /usr/local/share/selenium/selenium-server-standalone-{{ selenium_version }}.jar -role node -hub http://{{ groups['selenium-hub'][0] }}:{{ selenium_hub_portnumber }}/grid/register -maxSession 500 -browser browserName=firefox,platform=ANY,maxInstances=32 -port 5559 -avoidProxy
  8 +ExecStart=/usr/bin/xvfb-run -s "screen 0 {{ xserver_res }}" -a /usr/bin/java -jar /usr/local/share/selenium/selenium-server-standalone-{{ selenium_version }}.jar -role node -hub http://{{ groups['selenium-hub'][0] }}:{{ selenium_hub_portnumber }}/grid/register -browser browserName=firefox,platform=ANY,maxInstances={{ ansible_processor_cores * 2 }} -port 5559 -avoidProxy
9 9  
10 10 [Install]
11 11 WantedBy=default.target
... ...
yml/roles/selenium/vars/debian.yml
... ... @@ -0,0 +1,2 @@
  1 +systemd_unit_prefix: /lib
  2 +
... ...
yml/roles/selenium/vars/redhat.yml
... ... @@ -0,0 +1,2 @@
  1 +systemd_unit_prefix: /usr/lib
  2 +
... ...
yml/roles/tomcat/tasks/config.yml
1 1 ---
2   -- name: Configure Tomcat server
  2 +- name: Reset Tomcat connectors
3 3 xml:
4 4 file: "{{ tomcat_cfg_server }}"
5   - xpath: /Server/Service/Connector/@port
  5 + xpath: /Server/Service/Connector
  6 + ensure: absent
6 7  
7   -- name: Set Tomcat port
  8 +- name: add HTTP Connector
  9 + xml:
  10 + file: "{{ tomcat_cfg_server }}"
  11 + xpath: "{{ item }}"
  12 + with_items:
  13 + - /Server/Service/Connector/@port
  14 + - /Server/Service/Connector/@protocol
  15 + - /Server/Service/Connector/@maxPostSize
  16 + - /Server/Service/Connector/@scheme
  17 +
  18 +- name: Set Tomcat port (ansible-xml cannot handle this at the moment)
8 19 replace:
9 20 dest: "{{ tomcat_cfg_server }}"
10   - regexp: ' port="" '
11   - replace: ' port="{{ tomcat_port }}" '
  21 + regexp: ' {{ item.attribute }}=""'
  22 + replace: ' {{ item.attribute }}="{{ item.value }}" '
  23 + with_items:
  24 + - { attribute: port, value: "{{ tomcat_port }}" }
  25 + - { attribute: protocol, value: "HTTP/1.1" }
  26 + - { attribute: scheme, value: "http" }
  27 + - { attribute: maxPostSize, value: "52428800" }
12 28 notify: Restart Tomcat
13 29  
14 30 - name: Set JAVA_HOME
... ... @@ -17,12 +33,14 @@
17 33 line: JAVA_HOME="{{ java_home }}"
18 34 regexp: '^\s*JAVA_HOME\s*=.*$'
19 35 notify: Restart Tomcat
  36 + when: ansible_service_mgr == 'upstart' or ansible_service_mgr == 'init'
20 37  
21 38 - name: Set JAVA_OPTS
22 39 lineinfile:
23 40 dest: "{{ tomcat_cfg_daemon }}"
24   - line: JAVA_OPTS="$JAVA_OPTS -server -XX:MaxPermSize=512 -Xmx3G -Dmongo.config.host="{{ groups['mongodb'][0] }}""
  41 + line: JAVA_OPTS="$JAVA_OPTS -server -XX:MaxPermSize=512 -Xmx3G -Dmongo.config.host={{ groups['mongodb'][0] }}"
25 42 notify: Restart Tomcat
  43 + when: ansible_service_mgr == 'upstart' or ansible_service_mgr == 'init'
26 44  
27 45 - name: Remove all Tomcat webapps
28 46 file: name="{{ catalina_home }}/webapps/{{ item }}" state=absent
... ...
yml/roles/tomcat/tasks/dist.yml
... ... @@ -8,17 +8,16 @@
8 8 - name: Load distribution vars
9 9 include_vars: "{{ item }}"
10 10 with_first_found:
11   - - "../vars/{{ ansible_distribution|lower }}.yml"
  11 + - "{{ ansible_distribution|lower }}.yml"
12 12 ignore_errors: true
13 13  
14 14 - name: Load major version vars
15 15 include_vars: "{{ item }}"
16 16 with_first_found:
17   - - "../vars/{{ ansible_distribution|lower }}_{{ ansible_distribution_major_version|lower }}.yml"
  17 + - "{{ ansible_distribution|lower }}_{{ ansible_distribution_major_version|lower }}.yml"
18 18 ignore_errors: true
19   - tags: debug
20 19  
21 20 - name: WARNING
22 21 debug: msg="your Linux distribution is quite outdated! Software version specified in your configuration may not be the one deployed"
23   - when: warn_old
  22 + when: warn_old is defined
24 23  
... ...
yml/roles/tomcat/tasks/packages.yml
... ... @@ -12,3 +12,6 @@
12 12 - name: Stop Tomcat
13 13 service: name="{{ tomcat_pkg[0] }}" state=stopped
14 14  
  15 +- name: Enable Tomcat on startup
  16 + service: name="{{ tomcat_pkg[0] }}" enabled=yes
  17 +
... ...
yml/roles/tomcat/vars/redhat.yml
... ... @@ -0,0 +1,17 @@
  1 +java_pkg:
  2 + - "java-1.{{ java_version }}.0-openjdk-headless"
  3 + - "java-1.{{ java_version }}.0-openjdk-devel"
  4 +
  5 +java_home: "/usr/lib/jvm/jre"
  6 +
  7 +tomcat_pkg:
  8 + - tomcat
  9 +
  10 +servlet_pkg: "{{ java_pkg }} + {{ tomcat_pkg }}"
  11 +
  12 +tomcat_cfg_server: /etc/tomcat/server.xml
  13 +tomcat_cfg_daemon: "{% if ansible_service_mgr == 'systemd' %}/etc/tomcat/conf.d/{% else %}/etc/sysconfig/tomcat{% endif %}"
  14 +tomcat_user: tomcat
  15 +tomcat_group: tomcat
  16 +catalina_home: /usr/share/tomcat
  17 +
... ...