File tree Expand file tree Collapse file tree 5 files changed +10
-8
lines changed
examples/openstack-docker
modules/openstack-cogstack-infra Expand file tree Collapse file tree 5 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -3,8 +3,8 @@ module "cogstack_docker_services" {
33 source = " ../../../modules/cogstack-docker-services"
44 hosts = var. hosts
55 service_targets = {
6- observability = { hostname = " cogstack-devops " }
7- medcat_service = { hostname = " medcat-nlp" }
6+ observability = { hostname = " cogstack-docker-controller " }
7+ medcat_service = { hostname = " cogstack-docker- medcat-nlp" }
88 }
99 ssh_private_key_file = var. ssh_private_key_file
1010}
Original file line number Diff line number Diff line change 11module "openstack_cogstack_infra" {
22 source = " ../../../modules/openstack-cogstack-infra"
33 host_instances = [
4- { name = " cogstack-devops " , is_controller = true },
5- { name = " medcat-nlp" }
4+ { name = " cogstack-docker-controller " , is_controller = true },
5+ { name = " cogstack-docker- medcat-nlp" }
66 ]
77 allowed_ingress_ips_cidr = var. allowed_ingress_ips_cidr
88 ubuntu_immage_name = var. ubuntu_immage_name
Original file line number Diff line number Diff line change @@ -8,6 +8,8 @@ system_info:
88 default_user :
99 groups : [docker]
1010
11+ packages :
12+ - apache2-utils
1113
1214runcmd :
1315# Install Docker
@@ -31,6 +33,7 @@ runcmd:
3133
3234# Run Portainer
3335 - echo "Running Portainer"
36+ - bcrypted_pw=$(htpasswd -nb -B admin "${PORTAINER_ADMIN_PASSWORD}" | cut -d ":" -f 2)
3437 - docker pull portainer/portainer-ce:2.33.0
3538 - docker network create portainer-network
3639 - docker volume create portainer-data
@@ -45,7 +48,7 @@ runcmd:
4548 -l 'traefik.enable="true"' \
4649 -l 'traefik.http.routers.portainer-path-router.rule="PathPrefix(`/portainer`)"' \
4750 portainer/portainer-ce:2.33.0 \
48- --admin-password='${PORTAINER_ADMIN_PASSWORD}'
51+ --admin-password="$${bcrypted_pw}"
4952 - docker pull portainer/agent:2.33.0
5053 - |
5154 docker run -d \
Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ data "cloudinit_config" "init_docker_controller" {
6969 content = templatefile (" ${ path . module } /cloud-init-controller.yaml" ,
7070 {
7171 PORTAINER_AGENT_SECRET = var.portainer_secrets.agent_secret,
72- PORTAINER_ADMIN_PASSWORD = local.portainer_admin_password_bcrypt_hash
72+ PORTAINER_ADMIN_PASSWORD = local.portainer_admin_password
7373 }
7474 )
7575 }
Original file line number Diff line number Diff line change @@ -24,6 +24,5 @@ resource "random_password" "portainer_password" {
2424 length = 16
2525}
2626locals {
27- portainer_admin_password_bcrypt_hash = var. portainer_secrets . admin_password != null ? bcrypt (var. portainer_secrets . admin_password ) : random_password. portainer_password [0 ]. bcrypt_hash
28- portainer_admin_password = var. portainer_secrets . admin_password != null ? var. portainer_secrets . admin_password : random_password. portainer_password [0 ]. result
27+ portainer_admin_password = var. portainer_secrets . admin_password != null ? var. portainer_secrets . admin_password : random_password. portainer_password [0 ]. result
2928}
You can’t perform that action at this time.
0 commit comments