Skip to content

Commit

Permalink
avniproject/avni-product#1445 | RWB staging env
Browse files Browse the repository at this point in the history
  • Loading branch information
1t5j0y committed Jan 9, 2024
1 parent 31fe8b9 commit 4117f59
Show file tree
Hide file tree
Showing 8 changed files with 401 additions and 0 deletions.
12 changes: 12 additions & 0 deletions configure/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ avni-prod: check-web-zip-path check-app-zip-path check-vault-pwd-file
avni-onpremise: check-web-zip-path check-app-zip-path check-vault-pwd-file
WEBAPP_ZIP_PATH=$(web_zip_path) WEBAPP_ZIP_FILE_NAME=avni-webapp.tgz APPLICATION_ZIP_PATH=$(app_zip_path) APPLICATION_ZIP_FILE_NAME=avni-server-0.0.1-SNAPSHOT.jar ansible-playbook onpremise_avni_servers.yml -i inventory/onpremise --vault-password-file ${VAULT_PASSWORD_FILE}

rwb-staging: check-web-zip-path check-app-zip-path check-vault-pwd-file
WEBAPP_ZIP_PATH=$(web_zip_path) WEBAPP_ZIP_FILE_NAME=avni-webapp.tgz APPLICATION_ZIP_PATH=$(app_zip_path) APPLICATION_ZIP_FILE_NAME=avni-server-0.0.1-SNAPSHOT.jar ansible-playbook rwb_staging_avni_servers.yml -i inventory/rwb_staging --vault-password-file ${VAULT_PASSWORD_FILE} \
--extra-vars '{"application_user":"avni-server-user"}'

configure-reverse-proxy:
ansible-playbook reverse_proxy_server.yml -i inventory/onpremise

Expand Down Expand Up @@ -110,6 +114,10 @@ decrypt: check-vault-pwd-file
ansible-vault decrypt group_vars/vagrant-secret-vars.yml --vault-password-file ${VAULT_PASSWORD_FILE}
ansible-vault decrypt group_vars/onpremise-secret-vars.yml --vault-password-file ${VAULT_PASSWORD_FILE}

decrypt_env: check-vault-pwd-file
cp group_vars/$(env)-secret-vars.yml.enc group_vars/$(env)-secret-vars.yml
ansible-vault decrypt group_vars/$(env)-secret-vars.yml --vault-password-file ${VAULT_PASSWORD_FILE}

encrypt: check-vault-pwd-file
ansible-vault encrypt group_vars/prod-secret-vars.yml --vault-password-file ${VAULT_PASSWORD_FILE}
ansible-vault encrypt group_vars/staging-secret-vars.yml --vault-password-file ${VAULT_PASSWORD_FILE}
Expand All @@ -122,6 +130,10 @@ encrypt: check-vault-pwd-file
cp group_vars/vagrant-secret-vars.yml group_vars/vagrant-secret-vars.yml.enc
cp group_vars/onpremise-secret-vars.yml group_vars/onpremise-secret-vars.yml.enc

encrypt_env: check-vault-pwd-file
ansible-vault encrypt group_vars/$(env)-secret-vars.yml --vault-password-file ${VAULT_PASSWORD_FILE}
cp group_vars/$(env)-secret-vars.yml group_vars/$(env)-secret-vars.yml.enc

etl-onpremise: check-app-zip-path check-vault-pwd-file
APPLICATION_ZIP_PATH=$(app_zip_path) APPLICATION_ZIP_FILE_NAME=etl-1.0.0-SNAPSHOT.jar ansible-playbook onpremise_etl_servers.yml -i inventory/onpremise --vault-password-file ${VAULT_PASSWORD_FILE}

Expand Down
245 changes: 245 additions & 0 deletions configure/group_vars/rwb_staging-secret-vars.yml.enc

Large diffs are not rendered by default.

76 changes: 76 additions & 0 deletions configure/group_vars/rwb_staging_vars.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
---

env: staging
#Common variables
ufw_allowed_ports:
- "22"
- "80"
- "443"
- "3000"
- "8021"

### Integration server variables
#int_appserver_app_url: "int-staging.avniproject.org"
#goonj_sf_app_url: "https://goonj--patialv1.sandbox.my.salesforce.com/services/apexrest/v1"
#goonj_sf_auth_url: "https://test.salesforce.com/services/oauth2/token"
#goonj_sf_media_url_prefix: "https://staging.avniproject.org/web/media?url="
#amrit_server_url: "http://amritwprdev.piramalswasthya.org:8080"
#goonj_schedule_cron: "0 0/10 * * * ?"
#power_schedule_cron: "0 0 * * * ?"
#amrit_schedule_cron: "0 0/2 * * * ?"
#goonj_app_tasks: "all"
#amrit_app_tasks: "None"
#goonj_recreate_dispatch_receipt: "true"
#lahi_glific_gcp_project_id: "glific-lms-lahi"
#lahi_glific_gcp_dataset_name: "918956411022"
#lahi_glific_gcp_project_credentials_path: "/etc/lahi_glific_gcp_bigquery_conf.json"
#lahi_avni_api_url: "https://app.avniproject.org"
#lahi_schedule_cron: "0 0/5 * * * ?"

## ETL server variables
etl_appserver_app_url: "etl-staging.rwb.avniproject.org"

bugsnag_stage: "staging"

etl_allowed_origins: "https://staging.rwb.avniproject.org,https://etl-staging.rwb.avniproject.org"
avni_idp_type: "both"
scheduled_job_trigger_misfire_threshold: "2700000"
scheduled_job_repeat_interval: "60"
avni_server_host: "localhost"
avni_server_port: "8021"
#avni_server_opts: " -Dnewrelic.environment={{ newrelic_environment }} -javaagent:/opt/newrelic/newrelic.jar -Dlogging.file={{avni_server_access_log_dir}}/chs.log -Dlogging.path={{avni_server_access_log_dir}} -Dlogging.file.max-size=5mb -Xmx1512m -XX:ErrorFile={{avni_server_access_log_dir}}/jvm.log -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 -XX:-OmitStackTraceInFastThrow"
avni_server_opts: " -Dlogging.file={{avni_server_access_log_dir}}/chs.log -Dlogging.path={{avni_server_access_log_dir}} -Dlogging.file.max-size=5mb -Xmx1512m -XX:ErrorFile={{avni_server_access_log_dir}}/jvm.log -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 -XX:-OmitStackTraceInFastThrow"
avni_server_db_host: "stagingdb.rwb.avniproject.org."
avni_server_db_port: "5432"
avni_server_db_schema: "public"
avni_server_mode: "staging"
avni_server_media_bucket_name: "rwb-staging-user-media"
avni_server_static_content_path: "/var/www/avni_server/"
avni_server_minio_enabled: "false"
avni_server_minio_url: "https://minio-staging.rwb.avniproject.org:442"
avni_server_bugsnag_release_stage: "staging"
avni_server_keycloak_url: "https://keycloak-staging.rwb.avniproject.org"
avni_server_keycloak_enabled: "false"
avni_server_access_log_dir: "/var/log/avni_server"
avni_server_cache_max_entries: "100"
avni_server_cache_ttl_seconds: "600"
avni_server_cache_max_weight: "1000"
avni_server_show_sql: "false"
avni_server_idp_type: "cognito"
avni_server_etl_service_origin: "https://etl-staging.avniproject.org/etl"
avni_csrf_enabled: "false"
avni_web_validhosts: ""
openchs_csp_enabled: "false"
openchs_csp_allowed_hosts: ""
avni_enhanced_validation: "false"
avni_blacklisted_urls: '["/profile/**", "/manifest.json"]'
avni_blacklisted_urls_file_path: "/etc/avni_blacklisted_urls.json"
avni_send_exception_in_response: "true"
avni_webapp_timeout: "21600"
avni_server_legacy_longitudinal_export_limit: "30000"

#newrelic_app_name: "avni"
#newrelic_environment: "staging"
#newrelic_agent_enabled: "false"
#newrelic_application_logging_enabled: "false"
#newrelic_distributed_tracing_enabled: "false"
10 changes: 10 additions & 0 deletions configure/inventory/rwb_prod
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@


[webservers]
int-prod.rwb.avniproject.org ansible_user=ubuntu ansible_port=22 ansible_ssh_private_key_file=~/.ssh/rwb-infra.pem

[avniservers]
ssh.prod.rwb.avniproject.org ansible_user=ubuntu ansible_port=22 ansible_ssh_private_key_file=~/.ssh/rwb-infra.pem

[etlservers]
int-prod.rwb.avniproject.org ansible_user=ubuntu ansible_port=22 ansible_ssh_private_key_file=~/.ssh/rwb-infra.pem
5 changes: 5 additions & 0 deletions configure/inventory/rwb_staging
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[avniservers]
ssh.staging.rwb.avniproject.org ansible_user=ubuntu ansible_port=22 ansible_ssh_private_key_file=~/.ssh/rwb-infra.pem

[etlservers]
etl-staging.rwb.avniproject.org ansible_user=ubuntu ansible_port=22 ansible_ssh_private_key_file=~/.ssh/rwb-infra.pem
20 changes: 20 additions & 0 deletions configure/rwb_staging_avni_servers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---

- name: Configure avni servers
hosts: avniservers
become: yes
become_user: root
remote_user: "{{ avni_appserver_user }}"
vars:
update_apt_cache: yes
vars_files:
- group_vars/basic_vars.yml
- group_vars/rwb_staging_vars.yml
- group_vars/rwb_staging-secret-vars.yml.enc
roles:
# - base
# - security
# - jdk
## - newrelic
# - avni_web
- avni_appserver
15 changes: 15 additions & 0 deletions configure/rwb_staging_etl_servers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---

- name: Configure etl servers
hosts: etlservers
become: yes
become_user: root
remote_user: "{{ etl_appserver_user }}"
vars:
update_apt_cache: yes
vars_files:
- group_vars/basic_vars.yml
- group_vars/rwb_staging_vars.yml
- group_vars/rwb-staging-secret-vars.yml.enc
roles:
- etl_appserver
18 changes: 18 additions & 0 deletions configure/rwb_staging_rules_server.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---

- name: Configure rules server
hosts: avniservers
become: yes
become_user: root
remote_user: "{{ application_user }}"
tags:
- rules-server
vars:
update_apt_cache: yes
vars_files:
- group_vars/basic_vars.yml
- group_vars/rwb_staging_vars.yml
- group_vars/rwb-staging-secret-vars.yml.enc
roles:
- base
- rules_server

0 comments on commit 4117f59

Please sign in to comment.