Commit ed245b30 authored by Daniele Valeriani's avatar Daniele Valeriani

Update all modules to the new vaults json format

parent 6e42e311
......@@ -109,7 +109,7 @@ module "subnet-web" {
module "virtual-machines-api" {
address_prefix = "${module.subnet-api.address_prefix}"
chef_repo_dir = "${var.chef_repo_dir}"
chef_vaults = "syslog_client:cny gitlab-cluster-base:prd"
chef_vaults = "{\"syslog_client\": \"cny\", \"gitlab-cluster-base\": \"prd\"}"
chef_version = "${var.chef_version}"
count = 1
environment = "${var.environment}"
......@@ -128,7 +128,7 @@ module "virtual-machines-api" {
module "virtual-machines-git" {
address_prefix = "${module.subnet-git.address_prefix}"
chef_repo_dir = "${var.chef_repo_dir}"
chef_vaults = "syslog_client:cny gitlab-cluster-base:prd"
chef_vaults = "{\"syslog_client\": \"cny\", \"gitlab-cluster-base\": \"prd\"}"
chef_version = "${var.chef_version}"
count = 1
environment = "${var.environment}"
......@@ -147,7 +147,7 @@ module "virtual-machines-git" {
module "virtual-machines-web" {
address_prefix = "${module.subnet-web.address_prefix}"
chef_repo_dir = "${var.chef_repo_dir}"
chef_vaults = "syslog_client:cny gitlab-cluster-base:prd"
chef_vaults = "{\"syslog_client\": \"cny\", \"gitlab-cluster-base\": \"prd\"}"
chef_version = "${var.chef_version}"
count = 1
environment = "${var.environment}"
......@@ -171,6 +171,6 @@ module "virtual-machines-external-lb" {
first_user_username = "${var.first_user_username}"
first_user_password = "${var.first_user_password}"
chef_repo_dir = "${var.chef_repo_dir}"
chef_vaults = "syslog_client:cny gitlab-cluster-base:prd gitlab_cluster_lb"
chef_vaults = "{\"syslog_client\": \"cny\", \"gitlab-cluster-base\": \"prd\", \"gitlab_cluster_lb\": \"_default\"}"
gitlab_com_zone_id = "${var.gitlab_com_zone_id}"
}
......@@ -251,7 +251,7 @@ module "virtual-machines-external-lb" {
first_user_username = "${var.first_user_username}"
first_user_password = "${var.first_user_password}"
chef_repo_dir = "${var.chef_repo_dir}"
chef_vaults = "syslog_client gitlab-cluster-base gitlab_consul:client gitlab_cluster_lb"
chef_vaults = "{\"syslog_client\": \"prd\", \"gitlab-cluster-base\": \"prd\", \"gitlab_consul\": \"client\", \"gitlab_cluster_lb\": \"_default\"}"
gitlab_com_zone_id = "${var.gitlab_com_zone_id}"
altssh_lb_pool = "${module.load-balancers-external-lb.altssh_backend_pool_id}"
frontend_lb_pool = "${module.load-balancers-external-lb.frontend_backend_pool_id}"
......@@ -266,7 +266,7 @@ module "virtual-machines-external-lb" {
// first_user_username = "${var.first_user_username}"
// first_user_password = "${var.first_user_password}"
// chef_repo_dir = "${var.chef_repo_dir}"
// chef_vaults = "syslog_client gitlab-cluster-base gitlab_consul:client"
// chef_vaults = "{\"syslog_client\": \"prd\", \"gitlab-cluster-base\": \"prd\", \"gitlab_consul\": \"client\"}"
// gitlab_com_zone_id = "${var.gitlab_com_zone_id}"
// load_balancer_backend_address_pool_id = "${module.load-balancers-internal.backend_pool_id}"
// }
......@@ -274,7 +274,7 @@ module "virtual-machines-external-lb" {
module "virtual-machines-postgres" {
address_prefix = "${module.subnet-postgres.address_prefix}"
chef_repo_dir = "${var.chef_repo_dir}"
chef_vaults = "{ \"syslog_client\": \"prd\", \"gitlab-cluster-base\": \"prd\", \"gitlab_consul\":\"client\", \"gitlab-monitor\":\"prd\", \"postgres-exporter\":\"prd\" }"
chef_vaults = "{ \"syslog_client\": \"prd\", \"gitlab-cluster-base\": \"prd\", \"gitlab_consul\": \"client\", \"gitlab-monitor\": \"prd\", \"postgres-exporter\": \"prd\" }"
chef_version = "${var.chef_version}"
count = 4
environment = "${var.environment}"
......@@ -293,7 +293,7 @@ module "virtual-machines-postgres" {
module "virtual-machines-pgbouncer" {
address_prefix = "${module.subnet-pgbouncer.address_prefix}"
chef_repo_dir = "${var.chef_repo_dir}"
chef_vaults = "syslog_client gitlab-cluster-base gitlab_consul:prd_client gitlab-monitor postgres-exporter"
chef_vaults = "{\"syslog_client\": \"prd\", \"gitlab-cluster-base\": \"prd\", \"gitlab_consul\": \"prd_client\", \"gitlab-monitor\": \"_default\", \"postgres-exporter\": \"_default\"}"
chef_version = "${var.chef_version}"
count = 2
environment = "${var.environment}"
......@@ -318,14 +318,14 @@ module "virtual-machines-redis" {
first_user_username = "${var.first_user_username}"
first_user_password = "${var.first_user_password}"
chef_repo_dir = "${var.chef_repo_dir}"
chef_vaults = "syslog_client gitlab-cluster-base gitlab_consul:client"
chef_vaults = "{\"syslog_client\": \"prd\", \"gitlab-cluster-base\": \"prd\", \"gitlab_consul\": \"client\"}"
gitlab_com_zone_id = "${var.gitlab_com_zone_id}"
}
module "virtual-machines-redis-cache" {
address_prefix = "${module.subnet-redis.address_prefix}"
chef_repo_dir = "${var.chef_repo_dir}"
chef_vaults = "syslog_client gitlab-cluster-base gitlab_consul:client"
chef_vaults = "{\"syslog_client\": \"prd\", \"gitlab-cluster-base\": \"prd\", \"gitlab_consul\": \"client\"}"
chef_version = "${var.chef_version}"
environment = "${var.environment}"
gitlab_com_zone_id = "${var.gitlab_com_zone_id}"
......@@ -359,14 +359,14 @@ module "virtual-machines-elasticsearch" {
first_user_username = "${var.first_user_username}"
first_user_password = "${var.first_user_password}"
chef_repo_dir = "${var.chef_repo_dir}"
chef_vaults = "syslog_client gitlab-cluster-base gitlab_consul:client"
chef_vaults = "{\"syslog_client\": \"prd\", \"gitlab-cluster-base\": \"prd\", \"gitlab_consul\": \"client\"}"
gitlab_com_zone_id = "${var.gitlab_com_zone_id}"
}
module "virtual-machines-logsearch" {
address_prefix = "${module.subnet-log-storage.address_prefix}"
chef_repo_dir = "${var.chef_repo_dir}"
chef_vaults = "syslog_client gitlab-cluster-base gitlab_consul:client"
chef_vaults = "{\"syslog_client\": \"prd\", \"gitlab-cluster-base\": \"prd\", \"gitlab_consul\": \"client\"}"
chef_version = "${var.chef_version}"
environment = "${var.environment}"
gitlab_net_zone_id = "${var.gitlab_net_zone_id}"
......@@ -394,7 +394,7 @@ module "virtual-machines-deploy" {
first_user_username = "${var.first_user_username}"
first_user_password = "${var.first_user_password}"
chef_repo_dir = "${var.chef_repo_dir}"
chef_vaults = "syslog_client gitlab-cluster-base gitlab_consul:client"
chef_vaults = "{\"syslog_client\": \"prd\", \"gitlab-cluster-base\": \"prd\", \"gitlab_consul\": \"client\"}"
gitlab_com_zone_id = "${var.gitlab_com_zone_id}"
}
......@@ -411,7 +411,7 @@ module "virtual-machines-dns" {
first_user_username = "${var.first_user_username}"
first_user_password = "${var.first_user_password}"
chef_repo_dir = "${var.chef_repo_dir}"
chef_vaults = "syslog_client gitlab-cluster-base gitlab_consul:client"
chef_vaults = "{\"syslog_client\": \"prd\", \"gitlab-cluster-base\": \"prd\", \"gitlab_consul\": \"client\"}"
gitlab_net_zone_id = "${var.gitlab_net_zone_id}"
}
......@@ -428,14 +428,14 @@ module "virtual-machines-consul" {
first_user_username = "${var.first_user_username}"
first_user_password = "${var.first_user_password}"
chef_repo_dir = "${var.chef_repo_dir}"
chef_vaults = "syslog_client gitlab-cluster-base"
chef_vaults = "{\"syslog_client\": \"prd\", \"gitlab-cluster-base\": \"prd\"}"
gitlab_net_zone_id = "${var.gitlab_net_zone_id}"
}
module "virtual-machines-api" {
address_prefix = "${module.subnet-api.address_prefix}"
chef_repo_dir = "${var.chef_repo_dir}"
chef_vaults = "syslog_client gitlab-cluster-base gitlab_consul:client"
chef_vaults = "{\"syslog_client\": \"prd\", \"gitlab-cluster-base\": \"prd\", \"gitlab_consul\": \"client\"}"
chef_version = "${var.chef_version}"
count = 14
environment = "${var.environment}"
......@@ -454,7 +454,7 @@ module "virtual-machines-api" {
module "virtual-machines-git" {
address_prefix = "${module.subnet-git.address_prefix}"
chef_repo_dir = "${var.chef_repo_dir}"
chef_vaults = "syslog_client gitlab-cluster-base gitlab_consul:client"
chef_vaults = "{\"syslog_client\": \"prd\", \"gitlab-cluster-base\": \"prd\", \"gitlab_consul\": \"client\"}"
chef_version = "${var.chef_version}"
count = 12
environment = "${var.environment}"
......@@ -473,7 +473,7 @@ module "virtual-machines-git" {
module "virtual-machines-sidekiq" {
address_prefix = "${module.subnet-sidekiq.address_prefix}"
chef_repo_dir = "${var.chef_repo_dir}"
chef_vaults = "syslog_client gitlab-cluster-base gitlab_consul:client"
chef_vaults = "{\"syslog_client\": \"prd\", \"gitlab-cluster-base\": \"prd\", \"gitlab_consul\": \"client\"}"
chef_version = "${var.chef_version}"
environment = "${var.environment}"
first_user_password = "${var.first_user_password}"
......@@ -506,7 +506,7 @@ module "virtual-machines-sidekiq" {
module "virtual-machines-web" {
address_prefix = "${module.subnet-web.address_prefix}"
chef_repo_dir = "${var.chef_repo_dir}"
chef_vaults = "syslog_client gitlab-cluster-base gitlab_consul:client"
// chef_vaults = "{\"syslog_client\": \"prd\", \"gitlab-cluster-base\": \"prd\", \"gitlab_consul\": \"client\"}"
chef_version = "${var.chef_version}"
count = 14
environment = "${var.environment}"
......@@ -535,14 +535,14 @@ module "virtual-machines-registry" {
first_user_username = "${var.first_user_username}"
first_user_password = "${var.first_user_password}"
chef_repo_dir = "${var.chef_repo_dir}"
chef_vaults = "syslog_client gitlab-cluster-base gitlab_consul:client"
// chef_vaults = "{\"syslog_client\": \"prd\", \"gitlab-cluster-base\": \"prd\", \"gitlab_consul\": \"client\"}"
gitlab_com_zone_id = "${var.gitlab_com_zone_id}"
}
module "virtual-machines-mailroom" {
address_prefix = "${module.subnet-mailroom.address_prefix}"
chef_repo_dir = "${var.chef_repo_dir}"
chef_vaults = "syslog_client gitlab-cluster-base gitlab_consul:client"
// chef_vaults = "{\"syslog_client\": \"prd\", \"gitlab-cluster-base\": \"prd\", \"gitlab_consul\": \"client\"}"
chef_version = "${var.chef_version}"
count = 2
environment = "${var.environment}"
......
......@@ -230,12 +230,12 @@ module "virtual-machines-external-lb" {
first_user_username = "${var.first_user_username}"
first_user_password = "${var.first_user_password}"
chef_repo_dir = "${var.chef_repo_dir}"
chef_vaults = "syslog_client:stg gitlab-staging-base:stg gitlab-staging-external-lb"
chef_vaults = "{\"syslog_client\": \"stg\", \"gitlab-staging-base\": \"stg\", \"gitlab-staging-external-lb\": \"_default\"}"
gitlab_com_zone_id = "${var.gitlab_com_zone_id}"
}
module "virtual-machines-internal-lb" {
backend_lb_count = 1
backend_lb_count = 0
source = "../../modules/virtual-machines/internal-lb"
location = "${var.location}"
resource_group_name = "${module.subnet-internal-lb.resource_group_name}"
......@@ -247,7 +247,7 @@ module "virtual-machines-internal-lb" {
first_user_username = "${var.first_user_username}"
first_user_password = "${var.first_user_password}"
chef_repo_dir = "${var.chef_repo_dir}"
chef_vaults = "syslog_client:stg gitlab-staging-base:stg staging-base-lb:backend"
chef_vaults = "{\"syslog_client\": \"stg\", \"gitlab-staging-base\": \"stg\", \"staging-base-lb\": \"backend\"}"
gitlab_com_zone_id = "${var.gitlab_com_zone_id}"
}
......@@ -264,7 +264,7 @@ module "virtual-machines-postgres" {
first_user_username = "${var.first_user_username}"
first_user_password = "${var.first_user_password}"
chef_repo_dir = "${var.chef_repo_dir}"
chef_vaults = "syslog_client:stg gitlab-staging-base:stg gitlab-monitor:stg postgres-exporter:stg"
chef_vaults = "{\"syslog_client\": \"stg\", \"gitlab-staging-base\": \"stg\", \"gitlab-monitor\": \"stg\", \"postgres-exporter\": \"stg\"}"
gitlab_com_zone_id = "${var.gitlab_com_zone_id}"
}
......@@ -276,7 +276,7 @@ module "virtual-machines-redis" {
first_user_username = "${var.first_user_username}"
first_user_password = "${var.first_user_password}"
chef_repo_dir = "${var.chef_repo_dir}"
chef_vaults = "syslog_client:stg gitlab-staging-base:stg"
chef_vaults = "{\"syslog_client\": \"stg\", \"gitlab-staging-base\": \"stg\"}"
gitlab_com_zone_id = "${var.gitlab_com_zone_id}"
}
......@@ -284,7 +284,7 @@ module "virtual-machines-redis" {
module "virtual-machines-redis-cache" {
address_prefix = "${module.subnet-redis.address_prefix}"
chef_repo_dir = "${var.chef_repo_dir}"
chef_vaults = "syslog_client:stg gitlab-staging-base:stg gitlab_consul:stg_client"
chef_vaults = "{\"syslog_client\": \"stg\", \"gitlab-staging-base\": \"stg\", \"gitlab_consul\": \"stg_client\"}"
chef_version = "${var.chef_version}"
environment = "${var.environment}"
gitlab_com_zone_id = "${var.gitlab_com_zone_id}"
......@@ -314,14 +314,14 @@ module "virtual-machines-elasticsearch" {
first_user_username = "${var.first_user_username}"
first_user_password = "${var.first_user_password}"
chef_repo_dir = "${var.chef_repo_dir}"
chef_vaults = "syslog_client:stg gitlab-staging-base:stg"
chef_vaults = "{\"syslog_client\": \"stg\", \"gitlab-staging-base\": \"stg\"}"
gitlab_com_zone_id = "${var.gitlab_com_zone_id}"
}
module "virtual-machines-pgbouncer" {
address_prefix = "${module.subnet-pgbouncer.address_prefix}"
chef_repo_dir = "${var.chef_repo_dir}"
chef_vaults = "syslog_client:stg gitlab-staging-base:stg gitlab-monitor:stg postgres-exporter:stg"
chef_vaults = "{\"syslog_client\": \"stg\", \"gitlab-staging-base\": \"stg\", \"gitlab-monitor\": \"stg\", \"postgres-exporter\": \"stg\"}"
chef_version = "${var.chef_version}"
count = 1
environment = "${var.environment}"
......@@ -345,7 +345,7 @@ module "virtual-machines-deploy" {
first_user_username = "${var.first_user_username}"
first_user_password = "${var.first_user_password}"
chef_repo_dir = "${var.chef_repo_dir}"
chef_vaults = "syslog_client:stg gitlab-staging-base:stg"
chef_vaults = "{\"syslog_client\": \"stg\", \"gitlab-staging-base\": \"stg\"}"
gitlab_com_zone_id = "${var.gitlab_com_zone_id}"
}
......@@ -362,14 +362,14 @@ module "virtual-machines-consul" {
first_user_username = "${var.first_user_username}"
first_user_password = "${var.first_user_password}"
chef_repo_dir = "${var.chef_repo_dir}"
chef_vaults = "syslog_client:stg gitlab-cluster-base"
chef_vaults = "{\"syslog_client\": \"stg\", \"gitlab-cluster-base\": \"_default\"}"
gitlab_net_zone_id = "${var.gitlab_net_zone_id}"
}
module "virtual-machines-api" {
address_prefix = "${module.subnet-api.address_prefix}"
chef_repo_dir = "${var.chef_repo_dir}"
chef_vaults = "syslog_client:stg gitlab-staging-base:stg gitlab_consul:stg_client"
chef_vaults = "{\"syslog_client\": \"stg\", \"gitlab-staging-base\": \"stg\", \"gitlab_consul\": \"stg_client\"}"
chef_version = "${var.chef_version}"
count = 1
environment = "${var.environment}"
......@@ -388,7 +388,7 @@ module "virtual-machines-api" {
module "virtual-machines-git" {
address_prefix = "${module.subnet-git.address_prefix}"
chef_repo_dir = "${var.chef_repo_dir}"
chef_vaults = "syslog_client:stg gitlab-staging-base:stg gitlab_consul:stg_client"
chef_vaults = "{\"syslog_client\": \"stg\", \"gitlab-staging-base\": \"stg\", \"gitlab_consul\": \"stg_client\"}"
chef_version = "${var.chef_version}"
count = 1
environment = "${var.environment}"
......@@ -407,7 +407,7 @@ module "virtual-machines-git" {
module "virtual-machines-sidekiq" {
address_prefix = "${module.subnet-sidekiq.address_prefix}"
chef_repo_dir = "${var.chef_repo_dir}"
chef_vaults = "syslog_client:stg gitlab-staging-base:stg gitlab_consul:stg_client"
chef_vaults = "{\"syslog_client\": \"stg\", \"gitlab-staging-base\": \"stg\", \"gitlab_consul\": \"stg_client\"}"
chef_version = "${var.chef_version}"
environment = "${var.environment}"
first_user_password = "${var.first_user_password}"
......@@ -440,7 +440,7 @@ module "virtual-machines-sidekiq" {
module "virtual-machines-web" {
address_prefix = "${module.subnet-web.address_prefix}"
chef_repo_dir = "${var.chef_repo_dir}"
chef_vaults = "syslog_client:stg gitlab-staging-base:stg gitlab_consul:stg_client"
chef_vaults = "{\"syslog_client\": \"stg\", \"gitlab-staging-base\": \"stg\", \"gitlab_consul\": \"stg_client\"}"
chef_version = "${var.chef_version}"
count = 2
environment = "${var.environment}"
......@@ -469,14 +469,14 @@ module "virtual-machines-registry" {
first_user_username = "${var.first_user_username}"
first_user_password = "${var.first_user_password}"
chef_repo_dir = "${var.chef_repo_dir}"
chef_vaults = "syslog_client:stg gitlab-staging-base:stg"
chef_vaults = "{\"syslog_client\": \"stg\", \"gitlab-staging-base\": \"stg\"}"
gitlab_com_zone_id = "${var.gitlab_com_zone_id}"
}
module "virtual-machines-mailroom" {
address_prefix = "${module.subnet-mailroom.address_prefix}"
chef_repo_dir = "${var.chef_repo_dir}"
chef_vaults = "syslog_client:stg gitlab-staging-base:stg gitlab_consul:stg_client"
chef_vaults = "{\"syslog_client\": \"stg\", \"gitlab-staging-base\": \"stg\", \"gitlab_consul\": \"stg_client\"}"
chef_version = "${var.chef_version}"
count = 1
environment = "${var.environment}"
......@@ -505,7 +505,7 @@ module "virtual-machines-api-internal" {
first_user_username = "${var.first_user_username}"
first_user_password = "${var.first_user_password}"
chef_repo_dir = "${var.chef_repo_dir}"
chef_vaults = "syslog_client:stg gitlab-staging-base:stg"
chef_vaults = "{\"syslog_client\": \"stg\", \"gitlab-staging-base\": \"stg\"}"
gitlab_com_zone_id = "${var.gitlab_com_zone_id}"
}
......
set -eux
cd ${chef_repo_dir}
cd "${chef_repo_dir}"
bundle exec knife bootstrap ${ssh_user}@${ip_address} \
--ssh-identity-file ${ssh_private_key} \
bundle exec knife bootstrap "${ssh_user}@${ip_address}" \
--ssh-identity-file "${ssh_private_key}" \
--no-host-key-verify \
--sudo \
--environment ${environment == "prod" ? "prd" : environment} \
--node-name ${hostname} \
--node-name "${hostname}" \
--bootstrap-version "${chef_version}" \
--run-list 'role[gitlab]' \
--json-attributes {\"azure\":{\"ipaddress\":\"${ip_address}\"}} \
--json-attributes "{\"azure\":{\"ipaddress\":\"${ip_address}\"}}" \
--bootstrap-vault-json '${chef_vaults}' \
--yes
......
Markdown is supported
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