Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
1t5j0y committed Jan 15, 2024
1 parent 6a77079 commit ad18c98
Show file tree
Hide file tree
Showing 7 changed files with 392 additions and 3 deletions.
11 changes: 11 additions & 0 deletions configure/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ 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"}'

rwb-prod: 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_prod_avni_servers.yml -i inventory/rwb_prod --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 @@ -105,6 +109,9 @@ rules-server-prod: check-app-zip-path check-vault-pwd-file
rules-server-rwb-staging: check-app-zip-path check-vault-pwd-file
APPLICATION_ZIP_PATH=$(app_zip_path) APPLICATION_ZIP_FILE_NAME=rules-server.tgz ansible-playbook rwb_staging_rules_server.yml -i inventory/rwb_staging --vault-password-file ${VAULT_PASSWORD_FILE}

rules-server-rwb-prod: check-app-zip-path check-vault-pwd-file
APPLICATION_ZIP_PATH=$(app_zip_path) APPLICATION_ZIP_FILE_NAME=rules-server.tgz ansible-playbook rwb_prod_rules_server.yml -i inventory/rwb_prod --vault-password-file ${VAULT_PASSWORD_FILE}

decrypt: check-vault-pwd-file
cp group_vars/prod-secret-vars.yml.enc group_vars/prod-secret-vars.yml
cp group_vars/staging-secret-vars.yml.enc group_vars/staging-secret-vars.yml
Expand Down Expand Up @@ -157,6 +164,10 @@ etl-rwb-staging: 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 rwb_staging_etl_servers.yml -i inventory/rwb_staging --vault-password-file ${VAULT_PASSWORD_FILE} \
--extra-vars '{"java_apt_package":"openjdk-17-jdk"}'

etl-rwb-prod: 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 rwb_prod_etl_servers.yml -i inventory/rwb_prod --vault-password-file ${VAULT_PASSWORD_FILE} \
--extra-vars '{"java_apt_package":"openjdk-17-jdk"}'

metabase-onpremise:
ansible-playbook onpremise_metabase_servers.yml -i inventory/onpremise --vault-password-file ${VAULT_PASSWORD_FILE}

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

Large diffs are not rendered by default.

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

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

### Integration server variables
int_appserver_app_url: "etl.rwb.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.rwb.avniproject.org"

bugsnag_stage: "prod"

etl_allowed_origins: "https://app.rwb.avniproject.org,https://etl.rwb.avniproject.org"
avni_idp_type: "cognito"
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_db_host: "serverdb.rwb.avniproject.org."
avni_server_db_port: "5432"
avni_server_db_schema: "public"
avni_server_mode: "live"
avni_server_media_bucket_name: "rwb-prod-user-media"
avni_server_static_content_path: "/var/www/avni_server/"
avni_server_minio_enabled: "false"
avni_server_minio_url: "https://minio.rwb.avniproject.org:442"
avni_server_bugsnag_release_stage: "prod"
avni_server_keycloak_url: "https://keycloak.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.rwb.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: "production"
newrelic_agent_enabled: "true"
newrelic_application_logging_enabled: "false"
newrelic_distributed_tracing_enabled: "false"

#java_apt_package: openjdk-17-jdk #for ETL. Comment for avni-server
6 changes: 3 additions & 3 deletions configure/inventory/rwb_prod
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@


[webservers]
int-prod.rwb.avniproject.org ansible_user=ubuntu ansible_port=22 ansible_ssh_private_key_file=~/.ssh/rwb-infra.pem
etl.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
ssh.app.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
etl.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_prod_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_prod_vars.yml
- group_vars/rwb_prod-secret-vars.yml.enc
roles:
- base
- security
- jdk
- newrelic
- avni_web
- avni_appserver
21 changes: 21 additions & 0 deletions configure/rwb_prod_etl_servers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---

- 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_prod_vars.yml
- group_vars/rwb_prod-secret-vars.yml.enc
roles:
- base # Required if int server is not pre deployed.
- security # Required if int server is not pre deployed.
- jdk # Required if int server is not pre deployed.
- nginx # Required if int server is not pre deployed.
- certbot # Required if int server is not pre deployed.
- etl_appserver
- nginx_appserver
18 changes: 18 additions & 0 deletions configure/rwb_prod_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_prod_vars.yml
- group_vars/rwb_prod-secret-vars.yml.enc
roles:
- base
- rules_server

0 comments on commit ad18c98

Please sign in to comment.