Commit d4d914bbd08fb38d76542f13a720dd38480b4d27

Authored by Alexandre Chapellon
Exists in master

Merge branch 'rheltarget'

... ... @@ -33,12 +33,12 @@ If you're loging in as a normal user and need to "sudo", use the command bellow:
33 33 ```
34 34 $ ansible-playbook -i inventory alfbm.yml -b -K
35 35 ```
  36 +If some options need to be changed (e.g. java or tomcat version, etc...), edit the group_vars/all file or the host_vars/<HOSTNAME> if the variable is host specific.
  37 +
36 38 ## TODO
37 39  
38 40 * Make it possible to download software from the Ansible machine instead of target machine (in case target cannot access internet).
39 41 * Allow Oracle JDK usage
40   - * RedHat like environments
41   - * Selenium install tasks for systemd enabled OS
42 42 * Allow non-key based play of the book
43 43 * Attach real VNC server to be able to see what selenium actually doing headless
44 44  
... ...
config.yml
... ... @@ -1,50 +0,0 @@
1   -artifact_repo: https://nexus.alfresco.com/nexus/service/local/repositories/snapshots/content
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
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
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   -
12   -# Use either Java 7 or 8
13   -#java_ver: 8
14   -
15   -# Set java flavor (only openjdk for now)
16   -#java_flav: openjdk
17   -
18   -# Use either Tomcat 7 or 8
19   -#tomcat_ver: 8
20   -
21   -# Set port for Tomcat to listen on. Set "tomcat_port" in host_vars to specify different ports on each host
22   -#tomcat_prt: 9080
23   -
24   -# Should we remove existing war files
25   -#tomcat_cln: False
26   -
27   -# Selenium version MUST be X.Y.Z
28   -#selenium_ver: 3.3.1
29   -
30   -# Specify a host to endorse the role of a Selenium Hub. defaults to the first bm-server (there should be only one)
31   -#selenium_hub_port: 4444
32   -# DO NOT EDIT FURTHER.
33   -# Thereafter we only set defaults
34   -
35   -java_version: "{{ java_ver | default(8) }}"
36   -java_flavor: "{{ java_flav | default('openjdk') }}"
37   -tomcat_version: "{{ tomcat_ver | default(7) }}"
38   -tomcat_clean: "{{ tomcat_cln | default(False) }}"
39   -tomcat_port: "{{ tomcat_prt | default(8080) }}"
40   -
41   -selenium_version: "{{ selenium_ver | default('2.53.0') }}"
42   -selenium_release: "{{ selenium_version | regex_replace('\\.\\d+$','') }}"
43   -selenium_url: "http://selenium-release.storage.googleapis.com/{{ selenium_release }}/selenium-server-standalone-{{ selenium_version }}.jar"
44   -
45   -selenium_hub_portnumber: "{{ selenium_hub_port | default(4444) }}"
46   -
47   -xserver_res: 1280x1024x24
48   -
49   -mongodb_version: "{{ mongodb_ver | default('3.4') }}"
50   -
... ... @@ -0,0 +1,52 @@
  1 +---
  2 +artifact_repo: https://nexus.alfresco.com/nexus/service/local/repositories
  3 +
  4 +bm_server_path: { repo: snapshots, path: /org/alfresco/alfresco-benchmark-server/2.2.1-SNAPSHOT/alfresco-benchmark-server-2.2.1-20170505.101349-1.war }
  5 +bm_sample: { repo: snapshots, path: /org/alfresco/alfresco-benchmark-sample/2.2.1-SNAPSHOT/alfresco-benchmark-sample-2.2.1-20170505.101506-1.war }
  6 +tests_signup_path: { repo: snapshots, path: /org/alfresco/alfresco-benchmark-tests-ent-signup/2.5-SNAPSHOT/alfresco-benchmark-tests-ent-signup-2.5-20170505.102429-8.war }
  7 +tests_cmis_path: { repo: snapshots, path: /org/alfresco/alfresco-benchmark-tests-cmis/1.7-SNAPSHOT/alfresco-benchmark-tests-cmis-1.7-20160818.133550-1.war }
  8 +tests_dataload_path: { repo: snapshots, path: /org/alfresco/alfresco-benchmark-tests-dataload/2.8-SNAPSHOT/alfresco-benchmark-tests-dataload-2.8-20170505.102513-7.war }
  9 +tests_share_path: { repo: snapshots, path: /org/alfresco/alfresco-benchmark-tests-share/5.2.0-SNAPSHOT/alfresco-benchmark-tests-share-5.2.0-20170505.102335-51.war }
  10 +tests_workflow_path: { repo: snapshots, path: /org/alfresco/alfresco-benchmark-tests-workflow/1.3-SNAPSHOT/alfresco-benchmark-tests-workflow-1.3-20170505.102423-16.war }
  11 +tests_desktopsync_path: { repo: snapshots, path: /org/alfresco/alfresco-benchmark-tests-desktop-sync/1.3-SNAPSHOT/alfresco-benchmark-tests-desktop-sync-1.3-20160615.142236-21.war }
  12 +
  13 +# Use either Java 7 or 8
  14 +#java_ver: 8
  15 +
  16 +# Set java flavor (only openjdk for now)
  17 +#java_flav: openjdk
  18 +
  19 +# Use either Tomcat 7 or 8
  20 +#tomcat_ver: 8
  21 +
  22 +# Set port for Tomcat to listen on. Set "tomcat_port" in host_vars to specify different ports on each host
  23 +#tomcat_prt: 9080
  24 +
  25 +# Should we remove existing war files
  26 +#tomcat_cln: False
  27 +tomcat_cln: True
  28 +
  29 +# Selenium version MUST be X.Y.Z
  30 +#selenium_ver: 3.3.1
  31 +
  32 +# Specify a host to endorse the role of a Selenium Hub. defaults to the first bm-server (there should be only one)
  33 +#selenium_hub_port: 4444
  34 +# DO NOT EDIT FURTHER.
  35 +# Thereafter we only set defaults
  36 +
  37 +java_version: "{{ java_ver | default(8) }}"
  38 +java_flavor: "{{ java_flav | default('openjdk') }}"
  39 +tomcat_version: "{{ tomcat_ver | default(7) }}"
  40 +tomcat_clean: "{{ tomcat_cln | default(False) }}"
  41 +tomcat_port: "{{ tomcat_prt | default(8080) }}"
  42 +
  43 +selenium_version: "{{ selenium_ver | default('2.53.0') }}"
  44 +selenium_release: "{{ selenium_version | regex_replace('\\.\\d+$','') }}"
  45 +selenium_url: "http://selenium-release.storage.googleapis.com/{{ selenium_release }}/selenium-server-standalone-{{ selenium_version }}.jar"
  46 +
  47 +selenium_hub_portnumber: "{{ selenium_hub_port | default(4444) }}"
  48 +
  49 +xserver_res: 1280x1024x24
  50 +
  51 +mongodb_version: "{{ mongodb_ver | default('3.4') }}"
  52 +
... ...
host_vars/rhalfbmsrv
1 1 index a99c53445d02c86fa76243530b2d0d4fb4629229..2f6f1c73a69406fbe7b6937883c5173665cef5a4 100644
2   --- a/yml/host_vars/alfmbm
  2 +++ b/host_vars/rhalfbmsrv
  1 +---
1 2 tomcat_port: 9080
2 3  
... ...
1 1 ---
2 2 - hosts: all
3   - vars_files:
4   - - ../config.yml
5 3 roles:
6 4 - common
... ...
yml/bm-server.yml
1 1 ---
2 2 - hosts: bm-server
3   - vars_files:
4   - - ../config.yml
5 3 roles:
6 4 - tomcat
7 5 - bm-server
... ...
yml/load-driver.yml
1 1 ---
2 2 - hosts: load-driver
3   - vars_files:
4   - - ../config.yml
5 3 roles:
6 4 - { role: tomcat, when: "inventory_hostname not in groups['bm-server']" }
7 5 - load-driver
... ...
1 1 ---
2 2 - hosts: mongodb
3   - vars_files:
4   - - ../config.yml
5 3 roles:
6 4 - mongodb
7 5  
... ...
yml/roles/bm-server/tasks/main.yml
... ... @@ -8,7 +8,7 @@
8 8  
9 9 - name: Get Alfresco benchmark server artifact
10 10 get_url:
11   - url: "{{ artifact_repo }}/{{ bm_server_path }}"
  11 + url: "{{ artifact_repo }}/{{ bm_server_path.repo }}/content/{{ bm_server_path.path }}"
12 12 dest: "{{ catalina_home }}/webapps/alfresco-benchmark-server.war"
13 13 owner: "{{ tomcat_user }}"
14 14 group: "{{ tomcat_group }}"
... ...
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/load-driver/tasks/main.yml
... ... @@ -18,16 +18,16 @@
18 18  
19 19 - name: Get Alfresco benchmark tests artifacts
20 20 get_url:
21   - url: "{{ artifact_repo }}/{{ item.artifact }}"
  21 + url: "{{ artifact_repo }}/{{ item.repo }}/content/{{ item.path }}"
22 22 dest: "{{ catalina_home }}/webapps/{{ item.warfile }}.war"
23 23 owner: "{{ tomcat_user }}"
24 24 group: "{{ tomcat_group }}"
25 25 mode: 0644
26 26 with_items:
27   - - { artifact: "{{ tests_signup_path }}", warfile: 'alfresco-benchmark-tests-signup' }
28   - - { artifact: "{{ tests_cmis_path }}", warfile: 'alfresco-benchmark-tests-cmis' }
29   - - { artifact: "{{ tests_dataload_path }}", warfile: 'alfresco-benchmark-tests-dataload' }
30   - - { artifact: "{{ tests_share_path }}", warfile: 'alfresco-benchmark-tests-share' }
31   - - { artifact: "{{ tests_workflow_path }}", warfile: 'alfresco-benchmark-tests-workflow' }
32   - - { artifact: "{{ tests_desktopsync_path }}", warfile: 'alfresco-benchmark-tests-desktopsync' }
  27 + - { repo: "{{ tests_signup_path.repo }}", path: "{{tests_signup_path.path }}", warfile: 'alfresco-benchmark-tests-signup' }
  28 + - { repo: "{{ tests_cmis_path.repo }}", path: "{{ tests_cmis_path.path }}", warfile: 'alfresco-benchmark-tests-cmis' }
  29 + - { repo: "{{ tests_dataload_path.repo }}", path: "{{ tests_dataload_path.path }}", warfile: 'alfresco-benchmark-tests-dataload' }
  30 + - { repo: "{{ tests_share_path.repo }}", path: "{{ tests_share_path.path }}", warfile: 'alfresco-benchmark-tests-share' }
  31 + - { repo: "{{ tests_workflow_path.repo }}", path: "{{ tests_workflow_path.path }}", warfile: 'alfresco-benchmark-tests-workflow' }
  32 + - { repo: "{{ tests_desktopsync_path.repo }}", path: "{{ tests_desktopsync_path.path }}", warfile: 'alfresco-benchmark-tests-desktopsync' }
33 33  
... ...
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,26 @@
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 + when: ansible_pkg_mgr == 'yum'
  16 +
  17 +- name: Set up MongoDB reposirtory (Debian-like)
9 18 apt_repository:
10 19 repo: "{{ mongo_repo_url }}"
11 20 when: ansible_pkg_mgr == 'apt'
12 21  
13   -- name: Install MongoDB
  22 +- name: Install MongoDB (RedHat-like)
  23 + yum:
  24 + name: mongodb-org
  25 + when: ansible_pkg_mgr == 'yum'
  26 +
  27 +- name: Install MongoDB (Debian-like)
14 28 apt:
15 29 name: mongodb-org
16 30 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
... ... @@ -16,12 +32,14 @@
16 32 dest: "{{ tomcat_cfg_daemon }}"
17 33 line: JAVA_HOME="{{ java_home }}"
18 34 regexp: '^\s*JAVA_HOME\s*=.*$'
  35 + create: yes
19 36 notify: Restart Tomcat
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] }}"
  42 + create: yes
25 43 notify: Restart Tomcat
26 44  
27 45 - name: Remove all Tomcat webapps
... ... @@ -31,12 +49,3 @@
31 49 - alfresco-benchmark-server.war
32 50 when: tomcat_clean == True
33 51  
34   -- name: Get Alfresco benchmark server artifact
35   - get_url:
36   - url: "{{ artifact_repo }}/{{ bm_server_path }}"
37   - dest: "{{ catalina_home }}/webapps/alfresco-benchmark-server.war"
38   - owner: "{{ tomcat_user }}"
39   - group: "{{ tomcat_group }}"
40   - mode: 0644
41   - notify: Restart Tomcat
42   -
... ...
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/alfresco-benchmark.conf{% else %}/etc/sysconfig/tomcat{% endif %}"
  14 +tomcat_user: tomcat
  15 +tomcat_group: tomcat
  16 +catalina_home: /usr/share/tomcat
  17 +
... ...
yml/selenium-grid.yml
... ... @@ -2,8 +2,6 @@
2 2 - hosts:
3 3 - selenium-hub
4 4 - load-driver
5   - vars_files:
6   - - ../config.yml
7 5 roles:
8 6 - selenium
9 7  
... ...