[Add] add mongi environment

This commit is contained in:
Mohamed Emine IBRAHIM 2022-07-15 11:01:31 +01:00
parent e815b3114f
commit 2cd59572fb
9 changed files with 157 additions and 30 deletions

View File

@ -24,24 +24,10 @@ proxy_hostname: "{{ groups[bastion_group_name] | first }}"
proxy_ip: "{{ hostvars[proxy_hostname].ansible_host }}"
proxy_port: 3128
# linux users
users:
- name: baha
group: baha
groups: sudo
shell: '/bin/bash'
ssh_pub_keys:
- 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDaKdKinHqJ5bn9TqCULDEhAcSm9mbcHirRVzFNIPtGc4oPS5oc7WCtGgdv4J5YyWxEoe4Z42VpqDRHxuwdlprZYrfCVgDz5hQNiC8KQuusNFkfgjBPGH2dOvRJusIAclr2wEPUKMDh9MAlJ8NegUg/3uVs2ngXIyag6fronqzIDVCW89WqTi1EGnU69/bbXjPx2so4OYPvumSrxHYf438nR/3cRK8mXbSw43LN7xr0rgzclhZuTlXVrc2jichqI2jNJ7wmH0eQoLyf0E/ncXRR5xFdW1/rFQqQnueA0006dvqlgqsvaNPnFnFyfSpaGdZN4wj2hE2XZ+JkGeAjKswVAZHIst7xslCSZChQFAqHIs2ddtTsrd+tF1WVqpKu2MgjEwhKhu6KoKDW1D5s3Mb5CZcPANz9jyKCBKsKw++MJx74eP3LFdFFCjD6fgjT5Qi6BkhSkYWel6kP5joHNU8R+ZFX2cMUC+ZuEJIuGUMCv9q5ir/Ueh6tMJNolbNWRIs= baha@DESKTOP-AN6NC1O'
- 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDGnJJk9lvPOmJZxfpb+0k84mWA7jpBKapxtE02qwRDVQ5b6ZBCH5lr9eBU1XTppu7FXew/+VkQaf6pp8c4yCoY01QIFei+ilw+RncN92vzAVPzBPcPACPNjrvsD5pUIRxRMU21fIopQhGY+baK/rw/Gqfa8fyRK5cR07mvJ/jZQIPlOBr9pBf/mmzNCaRyo0kZb199X/VpWo8RhTNpfmx7pEvD1pSnqeMlPO7GlSqVfMSSKIUeCFW/Ne6Bwk73dOXZPLdo3qa5/6dZmoRf3V7QCbSXfxy9RQVKsjSzsxMc59XF2gr6vY8qAUnfoLhxpF4LwVi1mDQanwD7yYZ41tsP6Su1/R1qLCfEeE6rJCxAjHIc/OqeqznBp0Dxbu7Xhmy38U5iX9X70Wrv5JB77giUtf2i/OnDGtZ9n27Hm9U+n1l3CLmcYePEarD/7nOrzk2BVlih63r+ejRlTou9mwC+L7W2L8y5qhWTRVmLcvPRindxApPzL8nCWe8INlzXb6G6zY0T1f0tabh9DSeoQ67OYPjQUMJVYo3rSbQHzh6tOjin5yrBF46HQWJpwKPKxPGOPuLT84WzdmnX02MUmfy3vGBf7bVO+ViVgQPRvcgt2gKUUufWNuPOwmPKK1aSnF3KQy7u+8Vi3p/iGx8mGKIpt8J0g6C5s3WI7crFuVkuFw== baha@felcloud.tn'
git_user: "baha"
git_token: "glpat-68xbQazGGWFUpunNZk7y"
console_port: 9090
console_url: "baha-dev.felcloud.io"
# console
# console staging
console_repo: "git.felcloud.io/billing/billing_website.git"
console_branch: "dev"
console_branch: "prod"
console_image_name: "nexus.felcloud.io/felcloud/console"
console_version: 0.1.2
@ -103,3 +89,5 @@ felcloud_docker_registry: "nexus.felcloud.io/felcloud"
# mongodb global
mongodb_replicaset_name: "rs0"
mongodb_script_local_config_path: "mongo-scripts"
mongodb_list_js_scripts:
- "03_initaira.js"

38
group_vars/console Normal file
View File

@ -0,0 +1,38 @@
---
# console staging
console_repo: "git.felcloud.io/billing/billing_website.git"
console_branch: "prod"
console_image_name: "nexus.felcloud.io/felcloud/console"
console_version: 0.1.2
# console database
console_database_name: "billing"
console_database_user: "billingW"
console_database_passwd: !vault |
$ANSIBLE_VAULT;1.1;AES256
34646331363564376132633734303661376433386139306438623462386633376635343664663637
6465363736346437333965333836643862386565616230330a646333373934343761393932383765
66616166663061666563363534646464313430383363613164653337663565333337303334646366
3338666262346263650a623037626165363730386462633331393438326131656638626430383939
62633637303662666366313236366461613362343961333865646465326532613432393436363335
3731366461653937613133383834666632633231646664623363
console_database_url: "{{ groups['console_database'][0] }}:27017,{{ groups['console_database'][1] }}:27017,{{ groups['console_database'][2] }}:27017"
# mongodb global
mongodb_replicaset_name: "rs0"
mongodb_script_local_config_path: "mongo-scripts"
mongodb_list_js_scripts:
- "03_initbilling.js"
# linux users
users:
- name: baha
group: baha
groups: sudo
shell: '/bin/bash'
ssh_pub_keys:
- 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDaKdKinHqJ5bn9TqCULDEhAcSm9mbcHirRVzFNIPtGc4oPS5oc7WCtGgdv4J5YyWxEoe4Z42VpqDRHxuwdlprZYrfCVgDz5hQNiC8KQuusNFkfgjBPGH2dOvRJusIAclr2wEPUKMDh9MAlJ8NegUg/3uVs2ngXIyag6fronqzIDVCW89WqTi1EGnU69/bbXjPx2so4OYPvumSrxHYf438nR/3cRK8mXbSw43LN7xr0rgzclhZuTlXVrc2jichqI2jNJ7wmH0eQoLyf0E/ncXRR5xFdW1/rFQqQnueA0006dvqlgqsvaNPnFnFyfSpaGdZN4wj2hE2XZ+JkGeAjKswVAZHIst7xslCSZChQFAqHIs2ddtTsrd+tF1WVqpKu2MgjEwhKhu6KoKDW1D5s3Mb5CZcPANz9jyKCBKsKw++MJx74eP3LFdFFCjD6fgjT5Qi6BkhSkYWel6kP5joHNU8R+ZFX2cMUC+ZuEJIuGUMCv9q5ir/Ueh6tMJNolbNWRIs= baha@DESKTOP-AN6NC1O'
- 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDGnJJk9lvPOmJZxfpb+0k84mWA7jpBKapxtE02qwRDVQ5b6ZBCH5lr9eBU1XTppu7FXew/+VkQaf6pp8c4yCoY01QIFei+ilw+RncN92vzAVPzBPcPACPNjrvsD5pUIRxRMU21fIopQhGY+baK/rw/Gqfa8fyRK5cR07mvJ/jZQIPlOBr9pBf/mmzNCaRyo0kZb199X/VpWo8RhTNpfmx7pEvD1pSnqeMlPO7GlSqVfMSSKIUeCFW/Ne6Bwk73dOXZPLdo3qa5/6dZmoRf3V7QCbSXfxy9RQVKsjSzsxMc59XF2gr6vY8qAUnfoLhxpF4LwVi1mDQanwD7yYZ41tsP6Su1/R1qLCfEeE6rJCxAjHIc/OqeqznBp0Dxbu7Xhmy38U5iX9X70Wrv5JB77giUtf2i/OnDGtZ9n27Hm9U+n1l3CLmcYePEarD/7nOrzk2BVlih63r+ejRlTou9mwC+L7W2L8y5qhWTRVmLcvPRindxApPzL8nCWe8INlzXb6G6zY0T1f0tabh9DSeoQ67OYPjQUMJVYo3rSbQHzh6tOjin5yrBF46HQWJpwKPKxPGOPuLT84WzdmnX02MUmfy3vGBf7bVO+ViVgQPRvcgt2gKUUufWNuPOwmPKK1aSnF3KQy7u+8Vi3p/iGx8mGKIpt8J0g6C5s3WI7crFuVkuFw== baha@felcloud.tn'
git_user: "baha"
git_token: "glpat-68xbQazGGWFUpunNZk7y"
console_port: 9090
console_url: "baha-dev.felcloud.io"

38
group_vars/consolemongi Normal file
View File

@ -0,0 +1,38 @@
---
# console staging
console_repo: "git.felcloud.io/billing/billing_website.git"
console_branch: "prod"
console_image_name: "nexus.felcloud.io/felcloud/console"
console_version: 0.1.2
# console database
console_database_name: "billing"
console_database_user: "billingW"
console_database_passwd: !vault |
$ANSIBLE_VAULT;1.1;AES256
34646331363564376132633734303661376433386139306438623462386633376635343664663637
6465363736346437333965333836643862386565616230330a646333373934343761393932383765
66616166663061666563363534646464313430383363613164653337663565333337303334646366
3338666262346263650a623037626165363730386462633331393438326131656638626430383939
62633637303662666366313236366461613362343961333865646465326532613432393436363335
3731366461653937613133383834666632633231646664623363
console_database_url: "{{ groups['mongi_console_database'][0] }}:27017,{{ groups['mongi_console_database'][1] }}:27017,{{ groups['mongi_console_database'][2] }}:27017"
# mongodb global
mongodb_replicaset_name: "rs0"
mongodb_script_local_config_path: "mongo-scripts"
mongodb_list_js_scripts:
- "03_initbilling.js"
# linux users
users:
- name: mongi
group: mongi
groups: sudo
shell: '/bin/bash'
ssh_pub_keys:
- 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDDMDop27cs9ACXD9+D2VSk5ePA0yvnHwiIszjhM+RyLIWGO8VEMo2SwoHkArbw0RUwfrsAA+ObnxVXiTr2ZMHUphGo/i3sjEsWMiGtP/ZXjoA/NBBPeMzWsUfNniT7cL1d7gLr3Vhm2FAzPdV6TowU6SzjUXwsCluF2klE1ygr9krEXrNJIzG+vzySwfjud+xzbKKDZQBDHRYq6RCIwdA1A1GlnqdEaUrkrNkPLIosPfqmDw0djHfwFi7gIMLI2yzinGoyFzmmSC7rUjcjia6EnJ0XxuitDGJzPPwLSIL42/0t7NoBwRch9aDkljXF0/qCNDOHpS4FxRBO23+qZemwJ5kD4Fy9I9Y2gKfcetrCcD2uMLx3Msdso4ILe/qWiX7ptRAV0PxxlEgV68UPW1h8Sujq/zuLKkLMFrrexL+wa49IcCgJNxXU5W5Ve4+SA/gUO1HSNeL9WKl95bIi37OOwIzWxP9YgSVLqLiabD+V9QMxwMrf+Dy0pfNFV9XtVBM= mongi@felcloud.tn'
git_user: "mongi"
git_token: "glpat-3XzS5sDbHBqzzhL1ZnF7"
console_port: 9090
console_url: "mongi-dev.felcloud.io"

View File

@ -0,0 +1,21 @@
---
mongodb_root_user: root
mongodb_root_passwd: !vault |
$ANSIBLE_VAULT;1.1;AES256
34333139613963386461663666616630336663613631643638626665623137323332323465326632
3531313966376633636235373531376534643234306339370a373239393364633663366431386138
36663132656663393664316561306262623236326361623935613430346138353731656565396261
6564336464303531620a643062623464623634623565366230326531643162323034333635393966
37343234643931666635636637396363333432643032333536396538303832346634
mongodb_init_database: "admin"
nosqlclient_user: nosqlclient
nosqlclient_passwd: !vault |
$ANSIBLE_VAULT;1.1;AES256
34323766623465326261326662316230376633366362373938383966613237616232323433613532
6165643266333164386330646131396562326262626431320a663437656134633663396137356261
35633230633732663566306363326635336633303965343538633836303662386638363535343635
3737663437303932610a656434383436626264326566636336396130666265353039313165656331
3564
nosqlclient_database: "nosqlclient"

View File

@ -0,0 +1,22 @@
---
haproxy_local_config_path: "reverse-proxy/haproxy.cfg"
haproxy_list_tls:
- wildcard.felcloud.io
haproxy_nbproc: 1
public_vip_address:
- "{{ vip_console_mongi.all_fixed_ips | first }}"
haproxy_first_tls: "/etc/haproxy/tls/wildcard.felcloud.io.pem"
default_backend: "mongi_console"
haproxy:
backends:
- name: nosql
frontend: "mongi-dev-db.felcloud.io"
servers:
- "acl draw-auth http_auth(basic-auth-list)"
- "http-request auth realm draw unless draw-auth"
- "server {{ groups['mongi_console_database'][0] }} {{ hostvars[groups['mongi_console_database'][0]]['ansible_host'] }}:3000"
- name: mongi_console
frontend: "mongi-dev.felcloud.io"
servers:
- "server {{ groups['mongi_console_web'][0] }} {{ hostvars[groups['mongi_console_web'][0]]['ansible_host'] }}:9090"

View File

@ -0,0 +1,10 @@
---
vrrp_instances:
- name: "vip_console"
state: "MASTER"
interface: "ens3"
id: 53
passwd: "yZnCOEa74TMgs"
vip: "{{ vip_console_mongi.all_fixed_ips | first }}/{{ vip_network_cidr.split('/')[1] }}"
priority: 200

View File

@ -0,0 +1,10 @@
---
vrrp_instances:
- name: "vip_console"
state: "BACKUP"
interface: "ens3"
id: 53
passwd: "yZnCOEa74TMgs"
vip: "{{ vip_console_mongi.all_fixed_ips | first }}/{{ vip_network_cidr.split('/')[1] }}"
priority: 150

View File

@ -27,7 +27,7 @@
],
"instance": [{
"name": "stg-mongi-bilweb-00",
"az": "FR_Roubaix",
"az": "UK_London",
"flavor": "Atto.L",
"image": "Ubuntu 20.04 LTS - Focal",
"keypair": "dell XPS",
@ -37,7 +37,7 @@
},
{
"name": "stg-mongi-bilweb-01",
"az": "FR_Roubaix",
"az": "UK_London",
"flavor": "Atto.L",
"image": "Ubuntu 20.04 LTS - Focal",
"keypair": "dell XPS",
@ -47,7 +47,7 @@
},
{
"name": "stg-mongi-billdb-00",
"az": "FR_Roubaix",
"az": "UK_London",
"flavor": "Femto.L",
"image": "Ubuntu 20.04 LTS - Focal",
"keypair": "dell XPS",
@ -57,7 +57,7 @@
},
{
"name": "stg-mongi-billdb-01",
"az": "FR_Roubaix",
"az": "UK_London",
"flavor": "Femto.L",
"image": "Ubuntu 20.04 LTS - Focal",
"keypair": "dell XPS",
@ -67,7 +67,7 @@
},
{
"name": "stg-mongi-billdb-02",
"az": "FR_Roubaix",
"az": "UK_London",
"flavor": "Femto.L",
"image": "Ubuntu 20.04 LTS - Focal",
"keypair": "dell XPS",
@ -77,12 +77,12 @@
},
{
"name": "stg-mongi-bilbas-00",
"az": "FR_Roubaix",
"az": "UK_London",
"flavor": "Atto.S",
"image": "Ubuntu 20.04 LTS - Focal",
"keypair": "dell XPS",
"security_group": ["secgroup_console"],
"inventory_group": "mongi_console_bastion",
"inventory_group": "consolemongi_bastion",
"network": [{"name": "mongi_console"}],
"fip": [{
"floatingip": "fip_console",

View File

@ -27,19 +27,19 @@ console_web
#---- end console inventory ----
#---- start consolemongi inventory ----
[mongi_console_web]
stg-mongi-bilweb-00 ansible_host=172.55.2.184 ansible_user=ubuntu
stg-mongi-bilweb-01 ansible_host=172.55.1.235 ansible_user=ubuntu
stg-mongi-bilweb-00 ansible_host=172.55.0.21 ansible_user=ubuntu
stg-mongi-bilweb-01 ansible_host=172.55.0.33 ansible_user=ubuntu
[mongi_console_database]
stg-mongi-billdb-00 ansible_host=172.55.1.137 ansible_user=ubuntu
stg-mongi-billdb-01 ansible_host=172.55.1.131 ansible_user=ubuntu
stg-mongi-billdb-02 ansible_host=172.55.0.103 ansible_user=ubuntu
stg-mongi-billdb-00 ansible_host=172.55.1.34 ansible_user=ubuntu
stg-mongi-billdb-01 ansible_host=172.55.2.196 ansible_user=ubuntu
stg-mongi-billdb-02 ansible_host=172.55.0.63 ansible_user=ubuntu
[mongi_console_bastion]
stg-mongi-bilbas-00 ansible_host=172.55.2.117 ansible_user=ubuntu
[consolemongi_bastion]
stg-mongi-bilbas-00 ansible_host=172.55.1.21 ansible_user=ubuntu
[consolemongi:children]
mongi_console_bastion
consolemongi_bastion
mongi_console_database
mongi_console_web
#---- end consolemongi inventory ----