Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor deploy_wildfly to use wildfly_systemd role provided by middleware_automation.jcliff collection #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

rpelisse
Copy link

This refactoring removes a few operations that are already provided by the wildfly_systemd role coming with the middleware_automation.jcliff collection. I also removed the yum update part to place it into a separate role.

I've tested this changes locally, inside a Podman container, so you may need to tweak a bit for it to work on EC2.

Note: for this change to work, you need to install the collection first:

$ ansible-galaxy collection install middleware_automation.jcliff collection

recurse: yes
owner: jboss
group: jboss
state: present

# Add the WildFly distribution to /opt, and make wildfly the owner of the extracted tar content
- name: Download and Add WildFly distribution
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kahlai The download Wildfly part I did not change, but I think it needs a rehaul. First, I would not download and directly unzip into jboss_home. It's not idempotent and you need to download the archive every time you run the tasks, even if the content is already deployed.
I would move the download part into the pre_tasks: part of the playbook and save the archive in something like /opt/apps or /opt/artefacts. Then, inside the role, I would check that wildfy_archive is defined and if so unarchive: the zipfile into jboss_home.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, the series of commands in shell: are a bit cluncky. If you have that many commands to run, I would move that into a proper Bash script that I would then run. I also think Ansible has mechanisms to check the sha1sum, decompress tar file and ensure jboss:jboss is the owner of the file.
We are doing just that in this playbook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant