Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/apply.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
name: Tests
strategy:
matrix:
os: [ubuntu-22.04, windows-latest]
os: [ubuntu-24.04, windows-latest]
ruby: [3.1]
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -48,11 +48,11 @@ jobs:
- name: Install modules
if: steps.modules.outputs.cache-hit != 'true'
run: bundle exec r10k puppetfile install
- if: matrix.os == 'ubuntu-22.04'
- if: matrix.os == 'ubuntu-24.04'
uses: ./.github/actions/sudo_setup
- if: matrix.os == 'windows-latest'
uses: ./.github/actions/windows_agent_setup
- if: matrix.os == 'ubuntu-22.04'
- if: matrix.os == 'ubuntu-24.04'
name: Run tests
run: bundle exec rake ci:apply:linux
- if: matrix.os == 'windows-latest'
Expand Down
6 changes: 3 additions & 3 deletions documentation/experimental_features.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,13 +224,13 @@ specify the option on the command line as `--stream`. Bolt streams results back
they are received, with the target's safe name (the URI without the password included) and the
stream (either 'out' or 'err') appended to the message, like so:
```
Started on docker://puppet_6_node...
Started on docker://puppet_8_node...
Started on docker://puppet_7_node...
[docker://puppet_7_node] out: Hello!
[docker://puppet_6_node] out: Hello!
[docker://puppet_8_node] out: Hello!
Finished on docker://puppet_7_node:
Hello!
Finished on docker://puppet_6_node:
Finished on docker://puppet_8_node:
Hello!
```

Expand Down
32 changes: 24 additions & 8 deletions spec/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down Expand Up @@ -47,4 +58,9 @@ 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

EXPOSE 22

CMD ["/usr/sbin/sshd", "-D", "-e"]
8 changes: 0 additions & 8 deletions spec/Dockerfile.puppetdb

This file was deleted.

22 changes: 0 additions & 22 deletions spec/Dockerfile.puppetserver

This file was deleted.

63 changes: 39 additions & 24 deletions spec/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,58 +1,73 @@
version: "3"
services:
ubuntu_node:
build: .
container_name: ubuntu_node
ports:
- "20022:22"
depends_on:
openvoxserver:
condition: service_healthy

puppet_6_node:
puppet_8_node:
build:
context: .
args:
PUPPET_COLLECTION: puppet6
container_name: puppet_6_node
PUPPET_COLLECTION: openvox8
container_name: puppet_8_node
ports:
- "20024: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
depends_on:
openvoxserver:
condition: service_healthy
ports:
- "18081:8081"

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
2 changes: 1 addition & 1 deletion spec/fixtures/inventory/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ groups:
config:
ssh:
port: 20022
- name: puppet_6_node
- name: puppet_8_node
config:
ssh:
port: 20024
Expand Down
6 changes: 3 additions & 3 deletions spec/integration/apply_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,13 @@
results.each do |result|
expect(result['status']).to eq('success')
report = result['value']['report']
expect(report['resource_statuses']).to include(/Notify\[Hello puppet_[5-7]_node\]/)
expect(report['resource_statuses']).to include(/Notify\[Hello puppet_[7-8]_node\]/)
end
end

# Run on puppet_6_node and puppet_7_node only, as deferred requires >= 6.
# Run on puppet_8_node and puppet_7_node only, as deferred requires >= 6.
it 'applies the deferred type' do
result = run_cli_json(%w[plan run basic::defer -t puppet_6_node,puppet_7_node], project: project)
result = run_cli_json(%w[plan run basic::defer -t puppet_8_node,puppet_7_node], project: project)
expect(result).not_to include('kind')
expect(result[0]['status']).to eq('success')
resources = result[0]['value']['report']['resource_statuses']
Expand Down
4 changes: 2 additions & 2 deletions spec/integration/device_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
'transport' => 'remote',
'remote' => {
'remote-transport' => 'fake',
'run-on' => 'puppet_6_node',
'run-on' => 'puppet_8_node',
'path' => device_path
}
}
Expand Down Expand Up @@ -77,7 +77,7 @@
expect(results).not_to include('kind')
expect(results.dig(0, 'value', 'report', 'resource_statuses')).to include('Fake_device[key1]')

content = run_cli_json(['command', 'run', "cat '#{device_path}'", '-t', 'puppet_6_node'], project: @project)
content = run_cli_json(['command', 'run', "cat '#{device_path}'", '-t', 'puppet_8_node'], project: @project)

expect(content.dig('items', 0, 'value', 'stdout')).to eq({ key1: 'val1' }.to_json)

Expand Down
2 changes: 1 addition & 1 deletion spec/integration/parallel_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@
{ "action" => "run_task",
"object" => "error::fail",
"result_set" =>
[{ "target" => 'puppet_6_node',
[{ "target" => 'puppet_8_node',
"action" => "task",
"object" => "error::fail",
"status" => "failure",
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/bolt_spec/conn.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def docker_inventory(root: false)
'name' => 'nix_agents',
'targets' => [
{
'name' => 'puppet_6_node',
'name' => 'puppet_8_node',
'config' => { 'ssh' => { 'port' => 20024 } }
},
{
Expand Down
Loading