Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
RanabirChakraborty committed Mar 26, 2024
2 parents 5828d7c + 03532ff commit 0bd0603
Show file tree
Hide file tree
Showing 27 changed files with 106 additions and 87 deletions.
1 change: 1 addition & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# .ansible-lint
exclude_paths:
- bump-wildfly-version.sh
- .cache/
- .github/
- molecule/
Expand Down
27 changes: 27 additions & 0 deletions bump-wildfly-version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
To bump the versin of Wildfly use the script below:

#!/bin/bash
readonly CURRENT_VERSION=${1}
readonly NEW_VERSION=${2}

usage() {
echo ''
echo "ex: $(basename ${0}) 29.0. 31.0.1.Final."
}

if [ -z "${CURRENT_VERSION}" ]; then
echo 'Please provide the 5 first character of the current version.'
usage
exit 1
fi

if [ -z "${NEW_VERSION}" ]; then
echo 'Please provide the new version, including .Final'
usage
exit 2
fi

for file_to_edit in $(grep -e "${CURRENT_VERSION}" -r roles/ molecule/ | cut -f1 -d: | sort -u)
do
sed -e "s;${CURRENT_VERSION}.*.Final;${NEW_VERSION};g" -i "${file_to_edit}"
done
35 changes: 26 additions & 9 deletions molecule/colocated/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,38 @@
- name: Deploy first wildfly
import_playbook: ../../playbooks/playbook.yml
vars:
wildfly_node_id: wildfly-1
wildfly_instance_name: wildfly-1
wildfly_service_name: wildfly-1
id: 1
wildfly_node_id: "wildfly-{{ id }}"
wildfly_instance_name: "wildfly-{{ id }}"
wildfly_service_name: "wildfly-{{ id }}"
wildfly_config_base: standalone-ha.xml
wildfly_install_workdir: "/opt/wildfly-1"
wildfly_install_workdir: "/opt/wildfly-{{ id }}"
wildfly_home: "{{ wildfly_install_workdir }}/wildfly-{{ wildfly_version }}/"
wildfly_port_range_offset: "{{ 100 * (id -1) | int }}"
skip_db_driver: true

- name: Deploy second wildfly
import_playbook: ../../playbooks/playbook.yml
vars:
wildfly_node_id: wildfly-2
wildfly_instance_name: wildfly-2
wildfly_service_name: wildfly-2
id: 2
wildfly_node_id: "wildfly-{{ id }}"
wildfly_instance_name: "wildfly-{{ id }}"
wildfly_service_name: "wildfly-{{ id }}"
wildfly_config_base: standalone-ha.xml
wildfly_install_workdir: "/opt/wildfly-2"
wildfly_install_workdir: "/opt/wildfly-{{ id }}"
wildfly_home: "{{ wildfly_install_workdir }}/wildfly-{{ wildfly_version }}/"
wildfly_port_range_offset: 100
wildfly_port_range_offset: "{{ 100 * (id - 1) | int }}"
skip_db_driver: true

- name: Deploy third wildfly
import_playbook: ../../playbooks/playbook.yml
vars:
id: 3
wildfly_node_id: "wildfly-{{ id }}"
wildfly_instance_name: "wildfly-{{ id }}"
wildfly_service_name: "wildfly-{{ id }}"
wildfly_config_base: standalone-ha.xml
wildfly_install_workdir: "/opt/wildfly-{{ id }}"
wildfly_home: "{{ wildfly_install_workdir }}/wildfly-{{ wildfly_version }}/"
wildfly_port_range_offset: "{{ 100 * (id - 1) | int }}"
skip_db_driver: true
32 changes: 0 additions & 32 deletions molecule/colocated/prepare.yml

This file was deleted.

17 changes: 15 additions & 2 deletions molecule/colocated/verify.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
- name: Deploy first wildfly
- name: Validate first server
import_playbook: ../../playbooks/validate.yml
vars:
wildfly_node_id: wildfly-1
Expand All @@ -9,7 +9,8 @@
wildfly_install_workdir: "/opt/wildfly-1"
wildfly_home: "{{ wildfly_install_workdir }}/wildfly-{{ wildfly_version }}/"
skip_db_driver: true
- name: Deploy second wildfly

- name: Verify second server
import_playbook: ../../playbooks/validate.yml
vars:
wildfly_node_id: wildfly-2
Expand All @@ -20,3 +21,15 @@
wildfly_home: "{{ wildfly_install_workdir }}/wildfly-{{ wildfly_version }}/"
wildfly_port_range_offset: 100
skip_db_driver: true

- name: Verify third server
import_playbook: ../../playbooks/validate.yml
vars:
wildfly_node_id: wildfly-3
wildfly_instance_name: wildfly-3
wildfly_service_name: wildfly-3
wildfly_config_base: standalone-ha.xml
wildfly_install_workdir: "/opt/wildfly-3"
wildfly_home: "{{ wildfly_install_workdir }}/wildfly-{{ wildfly_version }}/"
wildfly_port_range_offset: 200
skip_db_driver: true
5 changes: 0 additions & 5 deletions molecule/prospero/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@
tasks:
- name: "Run Prospero scenario only upstream."
block:
- name: "Ensure required local user and group exists."
ansible.builtin.include_role:
name: wildfly_install
tasks_from: user.yml

- name: "Install server using Prospero"
ansible.builtin.include_role:
name: wildfly_install
Expand Down
3 changes: 3 additions & 0 deletions molecule/uninstall/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@
- vars.yml
roles:
- name: wildfly_uninstall
post_tasks:
- name: "Flush handlers to ensure they are executed"
ansible.builtin.meta: flush_handlers
4 changes: 2 additions & 2 deletions molecule/uninstall/vars.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
wildfly_uninstall_service_name: wildfly
wildfly_uninstall_home: /opt/wildfly/wildfly-29.0.0.Final
wildfly_uninstall_path_to_archive: /opt/wildfly/wildfly-29.0.0.Final.zip
wildfly_uninstall_home: /opt/wildfly/wildfly-31.0.1.Final
wildfly_uninstall_path_to_archive: /opt/wildfly/wildfly-31.0.1.Final.zip
2 changes: 1 addition & 1 deletion roles/wildfly_driver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Role Defaults
|:---------|:------------|:--------|
|`wildfly_driver_module_dir`| Path for module installation | `{{ wildfly_home }}/modules/{{ wildfly_driver_module_name | replace('.', '/') }}/main` |
|`wildfly_driver_jar_installation_path`| Path for jdbc driver installation | `{{ wildfly_driver_module_dir }}/{{ wildfly_driver_jar_filename }}` |
|`wildfly_version`| Wildfly version to install | `29.0.0.Final` |
|`wildfly_version`| Wildfly version to install | `31.0.1.Final` |
|`wildfly_home`| Wildfly installation directory | `/opt/wildfly/wildfly-{{ wildfly_version }}/` |
|`wildfly_user`| posix user account for wildfly | `wildfly` |
|`wildfly_group`| posix group for wildfly | `{{ wildfly_user }}` |
Expand Down
2 changes: 1 addition & 1 deletion roles/wildfly_driver/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
wildfly_user: 'wildfly'

Check warning on line 2 in roles/wildfly_driver/defaults/main.yml

View workflow job for this annotation

GitHub Actions / ci / linter (3.11, 2.15)

var-naming[no-role-prefix]

Variables names from within roles should use wildfly_driver_ as a prefix. (vars: wildfly_user)
wildfly_group: "{{ wildfly_user }}"

Check warning on line 3 in roles/wildfly_driver/defaults/main.yml

View workflow job for this annotation

GitHub Actions / ci / linter (3.11, 2.15)

var-naming[no-role-prefix]

Variables names from within roles should use wildfly_driver_ as a prefix. (vars: wildfly_group)
wildfly_version: '29.0.0.Final'
wildfly_version: '31.0.1.Final'

Check warning on line 4 in roles/wildfly_driver/defaults/main.yml

View workflow job for this annotation

GitHub Actions / ci / linter (3.11, 2.15)

var-naming[no-role-prefix]

Variables names from within roles should use wildfly_driver_ as a prefix. (vars: wildfly_version)
wildfly_home: "/opt/wildfly/wildfly-{{ wildfly_version }}/"

Check warning on line 5 in roles/wildfly_driver/defaults/main.yml

View workflow job for this annotation

GitHub Actions / ci / linter (3.11, 2.15)

var-naming[no-role-prefix]

Variables names from within roles should use wildfly_driver_ as a prefix. (vars: wildfly_home)
wildfly_driver_module_dir: "{{ wildfly_home }}/modules/{{ wildfly_driver.module_name | replace('.', '/') }}/main"
wildfly_driver_jar_installation_path: "{{ wildfly_driver_module_dir }}/{{ wildfly_driver_jar_filename }}"
2 changes: 1 addition & 1 deletion roles/wildfly_driver/meta/argument_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ argument_specs:
description: "Name for the jdbc driver module"
type: "str"
wildfly_version:
default: "29.0.0.Final"
default: "31.0.1.Final"
description: "Wildfly version to install"
type: "str"
wildfly_home:
Expand Down
2 changes: 1 addition & 1 deletion roles/wildfly_install/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Role Defaults

| Variable | Description | Default |
|:---------|:------------|:--------|
|`wildfly_version`| Wildfly version to install | `29.0.0.Final` |
|`wildfly_version`| Wildfly version to install | `31.0.1.Final` |
|`wildfly_archive_filename`| Wildfly download archive name | `wildfly-{{ wildfly_version }}.zip` |
|`wildfly_download_baseurl`| Base URL for wildfly download | `https://github.com/wildfly/wildfly/releases/download` |
|`wildfly_install_workdir`| Wildfly installation directory (where the server files are unzipped) | `/opt/wildfly/` |
Expand Down
2 changes: 1 addition & 1 deletion roles/wildfly_install/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
wildfly_version: '29.0.0.Final'
wildfly_version: '31.0.1.Final'

Check warning on line 2 in roles/wildfly_install/defaults/main.yml

View workflow job for this annotation

GitHub Actions / ci / linter (3.11, 2.15)

var-naming[no-role-prefix]

Variables names from within roles should use wildfly_install_ as a prefix. (vars: wildfly_version)
wildfly_archive_filename: "wildfly-{{ wildfly_version }}.zip"

Check warning on line 3 in roles/wildfly_install/defaults/main.yml

View workflow job for this annotation

GitHub Actions / ci / linter (3.11, 2.15)

var-naming[no-role-prefix]

Variables names from within roles should use wildfly_install_ as a prefix. (vars: wildfly_archive_filename)
wildfly_download_baseurl: 'https://github.com/wildfly/wildfly/releases/download'

Check warning on line 4 in roles/wildfly_install/defaults/main.yml

View workflow job for this annotation

GitHub Actions / ci / linter (3.11, 2.15)

var-naming[no-role-prefix]

Variables names from within roles should use wildfly_install_ as a prefix. (vars: wildfly_download_baseurl)
wildfly_install_workdir: '/opt/wildfly/'
Expand Down
2 changes: 1 addition & 1 deletion roles/wildfly_install/meta/argument_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ argument_specs:
main:
options:
wildfly_version:
default: "29.0.0.Final"
default: "31.0.1.Final"
description: "Wildfly version to install"
type: "str"
wildfly_archive_filename:
Expand Down
25 changes: 6 additions & 19 deletions roles/wildfly_prospero/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,30 +35,17 @@ Example Playbook
- name: Playbook to install Wildfly using Prospero
hosts: all
vars:
wildfly_install_user: 'wildfly'
wildfly_install_group: "{{ wildfly_install_user }}"
wildfly_install_use_prospero: True
wildfly_prospero_scenario_enable: True
collections:
- middleware_automation.wildfly
tasks:
- name: "Run Prospero scenario only upstream."
block:
- name: "Ensure required local user and group exists."
ansible.builtin.include_role:
name: wildfly_install
tasks_from: user.yml
- name: "Install server using Prospero"
ansible.builtin.include_role:
name: wildfly_install
- name: "Run server with systemd"
ansible.builtin.include_role:
name: wildfly_systemd
when:
- wildfly_prospero_scenario_enable is defined and wildfly_prospero_scenario_enable
- name: "Install server using Prospero"
ansible.builtin.include_role:
name: wildfly_install
- name: "Run server with systemd"
ansible.builtin.include_role:
name: wildfly_systemd
```

Author Information
Expand Down
2 changes: 1 addition & 1 deletion roles/wildfly_systemd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Role Defaults
|:---------|:------------|:--------|
|`wildfly_user`| posix user account for wildfly service | `wildfly` |
|`wildfly_group`| posix group for wildfly service | `{{ wildfly_user }}` |
|`wildfly_version`| Wildfly version to install | `29.0.0.Final` |
|`wildfly_version`| Wildfly version to install | `31.0.1.Final` |
|`wildfly_install_workdir`| Wildfly installation directory (where the server files are unzipped) | `/opt/wildfly/` |
|`wildfly_home`| Wildfly installation directory (WILDFLY_HOME) | `{{ wildfly_install_workdir }}wildfly-{{ wildfly_version }}/` |
|`wildfly_config_base`| Base standalone.xml config for instance | `standalone.xml` unless `wildfly_config_custom_file` is used |
Expand Down
2 changes: 1 addition & 1 deletion roles/wildfly_systemd/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
wildfly_user: 'wildfly'
wildfly_group: "{{ wildfly_user }}"
wildfly_version: '29.0.0.Final'
wildfly_version: '31.0.1.Final'
wildfly_install_workdir: '/opt/wildfly/'
wildfly_home: "{{ wildfly_install_workdir }}wildfly-{{ wildfly_version }}"
wildfly_config_base: 'standalone.xml'
Expand Down
2 changes: 1 addition & 1 deletion roles/wildfly_systemd/meta/argument_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ argument_specs:
description: "posix group for wildfly service"
type: "str"
wildfly_version:
default: "29.0.0.Final"
default: "31.0.1.Final"
description: "Wildfly version to install"
type: "str"
wildfly_install_workdir:
Expand Down
6 changes: 3 additions & 3 deletions roles/wildfly_uninstall/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Role Defaults
| Variable | Description | Default |
|:---------|:------------|:--------|
|`wildfly_uninstall_require_privileges_escalation`| Specifiy if the uninstallation process requires privileges escalation | `True` |
|`wildfly_uninstall_instance_name`| Instance name of the server to uninstall | `{{ instance_name | default('wildfly') }}` |
|`wildfly_uninstall_service_name`| Instance name of the server to uninstall | `{{ instance_name | default('wildfly') }}` |
|`wildfly_uninstall_home`| Path to server home | `{{ wildfly_home }}` |
|`wildfly_uninstall_systemd_service_file`| Path to the systemd configuration file associated to the server | `/usr/lib/systemd/system/{{ wildfly_uninstall_service_name }}.service` |
|`wildfly_uninstall_systemd_service_conf_file`| Path to the env file used by the systemd service associated to the server | `/etc/{{ wildfly_uninstall_service_name }}.conf` |
Expand Down Expand Up @@ -38,8 +38,8 @@ Role Variables
gather_facts: no
vars:
wildfly_uninstall_service_name: wildfly
wildfly_uninstall_home: /opt/wildfly/wildfly-29.0.0.Final
wildfly_uninstall_path_to_archive: /opt/wildfly/wildfly-29.0.0.Final.zip
wildfly_uninstall_home: /opt/wildfly/wildfly-31.0.1.Final
wildfly_uninstall_path_to_archive: /opt/wildfly/wildfly-31.0.1.Final.zip
roles:
- name: wildfly_uninstall
```
Expand Down
2 changes: 1 addition & 1 deletion roles/wildfly_uninstall/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
wildfly_uninstall_require_privileges_escalation: true
wildfly_uninstall_instance_name: "{{ instance_name | default('wildfly') }}"
wildfly_uninstall_service_name: "{{ wildfly_service_name | default('wildfly') }}"
wildfly_uninstall_home: "{{ wildfly_home }}"
wildfly_uninstall_systemd_service_file: "/usr/lib/systemd/system/{{ wildfly_uninstall_service_name }}.service"
wildfly_uninstall_systemd_service_conf_file: "/etc/{{ wildfly_uninstall_service_name }}.conf"
Expand Down
4 changes: 4 additions & 0 deletions roles/wildfly_uninstall/handlers/systemd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
- name: "Systemd Daemon Reload"
ansible.builtin.systemd:
daemon_reload: yes
2 changes: 1 addition & 1 deletion roles/wildfly_uninstall/meta/argument_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ argument_specs:
type: "bool"

# line 3 of defaults/main.yml
wildfly_uninstall_instance_name:
wildfly_uninstall_service_name:
default: "{{ instance_name | default('wildfly') }}"
description: "Instance name of the server to uninstall"
type: "str"
Expand Down
4 changes: 4 additions & 0 deletions roles/wildfly_uninstall/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,17 @@
path: "{{ wildfly_uninstall_systemd_service_conf_file }}"
when:
- wildfly_uninstall_systemd_service_conf_file
notify:
- "Systemd Daemon Reload"

- name: "Delete systemd env file ({{ wildfly_uninstall_systemd_service_file }})."
ansible.builtin.file:
state: absent
path: "{{ wildfly_uninstall_systemd_service_file }}"
when:
- wildfly_uninstall_systemd_service_file
notify:
- "Systemd Daemon Reload"

- name: "Delete user - if requested {{ wildfly_uninstall_delete_username }}"
ansible.builtin.user:
Expand Down
2 changes: 1 addition & 1 deletion roles/wildfly_utils/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jboss_cli_apply_cp_default_conflict_default: '--override-all'
wildfly_no_restart_after_patch: False
wildfly_user: wildfly
wildfly_group: "{{ wildfly_user }}"
wildfly_version: '29.0.0.Final'
wildfly_version: '31.0.1.Final'
wildfly_install_workdir: '/opt/wildfly/'
wildfly_home: "{{ wildfly_install_workdir }}wildfly-{{ wildfly_version }}/"
jboss_home: "{{ wildfly_home }}"
2 changes: 1 addition & 1 deletion roles/wildfly_utils/meta/argument_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ argument_specs:
description: "posix group for wildfly"
type: "str"
wildfly_version:
default: "29.0.0.Final"
default: "31.0.1.Final"
description: "Wildfly version to install"
type: "str"
wildfly_install_workdir:
Expand Down
2 changes: 1 addition & 1 deletion roles/wildfly_validation/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ wildfly_service_name: wildfly
wildfly_http_port: 8080
wildfly_https_port: 8443
wildfly_controller_port: 9990
wildfly_version: '29.0.0.Final'
wildfly_version: '31.0.1.Final'
wildfly_install_workdir: '/opt/wildfly/'
wildfly_home: "{{ wildfly_install_workdir }}wildfly-{{ wildfly_version }}/"
wildfly_validation_systemd_pidfile: "{{ wildfly_home }}/standalone/{{ wildfly_service_name }}.pid"
Expand Down
2 changes: 1 addition & 1 deletion roles/wildfly_validation/meta/argument_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ argument_specs:
description: "Server HTTPS port"
type: "str"
wildfly_version:
default: "29.0.0.Final"
default: "31.0.1.Final"
description: "Wildfly version to install"
type: "str"
wildfly_install_workdir:
Expand Down

0 comments on commit 0bd0603

Please sign in to comment.