From 287be23a92f6181acbd566f2b1f83fe456f24c3e Mon Sep 17 00:00:00 2001 From: Maria Haider Date: Tue, 18 Mar 2025 15:16:42 +0100 Subject: [PATCH] Fixed docker compose for new test my eid --- .../modules/eid/manifests/test_my_eid.pp | 50 +++++++++++-------- .../test_my_eid/docker-compose.yml.erb | 16 ++++++ 2 files changed, 46 insertions(+), 20 deletions(-) create mode 100644 global/overlay/etc/puppet/modules/eid/templates/test_my_eid/docker-compose.yml.erb diff --git a/global/overlay/etc/puppet/modules/eid/manifests/test_my_eid.pp b/global/overlay/etc/puppet/modules/eid/manifests/test_my_eid.pp index b02fa217..1f08a4fe 100644 --- a/global/overlay/etc/puppet/modules/eid/manifests/test_my_eid.pp +++ b/global/overlay/etc/puppet/modules/eid/manifests/test_my_eid.pp @@ -14,27 +14,37 @@ class eid::test_my_eid ( String $service_dir = '/opt/test-my-eid', ) { - # Allow HTTP/HTTPS from load balancer servers - $lb_ips = hiera_array("lb_${environment}_servers",[]) - sunet::nftables::allow { 'allow-http-from-lbs': - from => $lb_ips, - port => 80, - } - sunet::nftables::allow { 'allow-https-from-lbs': - from => $lb_ips, - port => 443, - } + if $version { - file {["${service_dir}",'/var/log/test-my-eid','/etc/ssl']: ensure => directory } + # Allow HTTP/HTTPS from load balancer servers + $lb_ips = hiera_array("lb_${environment}_servers",[]) + sunet::nftables::allow { 'allow-http-from-lbs': + from => $lb_ips, + port => 80, + } + sunet::nftables::allow { 'allow-https-from-lbs': + from => $lb_ips, + port => 443, + } - # Create the environment specific config files from template - file { "${service_dir}/application-${environment}.yml": - ensure => 'file', - content => template("eid/test_my_eid/application-${environment}.yml.erb") - } - file { "${service_dir}/idp-disco-${environment}.yml": - ensure => 'file', - content => template("eid/test_my_eid/idp-disco-${environment}.yml.erb") - } + file {["${service_dir}",'/var/log/test-my-eid','/etc/ssl']: ensure => directory } + # Create the environment specific config files from template + file { "${service_dir}/application-${environment}.yml": + ensure => 'file', + content => template("eid/test_my_eid/application-${environment}.yml.erb") + } + file { "${service_dir}/idp-disco-${environment}.yml": + ensure => 'file', + content => template("eid/test_my_eid/idp-disco-${environment}.yml.erb") + } + + sunet::docker_compose { 'test-my-eid': + content => template('eid/connector/docker-compose.yml.erb'), + service_name => 'test-my-eid', + compose_dir => '/opt/', + compose_filename => 'docker-compose.yml', + description => 'Test My eID' + } + } } diff --git a/global/overlay/etc/puppet/modules/eid/templates/test_my_eid/docker-compose.yml.erb b/global/overlay/etc/puppet/modules/eid/templates/test_my_eid/docker-compose.yml.erb new file mode 100644 index 00000000..6f943921 --- /dev/null +++ b/global/overlay/etc/puppet/modules/eid/templates/test_my_eid/docker-compose.yml.erb @@ -0,0 +1,16 @@ +--- +services: + test-my-eid: + image: docker.sunet.se/test-my-eid:<%= @version %> + container_name: test-my-eid + environment: + - SP_CONFIG_DIRECTORY=/etc/test-my-eid + - SPRING_CONFIG_ADDITIONAL_LOCATION=/etc/test-my-eid/ + - SPRING_PROFILES_ACTIVE=<%= @environment %> + + volumes: + - '<%= @service_dir %>:/etc/eidas-connector' + - '/etc/ssl:/etc/ssl' + + ports: + - "443:8443" \ No newline at end of file