Skip to content
Merged
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
4 changes: 2 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ jobs:
- label: 'OpenVox 8'
openvox_version: '~> 8'
ruby_version: '3.2'
- label: 'OpenVox 9 Preview (OpenVox 8 + Ruby 4.0)'
openvox_version: '~> 8'
- label: 'OpenVox 9'
openvox_version: '~> 9'
ruby_version: '4.0'
env:
OPENVOX_GEM_VERSION: ${{matrix.openvox.openvox_version}}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The following environment variables are used to configure the Vagrant environmen
| -------------------- | ------------- | ----------- |
| `IP_SUBNET` | `192.168.32` | The internal IP subnet used by Vagrant |
| `OPENVOX_VERSION` | none (use the latest) | The OpenVox agent version |
| `OPENVOX_RELEASE` | `8` | The OpenVox major release version |
| `OPENVOX_RELEASE` | `9` | The OpenVox major release version |
| `EL_RELEASE` | `9` | The EL release of the base box |
| `EL_OS_NAME` | `centos` | The base box OS |
| `BOX` | Depends on EL_OS_NAME | The base box name |
Expand Down
2 changes: 1 addition & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ENV['VAGRANT_EXPERIMENTAL'] = 'typed_triggers'

ip_subnet = ENV.fetch('IP_SUBNET', '192.168.32')
openvox_version = ENV.fetch('OPENVOX_VERSION', '')
openvox_release = openvox_version.empty? ? ENV.fetch('OPENVOX_RELEASE', '8') : openvox_version.split('.').first
openvox_release = openvox_version.empty? ? ENV.fetch('OPENVOX_RELEASE', '9') : openvox_version.split('.').first
el_release = ENV.fetch('EL_RELEASE', '9')
el_os_name = ENV.fetch('EL_OS_NAME', 'centos')
def select_box(el_os_name, el_release)
Expand Down
5 changes: 5 additions & 0 deletions data/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,9 @@ puppetdb::puppetdb_package: 'openvoxdb'
puppetdb::master::config::terminus_package: 'openvoxdb-termini'

choria::manage_package_repo: true
# Choria before 0.30.3 looks up `ssldir` with `puppet apply --configprint`,
# which OpenVox 9 removed. Setting it explicitly skips that lookup.
choria::server_config:
plugin.choria.ssldir: /etc/puppetlabs/puppet/ssl
choria::broker::ssldir: /etc/puppetlabs/puppet/ssl
choria::broker::network_broker: true
10 changes: 10 additions & 0 deletions site/role/REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ The following parameters are available in the `role` plan:
* [`openvox_agent`](#-role--openvox_agent)
* [`targets`](#-role--targets)
* [`server_target`](#-role--server_target)
* [`openvox_server`](#-role--openvox_server)
* [`control_repo`](#-role--control_repo)
* [`choria_user`](#-role--choria_user)

Expand Down Expand Up @@ -113,6 +114,15 @@ The puppet server target

Default value: `'puppet'`

##### <a name="-role--openvox_server"></a>`openvox_server`

Data type: `Optional[String[1]]`

The value of `server` in the agents' `puppet.conf`. Defaults to the FQDN of
`server_target`. (OpenVox 9 no longer defaults `server` to `puppet`.)

Default value: `undef`

##### <a name="-role--control_repo"></a>`control_repo`

Data type:
Expand Down
19 changes: 19 additions & 0 deletions site/role/plans/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
# @param openvox_agent The name of the openvox-agent package
# @param targets The targets to run on
# @param server_target The puppet server target
# @param openvox_server
# The value of `server` in the agents' `puppet.conf`. Defaults to the FQDN of
# `server_target`. (OpenVox 9 no longer defaults `server` to `puppet`.)
# @param control_repo URL of the control repo
# @param choria_user User name of the demo choria user on the Puppet server
plan role (
Expand All @@ -17,6 +20,7 @@
String[1] $openvox_agent = 'openvox-agent',
TargetSpec $targets = 'all',
TargetSpec $server_target = 'puppet',
Optional[String[1]] $openvox_server = undef,
Variant[
Stdlib::HTTPUrl,
Pattern[/\Afile:\/\/\/([^\n\/\0]+(\/)?)+\z/]
Expand All @@ -43,6 +47,21 @@
# installed and collect facts.
apply_prep($targets)

# OpenVox 9 no longer falls back to `puppet` when `server` is unset,
# so set it explicitly on every target.
$server = $openvox_server ? {
undef => get_targets($server_target)[0].facts['networking']['fqdn'],
default => $openvox_server,
}
run_command(
"puppet config set server ${server} --section main",
$targets,
"Setting server to ${server}",
'_env_vars' => {
'PATH' => '/opt/puppetlabs/bin:/bin:/usr/bin',
},
)

# Use the collected facts to build a hash of `host` resources.
$hosts = get_targets($targets).reduce({}) |$memo, $target| {
$this_host = {
Expand Down
2 changes: 1 addition & 1 deletion spec/puppet/sample_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require 'spec_helper'

openvox_version = ENV.fetch('OPENVOX_VERSION', '')
openvox_release = openvox_version.empty? ? ENV.fetch('OPENVOX_RELEASE', '8') : openvox_version.split('.').first
openvox_release = openvox_version.empty? ? ENV.fetch('OPENVOX_RELEASE', '9') : openvox_version.split('.').first

describe 'server' do
# Verify the physical setup of the server
Expand Down
Loading