Commit c8df999e authored by root's avatar root
Browse files

update ansible_workspace_dir

parents
No related merge requests found
Showing with 423 additions and 0 deletions
+423 -0
proto: https
proxy_server_name: #domain name
sunbird_env: dev #rnvronment
docker_hub_url: #dockerhub url
env_files_dir: /wingspan_env_files
# COMPOSE FILES DIR
compose_files_dir: /wingspan_compose_files
# Config files dir
config_files_dir: /wingspan_config_files
# Secret files dir
docker_secret_files_dir: /wingspan_docker_secret_location
mysql_host: #mysql server IP
mysql_username: #mysql username
mysql_password: #mysql password
elastic_host: #elasticsearch IP
elastic_username: #elasticsearch username
elastic_password: #elasticsearch password
kafka_host: #kafka IP
memory_t: 128M
memory_xs: 256M
memory_s: 512M
memory_m: 1024M
memory_l: 2048M
memory_xl: 4096M
service_replicas_form_service: 1
service_mem_reserved_form_service: "{{ memory_m }}"
service_mem_limit_form_service: "{{ memory_l }}"
force_reload_form_service: true
service_replicas_user_service: 1
service_mem_reserved_user_service: "{{ memory_m }}"
service_mem_limit_user_service: "{{ memory_l }}"
force_reload_user_service: true
service_replicas_gateway_service: 1
service_mem_reserved_gateway_service: "{{ memory_m }}"
service_mem_limit_gateway_service: "{{ memory_l }}"
force_reload_gateway_service: true
service_replicas_web_service: 1
service_mem_reserved_web_service: "{{ memory_m }}"
service_mem_limit_web_service: "{{ memory_l }}"
force_reload_web_service: true
proxy_reservation_memory: "{{ memory_xs }}"
proxy_limit_memory: "{{ memory_s }}"
proxy_replicas: 1
form_logs_path: /mydata/logs/form
gateway_logs_path: /mydata/logs/gateway
web_logs_path: /mydata/logs/web
user_logs_path: /mydata/logs/user
publish_ports: false
var_docker_deploy_node_type: manager
cloud_type: azure #Cloud provider
storage_key: # cloud storage key
storage_secret: #loud storage secret
container_name: upsmf-data
#update SSL Key
core_vault_proxy_site_key: |+
#update SSL cert
core_vault_proxy_site_crt: |+
[dev]
10.4.0.4
[all:vars]
ansible_connection=ssh
ansible_ssh_user=ubuntu
ansible_ssh_private_key_file=/var/lib/jenkins/secrets/ubuntu.pem
---
# - hosts: "app_north_virginia_lex_dev"
- hosts: "{{ deploy_host_name }}"
become: yes
strategy: free
vars_files:
- "vars/main.yml"
roles:
- role: deploy-web-service
tags: [deploy-web-service]
- role: deploy-form-service
tags: [deploy-form-service]
- role: deploy-user-service
tags: [deploy-user-service]
- role: deploy-gateway-service
tags: [deploy-gateway-service]
- role: stack-proxy
tags: [stack-proxy]
# tasks:
# - name: Remove the env directory
# file:
# path: "{{ env_files_dir }}"
# state: absent
Role Name
=========
A brief description of the role goes here.
Requirements
------------
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
Role Variables
--------------
A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.
Dependencies
------------
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
Example Playbook
----------------
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
- hosts: servers
roles:
- { role: username.rolename, x: 42 }
License
-------
BSD
Author Information
------------------
An optional section for the role authors to include contact information, or a website (HTML is not allowed).
---
# defaults file for deploy-sb-ext
\ No newline at end of file
---
# handlers file for deploy-sb-ext
\ No newline at end of file
galaxy_info:
author: your name
description: your description
company: your company (optional)
# If the issue tracker for your role is not on github, uncomment the
# next line and provide a value
# issue_tracker_url: http://example.com/issue/tracker
# Some suggested licenses:
# - BSD (default)
# - MIT
# - GPLv2
# - GPLv3
# - Apache
# - CC-BY
license: license (GPLv2, CC-BY, etc)
min_ansible_version: 1.2
# If this a Container Enabled role, provide the minimum Ansible Container version.
# min_ansible_container_version:
# Optionally specify the branch Galaxy will use when accessing the GitHub
# repo for this role. During role install, if no tags are available,
# Galaxy will use this branch. During import Galaxy will access files on
# this branch. If Travis integration is configured, only notifications for this
# branch will be accepted. Otherwise, in all cases, the repo's default branch
# (usually master) will be used.
#github_branch:
#
# platforms is a list of platforms, and each platform has a name and a list of versions.
#
# platforms:
# - name: Fedora
# versions:
# - all
# - 25
# - name: SomePlatform
# versions:
# - all
# - 1.0
# - 7
# - 99.99
galaxy_tags: []
# List tags for your role here, one per line. A tag is a keyword that describes
# and categorizes the role. Users find roles by searching for tags. Be sure to
# remove the '[]' above, if you add tags to this list.
#
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
# Maximum 20 tags per role.
dependencies: []
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.
\ No newline at end of file
---
- name: Ensure env directory exists
file:
path: "{{ env_files_dir }}"
state: directory
- name: Create and save env template
template:
src: "{{ template_env_file_name }}"
dest: "{{ env_file_deployment_location }}"
---
- name: Ensure compose files directory exists
file:
path: "{{ compose_files_dir }}"
state: directory
\ No newline at end of file
- name: Create and move {{ user_friendly_name }} template
template:
src: "{{ template_compose_file_name }}"
dest: "{{ compose_file_deployment_location }}"
\ No newline at end of file
- name: Deploy {{ user_friendly_name }}
shell: docker stack deploy --with-registry-auth -c {{ compose_file_deployment_location }} {{ docker_service_stack_name }}
---
# tasks file for deploy-sb-ext
- import_tasks: create-and-save-env-file.yml
- import_tasks: create-compose-dir.yml
- import_tasks: create-compose-file.yml
- import_tasks: remove-existing-service.yml
- import_tasks: deploy-service.yml
- import_tasks: remove-compose-file.yml
# - import_tasks: remove-env-file.yml
\ No newline at end of file
---
- name: Remove the compose file from the location
file:
path: "{{ compose_file_deployment_location }}"
state: absent
\ No newline at end of file
---
- name: Remove the env file
file:
path: "{{ env_file_deployment_location }}"
state: absent
\ No newline at end of file
---
- name: Removing the existing service
shell: docker service rm {{ docker_service_stack_name }}_{{ docker_service_name }}
when: "force_reload==true"
ignore_errors: true
\ No newline at end of file
version: '3.7'
services:
{{ docker_service_name }}:
image: {{ docker_hub_url }}/{{ image_name }}:{{ tag }}
hostname: "{{ docker_service_name }}"
{% if publish_ports == true %}
ports:
- {{ host_port }}:{{ docker_port }}
{% endif %}
deploy:
placement:
constraints:
- node.role == {{ var_docker_deploy_node_type }}
replicas: {{ replicas }}
resources:
reservations:
memory: {{ reserved_memory }}
limits:
memory: {{ limited_memory }}
update_config:
parallelism: 1
delay: 0s
failure_action: rollback
order: start-first
rollback_config:
parallelism: 1
delay: 0s
restart_policy:
condition: on-failure
# healthcheck:
# test: wget --quiet --spider http://localhost:5902/v1/latest/terms/user
# interval: 10s
# timeout: 10s
# retries: 3
# start_period: 100s
volumes:
- {{ host_logs_location }}:{{ docker_logs_location }}
networks:
application_default:
aliases:
- {{ network_alias_name }}
env_file:
- {{ env_file_deployment_location }}
networks:
application_default:
external: true
\ No newline at end of file
server.port={{ service_form_port }}
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://{{ mysql_host }}:3306/retail_user
spring.datasource.username={{ mysql_username }}
spring.datasource.password={{ mysql_password }}
#----------------------------- ELASTIC SEARCH CONFIGURATIONS ------------------------------#
services.esindexer.host={{ elastic_host }}
services.esindexer.host.name={{ elastic_host }}
services.esindexer.host.port=9200
services.esindexer.username={{ elastic_username }}
services.esindexer.password={{ elastic_password }}
es.fs.forms.index.name=fs-forms
es.fs.forms.document.type=forms
es.fs.formsdata.index.name=fs-forms-data
es.fs.formsdata.document.type=forms-data
es.fs.interactions.index.name=fs-interactions
es.forms.fail.records.index.name=form-failure-records
es.forms.fail.records.index.type=formfailurerecords
file.config.path=/
file.config.name=FormConfig.yml
#services.esindexer.host=10.2.1.30
#services.esindexer.host.name=http://10.2.1.30/
#services.esindexer.host.port=9200
#services.esindexer.username=elastic
#services.esindexer.password=Elastic123
#es.fs.forms.index.name=fs-forms
#es.fs.forms.document.type=forms
#es.fs.formsdata.index.name=fs-forms-data
#es.fs.formsdata.document.type=forms-data
# KAFKA SERVER CONFIGURATIONS
spring.kafka.bootstrap.servers={{ kafka_host }}:9092
spring.kafka.producer.key-serializer=org.apache.kafka.common.serialization.StringSerializer
spring.kafka.producer.value-serializer=org.springframework.kafka.support.serializer.JsonSerializer
# KAFKA PRODUCER CONFIGURATIONS
kafka.producer.config.retries_config=0
kafka.producer.config.batch_size_config=100000
kafka.producer.config.linger_ms_config=100
kafka.producer.config.buffer_memory_config=66554432
spring.http.multipart.max-file-size=100MB
spring.http.multipart.max-request-size=100MB
### CLOUD STORAGE CONFIGURATIONS ###
cloud_storage_type={{ cloud_type }}
azure_storage_key={{ storage_key }}
azure_storage_secret={{ storage_secret }}
azure_storage_container={{ container_name }}
localhost
---
- hosts: localhost
remote_user: root
roles:
- deploy-sb-ext
\ No newline at end of file
---
# vars file for deploy-sb-ext
# For script
template_compose_file_name: form-service-compose-file.j2
template_env_file_name: form-service-env.j2
compose_file_name: "{{ service_form_service }}.yml"
env_file_name: "{{ service_form_service }}.env"
compose_file_deployment_location: "{{ compose_files_dir }}/{{ compose_file_name }}"
env_file_deployment_location: "{{ env_files_dir }}/{{ env_file_name }}"
user_friendly_name: form service
# For service
application_port: "{{ service_form_port }}"
image_name: "{{ image_form_service }}"
tag: "{{ tags_form_service }}"
host_port: "{{ application_port }}"
docker_port: "{{ application_port }}"
replicas: "{{ service_replicas_form_service }}"
reserved_memory: "{{ service_mem_reserved_form_service }}"
limited_memory: "{{ service_mem_limit_form_service }}"
health_check_endpoint: http://127.0.0.1:{{ docker_port }}/v1/course/new
network_alias_name: "{{ network_alias_form_service }}"
docker_service_stack_name: smf
docker_service_name: "{{ service_form_service }}"
force_reload: "{{ force_reload_form_service }}"
host_logs_location: "{{ form_logs_path }}"
docker_logs_location: /logs
spring_datasource_jdbc_url: jdbc:postgresql://{{ postgresql_host }}:{{ postgresql_port }}/{{ postgresql_user_profile_database }}
# For application
spring_data_mongodb_uri: mongodb://{{ mongodb_user }}:{{ mongodb_password | urlencode }}@{{ mongodb_host }}:{{ mongodb_port }}/{{ mongodb_authentication_database }}
enable_new_assessments: 1
bodhi_ui_index: lexcontentindex
bodhi_content_port: "{{ service_content_service_port }}"
iap_certification_url: https://{{ var_common_iap_base }}/backend/Profile/CertificationResult
com_infosys_root_org: "{{ var_common_root_org }}"
com_infosys_org: "{{ var_common_org }}"
com_infosys_neo4j_ip: http://10.177.157.22:7474/graphaware/
com_infosys_enable_access_control: "{{ var_form_service_enable_access_control }}"
app_name: "Lex"
infosys_lex_core_ip: http://{{ network_alias_lex_core_service }}:{{ service_lex_core_port }}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment