Skip to content

Update Variables

Rajesh Rajendran edited this page Nov 28, 2017 · 17 revisions

Notes

Sunbird has 2 repositories.

  1. Public
  2. Private

While public(Project-sunbird) repository contains the infra sourcecode, private(ekstep/sunbird-devops) contains our infra specific inventory and group vars.

All of these points are applicable to dev/staging environments

Variables can be found in below locations

  • project-sunbird/sunbird-devops/roles/stack-sunbird/defaults/main.yml

  • ekstep/sunbird-devops/inventories/{{ env }}/group_vars/main.yml

  • ekstep/sunbird-devops/inventories/{{ env }}/secrets.yml

  • project-sunbird/sunbird-devops/ansible/roles/stack-sunbird/templates/{{ service_name }}.env

Variables: General guidelines

If you're updating a new variable in the code, then please follow guidelines.

  • All user defined variables must be initialized in project-sunbird/sunbird-devops/roles/stack-sunbird/defaults/main.yml

    example

    sunbird_actor_system_name: ""
    
  • Static values can be hard-coded in project-sunbird/sunbird-devops/ansible/roles/stack-sunbird/templates/{{ service_name }}.env

    example

    sunbird_version: "1.2.3"
    
  • Platform dependant values must defined in ekstep/sunbird-devops/inventories/{{ env }}/group_vars/main.yml

    example

    sunbird_version: "1.2.3"
    
  • All secrets must be preceded with vault_ and declare in sunbird-devops/ansible/roles/stack-sunbird/templates/{{ service_name }}.env

    example

    application_password: "{{vault_application_password}}"
    

    Actual secret have to be defined in ekstep/sunbird-devops/inventories/{{ env }}/secrets.yml

    ansible-vault edit ekstep/sunbird-devops/inventories/{{ env }}/secrets.yml
    
    vault_application_password: sample_password_123
    
  • All variables must be defined in setup.md in respective repositories

    example

    release-1.2:
    var1 : this variable is for functionality
    var2 : this variable is for functionality 2
    
    release-1.3
    var3 : this variable is to enable custom functionality
    var4 : this variable is to configure another functionality