diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 9bae94ec..8a2971a5 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -65,12 +65,8 @@ steps: name: test_prepare - powershell: | - $domain = Get-WmiObject -Class Win32_NetworkAdapterConfiguration | - Select -ExpandProperty DNSDomain | - Select -First 1 Write-Host 'Writing compose config to disk' $content = @" - AZURE_DOMAIN=$domain VOLUME_ROOT=$ENV:TempVolumeRoot "@ $Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False diff --git a/docker-compose.yml b/docker-compose.yml index 392f1597..ec0f38b0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,26 +2,30 @@ version: '3' services: puppet: - hostname: puppet + hostname: puppet.local image: puppet/puppetserver ports: - 8140:8140 environment: + # necessary to set certname and server in puppet.conf, required by + # puppetserver ca cli application + - PUPPETSERVER_HOSTNAME=puppet.local # DNS_ALT_NAMES must be set before starting the stack the first time, # and must list all the names under which the puppetserver can be - # reached. 'puppet' must be one of them, otherwise puppetdb won't be + # reached. 'puppet.local' must be one of them, otherwise puppetdb won't be # able to get a cert. Add other names as a comma-separated list - - DNS_ALT_NAMES=puppet,${DNS_ALT_NAMES:-} + - DNS_ALT_NAMES=puppet,puppet.local,${DNS_ALT_NAMES:-} - PUPPERWARE_ANALYTICS_ENABLED=${PUPPERWARE_ANALYTICS_ENABLED:-true} - - PUPPETDB_SERVER_URLS=https://puppetdb:8081 + - PUPPETDB_SERVER_URLS=https://puppetdb.local:8081 volumes: - ${VOLUME_ROOT:-.}/volumes/code:/etc/puppetlabs/code/ - ${VOLUME_ROOT:-.}/volumes/puppet:/etc/puppetlabs/puppet/ - ${VOLUME_ROOT:-.}/volumes/serverdata:/opt/puppetlabs/server/data/puppetserver/ + dns_search: '.local' networks: default: aliases: - - puppet.${AZURE_DOMAIN:-} + - puppet.local postgres: image: postgres:9.6 @@ -34,14 +38,20 @@ services: volumes: - ${VOLUME_ROOT:-.}/volumes/puppetdb-postgres/data:/var/lib/postgresql/data - ./postgres-custom:/docker-entrypoint-initdb.d + dns_search: '.local' + networks: + default: + aliases: + - postgres.local puppetdb: - hostname: puppetdb + hostname: puppetdb.local image: puppet/puppetdb environment: - PUPPERWARE_ANALYTICS_ENABLED=${PUPPERWARE_ANALYTICS_ENABLED:-true} # This name is an FQDN so the short name puppet doesn't collide outside compose network - - PUPPETSERVER_HOSTNAME=puppet.${AZURE_DOMAIN:-} + - PUPPETSERVER_HOSTNAME=puppet.local + - PUPPETDB_DATABASE_CONNECTION="//postgres.local:5432/puppetdb" - PUPPETDB_PASSWORD=puppetdb - PUPPETDB_USER=puppetdb ports: @@ -52,3 +62,8 @@ services: - puppet volumes: - ${VOLUME_ROOT:-.}/volumes/puppetdb/ssl:/etc/puppetlabs/puppet/ssl/ + dns_search: '.local' + networks: + default: + aliases: + - puppetdb.local diff --git a/spec/dockerfile_spec.rb b/spec/dockerfile_spec.rb index b9c91999..8e42c020 100644 --- a/spec/dockerfile_spec.rb +++ b/spec/dockerfile_spec.rb @@ -14,7 +14,7 @@ ] before(:all) do - @test_agent = "puppet_test#{Random.rand(1000)}" + @test_agent = "puppet_test#{Random.rand(1000)}.local" @timestamps = [] status = run_command('docker-compose --no-ansi version')[:status] if status.exitstatus != 0