Coder Social home page Coder Social logo

orachide / ansible-role-springboot Goto Github PK

View Code? Open in Web Editor NEW
39.0 4.0 17.0 14.71 MB

Ansible role that install Spring boot application as a service. Support init.d & Systemd

Python 100.00%
ansible-role spring-boot systemd systemv spring-boot-application

ansible-role-springboot's Introduction

Hi there ๐Ÿ‘‹

  • ๐Ÿ”ญ Iโ€™m currently working on Yalendar it's an alternative to Calendly
  • ๐Ÿ”ญ Iโ€™m currently working on Dinivas: Dinivas manage your private Cloud (OpenStack) infrastructure by providing many features based on popular Open Source projects

Dinivas

  • โšก Creator of Most popular Ansible Role for Spring Boot services on Ansible Galaxy

Ansible Role SpringBoot

ansible-role-springboot's People

Contributors

anagypitech avatar orachide avatar simbo1905 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ansible-role-springboot's Issues

running the latest code complained of no `sb_users_definition` and `sb_user_groups_definitions`

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"

Support additional environment variables in the app.conf.j2 file

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.

Using `sb_app_as_a_service: false` will break `task/uninstall.yml`

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 [ Install | Copy application artifact file]

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

Previous application version is not decommissioned

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.

be able to move microservices

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.

add daemon-reload in service

add in file tasks/service.yml

  • name: "Service | Ensure {{ sb_app_name }} service is started"
    service:
    name: "{{ sb_app_name | lower }}"
    enabled: yes
    daemon_reload: yes
    state: started
    become: true

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.