Skip to content

Commit b3c0aae

Browse files
authored
Add CentOS 8/Python3 support (#16)
* Update dispatcher version; add Galaxy tags * Fix tarball name for >=4.3.3 * Fix indentation error * Fix dispatcher tarball name tokens * Fix tarball name when using libssl1.1 * Improve libssl version referencing * Split setting SSL facts in two steps * Include var file when setting up RedHat * Fix inclusion of distro-specific variables * Fix openssl version number for CentOS distros * Fix SELinux package names for Python3 * Fix typo * Change way of including RedHat-specific variables * Replace YAML multiline strings * Skip Ansible lint on two files * Fix skip_ansible_lint tagging * Fix multiline YAML syntax * Remove (hopefully) redundant regex * Fix typo * Fix regex for Maven classifier coordinate * Fix version cast; Remove extra_opts in unpack_module.yml * Fix dispatcher module filename regex * Fix dispatcher module filename regex for good * Use version comparators
1 parent d57d81b commit b3c0aae

File tree

8 files changed

+28
-12
lines changed

8 files changed

+28
-12
lines changed

defaults/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Dispatcher version to install
2-
aem_dispatcher_version: 4.3.2
2+
aem_dispatcher_version: 4.3.3
33
# Whether to install dispatcher with SSL support
44
aem_dispatcher_ssl_support: true
55

meta/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@ galaxy_info:
1212
versions:
1313
- trusty
1414
- xenial
15+
- bionic
1516
- name: Debian
1617
versions:
1718
- jessie
1819
- stretch
1920
- name: EL
2021
versions:
2122
- 7
23+
- 8
2224

2325
galaxy_tags:
2426
- aem

tasks/download/maven_repository.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@
2222
username: "{{ aem_dispatcher_maven_repository_username | default(omit) }}"
2323
password: "{{ aem_dispatcher_maven_repository_password | default(omit) }}"
2424
version: "{{ item.version | default(aem_dispatcher_version) }}"
25-
classifier: "{{ item.classifier | default(aem_dispatcher_tarball_name | regex_replace('dispatcher-(.*)-([\\d\\.]*)\\.tar\\.gz', '\\1')) }}"
25+
classifier: "{{ item.classifier | default(aem_dispatcher_tarball_name |
26+
regex_replace('dispatcher-[\\d|\\.]*-(.*)\\.tar\\.gz', '\\1') ) }}"
2627
with_items: "{{ aem_dispatcher_maven_repository_coordinates }}"

tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@
2323
when: aem_dispatcher_install_source != "package"
2424

2525
- name: Include OS-specific setup.
26-
include_tasks: "setup_{{ ansible_os_family }}.yml"
26+
include_tasks: "setup_{{ ansible_os_family }}.yml"

tasks/setup_RedHat.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66

77
- name: Install SELinux Python dependencies.
88
package:
9-
name: libsemanage-python
9+
name: >-
10+
{{ 'libsemanage-python' if ansible_distribution_major_version is version('8', '<') else 'libsemanage-python3' }}
1011
state: present
1112

1213
- name: Configure SELinux to allow Apache to create outbound connections.

tasks/tarball_name.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,24 @@
1414
set_fact:
1515
aem_dispatcher_tarball_tokens:
1616
- "dispatcher"
17+
- "{{ aem_dispatcher_version }}"
1718
- "apache{{ apache_version | regex_replace('(\\d+\\.\\d+).*', '\\1') }}"
1819
- "{{ ansible_system | lower }}"
19-
- "{{ ansible_architecture | regex_replace('_', '-') }}"
20+
- "{{ ansible_architecture if aem_dispatcher_version is version('4.3.3', '>=')
21+
else ansible_architecture | regex_replace('_', '-') }}"
2022

21-
- name: Add SSL filename token.
23+
- name: Create SSL token name from used libssl version.
2224
set_fact:
23-
aem_dispatcher_tarball_tokens: "{{ aem_dispatcher_tarball_tokens + ['ssl'] }}"
25+
aem_dispatcher_ssl_token: "{{ 'ssl' + aem_dispatcher_libssl_version | regex_replace('(\\d+\\.\\d+).*', '\\1')
26+
if aem_dispatcher_version is version('4.3.3', '>=')
27+
else 'ssl' }}"
28+
when: aem_dispatcher_ssl_support
29+
30+
- name: Add SSL token to filename tokens.
31+
set_fact:
32+
aem_dispatcher_tarball_tokens: "{{ aem_dispatcher_tarball_tokens + [aem_dispatcher_ssl_token] }}"
2433
when: aem_dispatcher_ssl_support
2534

2635
- name: Build dispatcher tarball name.
2736
set_fact:
28-
aem_dispatcher_tarball_name: "{{ aem_dispatcher_tarball_tokens | join('-') }}-{{ aem_dispatcher_version }}.tar.gz"
37+
aem_dispatcher_tarball_name: "{{ aem_dispatcher_tarball_tokens | join('-') }}.tar.gz"

tasks/unpack_module.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
---
22
- name: Derive module filename from tarball name.
33
set_fact:
4-
_aem_dispatcher_module_filename:
5-
"{{ aem_dispatcher_tarball_name | regex_replace('(dispatcher-apache.*?)-.*-(.*).tar.gz', '\\1-\\2.so') }}"
4+
_aem_dispatcher_module_filename: >-
5+
{{ aem_dispatcher_tarball_name | regex_replace('(dispatcher)-([\d|\.]*)-(apache[\d|\.]*).*', '\1-\3-\2.so') }}
66
77
- name: Unpack Dispatcher module.
88
unarchive:
99
src: "{{ aem_dispatcher_download_path }}/{{ aem_dispatcher_tarball_name }}"
1010
remote_src: yes
11-
extra_opts: ["{{ _aem_dispatcher_module_filename }}"]
1211
dest: "{{ aem_dispatcher_module_path }}"
1312
mode: 0755
1413
owner: root

vars/family_RedHat.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
aem_dispatcher_module_path: /usr/lib64/httpd/modules
2-
_aem_dispatcher_apache_server_root: "{{ aem_dispatcher_apache_server_root | default(apache_server_root) | default('/etc/httpd') }}"
2+
_aem_dispatcher_apache_server_root: >-
3+
{{ aem_dispatcher_apache_server_root | default(apache_server_root) | default('/etc/httpd') }}
4+
5+
aem_dispatcher_libssl_version: >-
6+
{{ '1.1.1' if ansible_distribution_major_version is version('8', '>=') else '1.0.2k' }}

0 commit comments

Comments
 (0)