diff --git a/spec/Dockerfile b/spec/Dockerfile index 8bfb0bb0..701a9082 100644 --- a/spec/Dockerfile +++ b/spec/Dockerfile @@ -1,10 +1,21 @@ -FROM rastasheep/ubuntu-sshd:18.04 +FROM ubuntu:24.04 ARG PUPPET_COLLECTION # Install required packages -RUN apt-get update -RUN apt-get -y install apt-transport-https locales sudo tree wget +RUN apt update \ + && apt install -y --no-install-recommends \ + adduser \ + ca-certificates \ + openssh-server \ + libssl-dev \ + sudo \ + locales \ + wget \ + apt-transport-https \ + tree \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* # Set the locale RUN locale-gen en_US.UTF-8 @@ -15,10 +26,10 @@ ENV LANGUAGE=en_US.UTF-8 # Install the puppet-agent package # sudo is important here so puppet is added to the path RUN if [ -n "$PUPPET_COLLECTION" ]; then \ - wget -q https://apt.puppetlabs.com/${PUPPET_COLLECTION}-release-bionic.deb \ - && sudo dpkg -i ${PUPPET_COLLECTION}-release-bionic.deb \ - && sudo apt-get update \ - && sudo apt-get -y install puppet-agent ; \ + wget -q https://apt.voxpupuli.org/${PUPPET_COLLECTION}-release-ubuntu24.04.deb \ + && sudo apt install -y /${PUPPET_COLLECTION}-release-ubuntu24.04.deb \ + && sudo apt update \ + && sudo apt install -y openvox-agent ; \ fi # Add 'bolt' user @@ -47,4 +58,10 @@ RUN chmod 600 /home/test/.ssh/authorized_keys RUN chown -R test:sudo /home/test # Run the sshd service in the background -CMD [ "/usr/sbin/sshd", "-D" ] +RUN echo "PubkeyAuthentication yes" >> /etc/ssh/sshd_config.d/pubkey_auth.conf && \ + echo "LogLevel VERBOSE" >> /etc/ssh/sshd_config.d/log_level.conf && \ + mkdir /run/sshd + +EXPOSE 22 + +CMD ["/usr/sbin/sshd", "-D", "-e"] diff --git a/spec/Dockerfile.puppetdb b/spec/Dockerfile.puppetdb deleted file mode 100644 index 8469550f..00000000 --- a/spec/Dockerfile.puppetdb +++ /dev/null @@ -1,8 +0,0 @@ -FROM puppet/puppetdb:7.2.0 - -# Use our own certs so this doesn't have to wait for puppetserver startup -COPY fixtures/ssl/ca.pem /opt/puppetlabs/server/data/puppetdb/certs/certs/ca.pem -COPY fixtures/ssl/cert.pem /opt/puppetlabs/server/data/puppetdb/certs/certs/server.crt -COPY fixtures/ssl/key.pem /opt/puppetlabs/server/data/puppetdb/certs/private_keys/pdb.pem -COPY fixtures/ssl/key.pem /opt/puppetlabs/server/data/puppetdb/certs/private_keys/server.key -COPY fixtures/ssl/crl.pem /opt/puppetlabs/server/data/puppetdb/certs/ca/ca_crl.pem diff --git a/spec/Dockerfile.puppetserver b/spec/Dockerfile.puppetserver deleted file mode 100644 index eeba947e..00000000 --- a/spec/Dockerfile.puppetserver +++ /dev/null @@ -1,22 +0,0 @@ -FROM puppet/puppetserver:edge - -ARG hostname="boltserver" -ENV PUPPETSERVER_HOSTNAME "$hostname" -ENV PUPPET_STORECONFIGS false -ENV PUPPET_REPORTS log - -# Use our own certs and disable the CA -COPY fixtures/ssl/ca.pem /etc/puppetlabs/puppet/ssl/certs/ca.pem -COPY fixtures/ssl/cert.pem /etc/puppetlabs/puppet/ssl/certs/"$hostname".pem -COPY fixtures/ssl/key.pem /etc/puppetlabs/puppet/ssl/private_keys/"$hostname".pem -COPY fixtures/ssl/crl.pem /etc/puppetlabs/puppet/ssl/crl.pem -COPY fixtures/ssl/ca.cfg /etc/puppetlabs/puppetserver/services.d/ca.cfg - -RUN chown -R puppet:puppet /etc/puppetlabs/puppet/ssl - -RUN /opt/puppetlabs/bin/puppet config set certname "$hostname" -RUN /opt/puppetlabs/bin/puppet config set server "$hostname" - -# Skip the normal bootstrapping and just run puppet-server -ENTRYPOINT ["/opt/puppetlabs/bin/puppetserver"] -CMD ["foreground"] diff --git a/spec/docker-compose.yml b/spec/docker-compose.yml index 5e910119..002cb9e7 100644 --- a/spec/docker-compose.yml +++ b/spec/docker-compose.yml @@ -5,45 +5,58 @@ services: container_name: ubuntu_node ports: - "20022:22" + depends_on: + openvoxserver: + condition: service_healthy puppet_7_node: build: context: . args: - PUPPET_COLLECTION: puppet7 + PUPPET_COLLECTION: openvox7 container_name: puppet_7_node ports: - "20025:22" + depends_on: + openvoxserver: + condition: service_healthy postgres: - image: postgres:11.11 + image: docker.io/postgres:17-alpine + hostname: postgres environment: - POSTGRES_PASSWORD: puppetdb - POSTGRES_USER: puppetdb - POSTGRES_DB: puppetdb + POSTGRES_DB: openvoxdb + POSTGRES_USER: openvoxdb + POSTGRES_PASSWORD: openvoxdb volumes: - ./fixtures/puppetdb/custom_source:/docker-entrypoint-initdb.d + restart: always + healthcheck: + test: ["CMD-SHELL", "sh -c 'pg_isready -U openvoxdb -d openvoxdb'"] + interval: 10s + timeout: 3s + retries: 3 - puppetdb: - build: - context: . - dockerfile: Dockerfile.puppetdb - depends_on: - - postgres - - puppetserver + openvoxdb: + image: ghcr.io/openvoxproject/openvoxdb:latest + hostname: pdb environment: - USE_PUPPETSERVER: 'false' CERTNAME: pdb + restart: always ports: - "18081:8081" + depends_on: + openvoxserver: + condition: service_healthy - puppetserver: - build: - context: . - dockerfile: Dockerfile.puppetserver - image: puppet-server - ports: - - "8140:8140" + openvoxserver: + image: ghcr.io/openvoxproject/openvoxserver:latest + hostname: puppet + environment: + OPENVOXSERVER_HOSTNAME: puppet + restart: always volumes: - ./fixtures/modules:/etc/puppetlabs/code/modules - ./fixtures/bolt_server/projects:/etc/puppetlabs/code/projects + ports: + - 8140:8140