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
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# basic-aio
## Bootstrap a basic Puppet environment using AIO packages
## Bootstrap a basic OpenVox environment

The production branch of this repo contains a Vagrantfile that will build an OpenVox
server and agent with the following configured out of the box:

The production branch of this repo contains a Vagrantfile that will build a Puppet
server using the Puppet all-in-one packages with the following configured
out of the box:
* [r10k](https://forge.puppet.com/puppet/r10k) (with this repo as its control repo)
* [Choria mcollective](http://choria.io/)
* [PuppetDB](https://puppet.com/docs/puppetdb/)
* [openvoxdb](https://puppet.com/docs/puppetdb/)

## Prerequisites

Expand All @@ -21,8 +21,8 @@ The following environment variables are used to configure the Vagrant environmen
| Environment variable | Default value | Description |
| -------------------- | ------------- | ----------- |
| `IP_SUBNET` | `192.168.32` | The internal IP subnet used by Vagrant |
| `PUPPET_VERSION` | none (use the latest) | The Puppet agent version |
| `PUPPET_RELEASE` | `8` | The Puppet major release version |
| `OPENVOX_VERSION` | none (use the latest) | The OpenVox agent version |
| `OPENVOX_RELEASE` | `8` | 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
20 changes: 10 additions & 10 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
ENV['VAGRANT_EXPERIMENTAL'] = 'typed_triggers'

ip_subnet = ENV.fetch('IP_SUBNET', '192.168.32')
puppet_version = ENV.fetch('PUPPET_VERSION', '')
puppet_release = puppet_version.empty? ? ENV.fetch('PUPPET_RELEASE', '8') : puppet_version.split('.').first
openvox_version = ENV.fetch('OPENVOX_VERSION', '')
openvox_release = openvox_version.empty? ? ENV.fetch('OPENVOX_RELEASE', '8') : 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 Expand Up @@ -45,22 +45,22 @@ Vagrant.configure('2') do |config|
config.vm.box = box
config.ssh.forward_agent = true

config.vm.define 'puppet' do |puppetserver|
puppetserver.vm.provider 'virtualbox' do |vb|
config.vm.define 'puppet' do |server|
server.vm.provider 'virtualbox' do |vb|
vb.memory = '4096'
vb.cpus = 2
vb.name = 'puppet.vagrant'
end

puppetserver.vm.provider 'libvirt' do |libvirt|
server.vm.provider 'libvirt' do |libvirt|
libvirt.memory = '4096'
libvirt.cpus = 2
libvirt.qemu_use_session = false
end

puppetserver.vm.hostname = 'puppet.vagrant'
puppetserver.vm.network 'private_network', ip: "#{ip_subnet}.5"
puppetserver.vm.synced_folder '.', '/vagrant',
server.vm.hostname = 'puppet.vagrant'
server.vm.network 'private_network', ip: "#{ip_subnet}.5"
server.vm.synced_folder '.', '/vagrant',
type: 'rsync',
rsync__exclude: ['spec/fixtures/modules/']
end
Expand Down Expand Up @@ -89,8 +89,8 @@ Vagrant.configure('2') do |config|
trigger.run = {
inline: [
'bolt plan run role -t all --run-as root',
"puppet_release=#{puppet_release}",
"puppet_version=#{puppet_version}",
"openvox_release=#{openvox_release}",
"openvox_version=#{openvox_version}",
].concat(bolt_debug_options)
.concat(stream ? ['--stream'] : [])
.concat(native_ssh ? ['--native-ssh'] : [])
Expand Down
6 changes: 4 additions & 2 deletions data/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@ mcollective::site_policies:
facts: "*"
classes: "*"

r10k::remote: "%{facts.role__puppetserver__r10k_remote}"
r10k::remote: "%{facts.role__server__r10k_remote}"

profile::puppetserver::config::autosign:
profile::server::config::autosign:
- "*.%{facts.networking.domain}"
- vagrant.mcollective

puppetdb::master::config::create_puppet_service_resource: false
puppetdb::manage_firewall: false
puppetdb::postgres_version: '17'
puppetdb::puppetdb_package: 'openvoxdb'
puppetdb::master::config::terminus_package: 'openvoxdb-termini'

choria::manage_package_repo: true
choria::broker::network_broker: true
2 changes: 1 addition & 1 deletion data/nodes/puppet.vagrant.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
classes:
- role::puppetserver
- role::server

mcollective::client: true
107 changes: 81 additions & 26 deletions site/profile/REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@

* [`profile::agent`](#profile--agent): Configures the `puppet` service
* [`profile::base`](#profile--base): Base OS customization
* [`profile::puppetdb`](#profile--puppetdb): Configure puppetdb
* [`profile::puppetserver`](#profile--puppetserver): Configure puppetserver
* [`profile::puppetserver::config`](#profile--puppetserver--config): Configures the puppet server
* [`profile::puppetserver::install`](#profile--puppetserver--install): Install puppetserver package
* [`profile::puppetserver::service`](#profile--puppetserver--service): Configure puppetserver service
* [`profile::db`](#profile--db): Configure db
* [`profile::server`](#profile--server): Configure server
* [`profile::server::config`](#profile--server--config): Configures the puppet server
* [`profile::server::install`](#profile--server--install): Install server package
* [`profile::server::service`](#profile--server--service): Configure server service

## Classes

Expand Down Expand Up @@ -78,45 +78,45 @@ Data type: `Array`

A list of packages to manage

### <a name="profile--puppetdb"></a>`profile::puppetdb`
### <a name="profile--db"></a>`profile::db`

Configure puppetdb
Configure db

#### Examples

#####

```puppet
include profile::puppetdb
include profile::db
```

### <a name="profile--puppetserver"></a>`profile::puppetserver`
### <a name="profile--server"></a>`profile::server`

Configure puppetserver
Configure server

#### Examples

#####

```puppet
include profile::puppetserver
include profile::server
```

#### Parameters

The following parameters are available in the `profile::puppetserver` class:
The following parameters are available in the `profile::server` class:

* [`manage_firewall`](#-profile--puppetserver--manage_firewall)
* [`manage_firewall`](#-profile--server--manage_firewall)

##### <a name="-profile--puppetserver--manage_firewall"></a>`manage_firewall`
##### <a name="-profile--server--manage_firewall"></a>`manage_firewall`

Data type: `Boolean`

Manage the puppetserver firewall configuration
Manage the server firewall configuration

Default value: `true`

### <a name="profile--puppetserver--config"></a>`profile::puppetserver::config`
### <a name="profile--server--config"></a>`profile::server::config`

Configures the puppet server

Expand All @@ -125,42 +125,97 @@ Configures the puppet server
#####

```puppet
include profile::puppetserver::config
include profile::server::config
```

#### Parameters

The following parameters are available in the `profile::puppetserver::config` class:
The following parameters are available in the `profile::server::config` class:

* [`autosign`](#-profile--puppetserver--config--autosign)
* [`autosign`](#-profile--server--config--autosign)

##### <a name="-profile--puppetserver--config--autosign"></a>`autosign`
##### <a name="-profile--server--config--autosign"></a>`autosign`

Data type: `Array[String]`

List of certnames or domain name globs

### <a name="profile--puppetserver--install"></a>`profile::puppetserver::install`
### <a name="profile--server--install"></a>`profile::server::install`

Install puppetserver package
Install server package

#### Examples

#####

```puppet
include profile::puppetserver::install
include profile::server::install
```

### <a name="profile--puppetserver--service"></a>`profile::puppetserver::service`
#### Parameters

The following parameters are available in the `profile::server::install` class:

* [`package`](#-profile--server--install--package)
* [`package_ensure`](#-profile--server--install--package_ensure)

##### <a name="-profile--server--install--package"></a>`package`

Data type: `String[1]`

The name of the package to install

Default value: `'openvox-server'`

##### <a name="-profile--server--install--package_ensure"></a>`package_ensure`

Configure puppetserver service
Data type: `String[1]`

The ensure value for the package

Default value: `'installed'`

### <a name="profile--server--service"></a>`profile::server::service`

Configure server service

#### Examples

#####

```puppet
include profile::puppetserver::service
include profile::server::service
```

#### Parameters

The following parameters are available in the `profile::server::service` class:

* [`service_name`](#-profile--server--service--service_name)
* [`service_ensure`](#-profile--server--service--service_ensure)
* [`service_enable`](#-profile--server--service--service_enable)

##### <a name="-profile--server--service--service_name"></a>`service_name`

Data type: `String[1]`

The name of the service to manage

Default value: `'puppetserver'`

##### <a name="-profile--server--service--service_ensure"></a>`service_ensure`

Data type: `String[1]`

The ensure value for the service

Default value: `'running'`

##### <a name="-profile--server--service--service_enable"></a>`service_enable`

Data type: `Boolean`

Whether to enable the service at boot

Default value: `true`

3 changes: 1 addition & 2 deletions site/profile/data/common.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
---
profile::base::packages: []

profile::puppetserver::install::package: puppetserver
profile::puppetserver::config::autosign: []
profile::server::config::autosign: []

profile::agent::service: puppet
profile::agent::service_ensure: running
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# @summary Configure puppetdb
# @summary Configure db
#
# @example
# include profile::puppetdb
class profile::puppetdb {
# include profile::db
class profile::db {
include 'puppetdb'
include 'puppetdb::master::config'

Expand Down
27 changes: 0 additions & 27 deletions site/profile/manifests/puppetserver.pp

This file was deleted.

9 changes: 0 additions & 9 deletions site/profile/manifests/puppetserver/install.pp

This file was deleted.

10 changes: 0 additions & 10 deletions site/profile/manifests/puppetserver/service.pp

This file was deleted.

27 changes: 27 additions & 0 deletions site/profile/manifests/server.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# @summary Configure server
#
# @param manage_firewall Manage the server firewall configuration
#
# @example
# include profile::server
class profile::server (
Boolean $manage_firewall = true,
) {
if $manage_firewall {
include 'firewalld'

firewalld_service { 'puppetmaster':
ensure => present,
zone => 'public',
service => 'puppetmaster',
}
}

include 'profile::server::install'
include 'profile::server::config'
include 'profile::server::service'

Class['profile::server::install']
-> Class['profile::server::config']
~> Class['profile::server::service']
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# @param autosign List of certnames or domain name globs
#
# @example
# include profile::puppetserver::config
class profile::puppetserver::config (
# include profile::server::config
class profile::server::config (
Array[String] $autosign,
) {
file { '/etc/puppetlabs/puppet/autosign.conf':
Expand Down
Loading