orachide / ansible-role-springboot Goto Github PK
View Code? Open in Web Editor NEWAnsible role that install Spring boot application as a service. Support init.d & Systemd
Ansible role that install Spring boot application as a service. Support init.d & Systemd
There are cases where folks won't want to use a system demon to keep their processes up. In which case they can set sb_app_as_a_service: false
. That breaks some install tasks I have sent a PR for that. Then there are many steps in uninstall.yml
that assume that there are files or symlinks in the system folder that aren't there. They need an additional check in when for sb_app_as_a_service != False
TASK [orachide.springboot-service : Install | Copy application artifact file]
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: If you are using a module and expect the file to exist on the remote, see the remote_src option
fatal: [target_server]: FAILED! => {"changed": false, "msg": "Could not find or access '/tmp/deploy-from/app-1.0.0.war' on the Ansible Controller.\nIf you are using a module and expect the file to exist on the remote, see the remote_src option"}
Thank you for this module. I'm just having some issues, is there a way to flag this variable sb_app_artifact_file to look on the target server instead of on the Ansible Controller ?
I've attached my main.yaml
main.txt
When an existing version of the application is runnning(e.g.: 1.0.0) and new version 1.0..1 is beeing deployed, I would expect the instanvce running the previous version to be stopped and a new instance with the new version to be started.
Actually, I can still see the previous version running after the playbook is run successfully.
There are situations when environment variables are needed and it cannot be added into the JAVA_OPTS variable.
Example: LOGGING_PATH in Spring Boot.
A very quick and simple solution can be to have a sb_app_env
(with array having name and value) config parameter.
The app.conf.j2 file can be modified and these rows can be added to the end of the file:
{% for item in sb_app_env %}
{{item.name}}="{{item.value | regex_replace('"', '\\"')}}"
{% endfor %}
This feature add much more flexibility to the project.
Running the latest code complained that there was no sb_users_definition
or sb_user_groups_definitions
. Googling I managed to find some examples. My playbooks work with:
sb_users_definition:
- name: Simple Spring Boot App User
username: sbuser
groups: [sbgroup]
sb_user_groups_definitions:
- name: sbgroup
sb_app_user: sbuser
sb_app_user_group: sbgroup
Note that it requires the list definitions to create the users and groups then a specific user and group to use.
The check_vars.yml
didn't check those variables are there so I added that myself with:
- name: "Check vars | Assert sb_users_definition is defined"
assert:
that:
- "sb_users_definition is defined"
msg: "sb_users_definition must be defined"
- name: "Check vars | Assert sb_user_groups_definitions is defined"
assert:
that:
- "sb_user_groups_definitions is defined"
msg: "sb_user_groups_definitions must be defined"
add in file tasks/service.yml
Currently, whether to install or install is based upon sb_app_state == 'present'
or sb_app_state == 'absent'
. By default that is set in defaults\main.yml
as 'present'
. We deploy many microservices to many VMs but not all VMs run all microservices and we would like to be able to move microservices between VMs to rebalance load. So we want an easy way to set sb_app_state both
per host and per microservice.
We have come up with this check that is checking whether the current hostname is in a per microservice list.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.