remyma.springboot
Ansible Spring Boot
将 Spring Boot 应用程序部署为 Linux 服务。
需求
您的 Spring Boot 应用程序应该事先被打包成一个完全可执行的 JAR 文件,具体说明请参见:
角色变量
| 变量 | 默认值 | 说明 |
|---|---|---|
| springboot_java_install | true | 如果您希望该角色安装 Java。如果 Java 已安装,请使用 false |
| springboot_src_file | 必需或使用 springboot_src_url。要部署的 Spring Boot JAR 的路径。 |
|
| springboot_src_url | 必需或使用 springboot_src_file。要部署的 Spring Boot JAR 的 URL。 |
|
| springboot_application_name | 必需。Spring 应用程序名称。用于命名要部署的 JAR、systemd 服务等。 | |
| springboot_propertyfile_template | 可选。管理应用程序属性的模板路径(例如:application.properties、application.yml)。 | |
| springboot_configuration_template | 可选。管理应用程序配置的模板路径(请参见:https://docs.spring.io/spring-boot/docs/current/reference/html/deployment-install.html#deployment-script-customization-when-it-runs)。 | |
| springboot_deploy_folder | /opt/{{ springboot_application_name }} | 部署应用程序 JAR 的文件夹 |
| springboot_user | springboot | 运行 Spring Boot 应用程序的 Linux 用户 |
| springboot_group | springboot | 运行 Spring Boot 应用程序的 Linux 组 |
示例剧本
最小剧本:
- hosts: all
vars:
springboot_application_name: spring-boot-sample
springboot_src: tests/spring-boot-sample.jar
roles:
- role: ansible-springboot
如果您想要同时部署应用程序的配置和/或属性:
- hosts: all
vars:
springboot_application_name: spring-boot-sample
springboot_src: spring-boot-sample.jar
springboot_propertyfile_template: /path/to/your/template/application.yml
springboot_configuration_template: /path/to/your/template/spring-boot-sample.conf
roles:
- role: ansible-springboot
许可证
BSD
安装
ansible-galaxy install remyma.springboot许可证
Unknown
下载
487
拥有者
