Skip to content

Commit

Permalink
avniproject/avni-server#813 | Install JDK during deploy_app_to_server…
Browse files Browse the repository at this point in the history
…s only when vars is set
  • Loading branch information
himeshr committed Dec 17, 2024
1 parent 41b4b84 commit 2eb4dae
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion configure/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ deploy-int-webapp-prod: check-web-zip-path check-vault-pwd-file

deploy-avni-server-staging: check-app-zip-path check-vault-pwd-file
APPLICATION_ZIP_PATH=$(app_zip_path) APPLICATION_ZIP_FILE_NAME=avni-server-0.0.1-SNAPSHOT.jar ansible-playbook deploy_app_to_servers.yml -i inventory/staging --vault-password-file ${VAULT_PASSWORD_FILE} \
--extra-vars '{"java_apt_package":"openjdk-21-jdk","deploy_app_name":"avni","deploy_app_hosts":"avniservers","deploy_app_remote_user":"avni-server-user","deploy_app_env":"staging","deploy_app_role":"avni_appserver","deploy_app_env_vars_file":"group_vars/staging_vars.yml","deploy_app_env_secret_vars_file":"group_vars/staging-secret-vars.yml.enc"}'
--extra-vars '{"install_jdk":"true","java_apt_package":"openjdk-21-jdk","deploy_app_name":"avni","deploy_app_hosts":"avniservers","deploy_app_remote_user":"avni-server-user","deploy_app_env":"staging","deploy_app_role":"avni_appserver","deploy_app_env_vars_file":"group_vars/staging_vars.yml","deploy_app_env_secret_vars_file":"group_vars/staging-secret-vars.yml.enc"}'

deploy-avni-server-prod: check-app-zip-path check-vault-pwd-file
APPLICATION_ZIP_PATH=$(app_zip_path) APPLICATION_ZIP_FILE_NAME=avni-server-0.0.1-SNAPSHOT.jar ansible-playbook deploy_app_to_servers.yml -i inventory/prod --vault-password-file ${VAULT_PASSWORD_FILE} \
Expand Down
4 changes: 2 additions & 2 deletions configure/deploy_app_to_servers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
remote_user: "{{ deploy_app_remote_user }}"
vars:
update_apt_cache: yes
install_jdk: false
vars_files:
- group_vars/basic_vars.yml
- "{{ deploy_app_env_vars_file }}"
- "{{ deploy_app_env_secret_vars_file }}"
roles:
- jdk
- role: jdk
when: install_jdk
- "{{ deploy_app_role }}"
2 changes: 0 additions & 2 deletions configure/group_vars/basic_vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ project_name: avni
letsencrypt_email: [email protected]
avni_cache_dir: /var/cache/avni

install_jdk: true

## Integration server variables
int_appserver_application_name: avni-int-service
int_appserver_port: 6013
Expand Down
4 changes: 1 addition & 3 deletions configure/roles/jdk/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
---
- name: Pre-install Java JDK
include_tasks: java_pre.yml
when: install_jdk

- name: Install Java JDK
include_tasks: java_install.yml
when: install_jdk
include_tasks: java_install.yml

0 comments on commit 2eb4dae

Please sign in to comment.