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

Ansible guide - possible enhancements #33256

Open
rsvoboda opened this issue May 10, 2023 · 2 comments
Open

Ansible guide - possible enhancements #33256

rsvoboda opened this issue May 10, 2023 · 2 comments

Comments

@rsvoboda
Copy link
Member

rsvoboda commented May 10, 2023

Description

#32860 introduced Ansible guide recently. This guide describes deployment of Quarkus application built from sources and targeting JVM mode.

I have several ideas for enhancements:

0) OS
There is no info about target OS, systemd service indicates RHEL, Fedora to me. Maybe this could be clarified a bit.

1) JDK
The guide talks about OpenJDK being required. What about Temurin, Corretto, etc. ?
java-17-openjdk in mentioned in the listing. Is Java 11 allowed too?
Maybe it would be worth having a hint how to install JDK using Ansible.

2) Native mode
Can be middleware_automation.quarkus.playbook used to build and deploy Quarkus application as native binary?

3) Deploy of container image
Use-case: the app is already built and deployed into internal/external registry by a CI pipeline
Can be Ansible used to deploy such container into target environment and the containerized app executed as a service?

4) Deploy from (maven) repository
Use-case: the app is already built and deployed into internal/external (not only maven) repository by a CI pipeline
Can be Ansible used to deploy concrete version of the application from maven repository?
This can get tricky as Quarkus app is not just one binary by default in JVM mode. For native there is just one artifact, but can be deployed with different modifiers to indicate the target platform. For JVM mode would need to have fat jar or zip archive for simplicity.
And of course there could be more different inputs like Bitbucket, GitHub releases, this can get quite complex.

@rpelisse, can you look into it? I'm not able to set you as assignee

@maxandersen / @n1hility any other ideas/priorities around Ansible?

@quarkus-bot
Copy link

quarkus-bot bot commented May 10, 2023

/cc @MichalMaler (documentation), @ebullient (documentation), @hmanwani-rh (documentation), @inoxx03 (documentation), @michelle-purcell (documentation), @sheilamjones (documentation), @sunayna15 (documentation)

@rpelisse
Copy link
Contributor

@rsvoboda Regarding your suggestions / questions:

  1. Yes, we only support Fedora/RHEL bases distribution (RedHat family) for all the Ansible Middleware collections. However, we'll happily accept contributions to make our collections work on other operating systems.

Following your suggestion, on top of adding the information in the guide, I've also enhanced the collection to check that the target hosts are supported.

  1. The JDK version is a parameter, the name of the package to install. By default, the collection will install OpenJDK 17 using the RPM package java-17-openjdk. Installing Java 11 would just require the user to change the name to java-11-openjdk. We can add it to the guide, if you really feel it's important:
quarkus_java_package_version: java-11-openjdk

I've added a note to the guide with this information in PR33527

  1. I purposely did not add any support for native mode for this first version, but somebody confortable with Ansible will have no issue configuring the tools for this mode. I plan to do that down the road, once the guide is available (as it is) on the Quarkus.io and I (hopefully) get some feedback from users.

  2. To make it short, most people uses Ansible to deploy on bare-metal, VM and cloud. Container is really not the target. Yes, you can, the same way, you can deploy a Quarkus app on OpenVMS. Not sure we need a guide for that...

  3. Can be Ansible used to deploy concrete version of the application from maven repository?

Yes, you can use the ansible.builtin.get_url: primitive to download the app from the Maven repo and deploy it on the target.

- name: Download foo.conf
  ansible.builtin.get_url:
    url: http://maven.repo/path/app.jar
    dest: /opt/app.jar
    ...

We can mention that in the guide, if you want, but this is pretty obvious for anyone having a little bit of experience in Ansible.

(and we have to be careful to NOT turn this guide into a tutorial for Ansible).

Regarding all those scenarios:

For native there is just one artifact, but can be deployed with different modifiers to indicate the target platform. For JVM mode would need to have fat jar or zip archive for simplicity.
And of course there could be more different inputs like Bitbucket, GitHub releases, this can get quite complex.

This is where users can leverage existing features of Ansible (such as get_url: or the git: module) to build an automation fitting their need. The guide give a simple introduction to the Ansible collection for Quarkus and how to use it. I don't think it should aim at covering Ansible features.

Maybe we can add some links to the Ansible documentation to cover that? (here again, we have to keep in mind the goal is not write a tutorial about Ansible, but just give the few details specific to Quarkus).

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

No branches or pull requests

3 participants