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
3 changes: 0 additions & 3 deletions .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,12 @@ fixtures:
apt: "puppetlabs/apt"
epel: "stahnma/epel"
concat: "puppetlabs/concat"
wget: "puppet/wget"
sudo: "saz/sudo"
python: "puppet/python"
gcc: "puppetlabs/gcc"
inifile: "puppetlabs/inifile"
mongodb: "puppet/mongodb"
postgresql: "puppetlabs/postgresql"
rabbitmq: "puppet/rabbitmq"
packagecloud: "computology/packagecloud"
selinux: "puppet/selinux"
nginx: "puppet/nginx"
nodejs: "puppet/nodejs"
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

## Development

- Refactored the system StackStorm repository handling. This replaces the `PackageCloud`
Puppet module because it was _not_ idempotent. At the same time we've moved the repository
handling from the old-school `st2::profile::repos` to the new idiomatic
`st2::repo` (base) and `st2::repo::apt` or `st2::repo::yum` based on OS type.
This is considered a minor breaking change if you were using the internal class
`st2::profile::repos`. The replacement class is `st2::repo` and is a direct replacement. (Enhancement)
Contributed by @nmaludy

- Fixed `/opt/stackstorm/packs` and `/opt/stackstorm/virtualenv` resources to be idempotent
and manage the ownership of these directories recursively in a much more efficient manner.
Instead of using the `file` resource with `recurse => true` we now utilize the module
Expand Down
2 changes: 0 additions & 2 deletions build/centos6-puppet5/Puppetfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
# │ ├── puppet-archive (v3.2.1)
# │ └── camptocamp-systemd (v2.3.0)
# ├── ghoneycutt-facter (v3.5.0)
# ├── computology-packagecloud (v0.3.2)
# ├── puppet-selinux (v1.6.1)
# ├── puppet-nginx (v0.16.0)
# └── puppet-nodejs (v7.0.0)
Expand All @@ -58,7 +57,6 @@ mod 'puppet-rabbitmq'
mod 'puppet-archive' # dependency of puppet-rabbitmq
mod 'camptocamp-systemd' # dependency of puppet-rabbitmq
mod 'ghoneycutt-facter'
mod 'computology-packagecloud'
mod 'puppet-selinux'
mod 'puppet-nginx'
mod 'puppet-nodejs'
Expand Down
2 changes: 0 additions & 2 deletions build/centos6-puppet6/Puppetfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
# │ ├── puppet-archive (v3.2.1)
# │ └── camptocamp-systemd (v2.3.0)
# ├── ghoneycutt-facter (v3.5.0)
# ├── computology-packagecloud (v0.3.2)
# ├── puppet-selinux (v1.6.1)
# ├── puppet-nginx (v0.16.0)
# └── puppet-nodejs (v7.0.0)
Expand All @@ -58,7 +57,6 @@ mod 'puppet-rabbitmq'
mod 'puppet-archive' # dependency of puppet-rabbitmq
mod 'camptocamp-systemd' # dependency of puppet-rabbitmq
mod 'ghoneycutt-facter'
mod 'computology-packagecloud'
mod 'puppet-selinux'
mod 'puppet-nginx'
mod 'puppet-nodejs'
Expand Down
2 changes: 0 additions & 2 deletions build/centos7-puppet5/Puppetfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
# │ ├── puppet-archive (v3.2.1)
# │ └── camptocamp-systemd (v2.3.0)
# ├── ghoneycutt-facter (v3.5.0)
# ├── computology-packagecloud (v0.3.2)
# ├── puppet-selinux (v1.6.1)
# ├── puppet-nginx (v0.16.0)
# └── puppet-nodejs (v7.0.0)
Expand All @@ -58,7 +57,6 @@ mod 'puppet-rabbitmq'
mod 'puppet-archive' # dependency of puppet-rabbitmq
mod 'camptocamp-systemd' # dependency of puppet-rabbitmq
mod 'ghoneycutt-facter'
mod 'computology-packagecloud'
mod 'puppet-selinux'
mod 'puppet-nginx'
mod 'puppet-nodejs'
Expand Down
2 changes: 0 additions & 2 deletions build/centos7-puppet6/Puppetfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
# │ ├── puppet-archive (v3.2.1)
# │ └── camptocamp-systemd (v2.3.0)
# ├── ghoneycutt-facter (v3.5.0)
# ├── computology-packagecloud (v0.3.2)
# ├── puppet-selinux (v1.6.1)
# ├── puppet-nginx (v0.16.0)
# └── puppet-nodejs (v7.0.0)
Expand All @@ -58,7 +57,6 @@ mod 'puppet-rabbitmq'
mod 'puppet-archive' # dependency of puppet-rabbitmq
mod 'camptocamp-systemd' # dependency of puppet-rabbitmq
mod 'ghoneycutt-facter'
mod 'computology-packagecloud'
mod 'puppet-selinux'
mod 'puppet-nginx'
mod 'puppet-nodejs'
Expand Down
2 changes: 0 additions & 2 deletions build/ubuntu14-puppet5/Puppetfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
# │ ├── puppet-archive (v3.2.1)
# │ └── camptocamp-systemd (v2.3.0)
# ├── ghoneycutt-facter (v3.5.0)
# ├── computology-packagecloud (v0.3.2)
# ├── puppet-selinux (v1.6.1)
# ├── puppet-nginx (v0.16.0)
# └── puppet-nodejs (v7.0.0)
Expand All @@ -58,7 +57,6 @@ mod 'puppet-rabbitmq'
mod 'puppet-archive' # dependency of puppet-rabbitmq
mod 'camptocamp-systemd' # dependency of puppet-rabbitmq
mod 'ghoneycutt-facter'
mod 'computology-packagecloud'
mod 'puppet-selinux'
mod 'puppet-nginx'
mod 'puppet-nodejs'
Expand Down
2 changes: 0 additions & 2 deletions build/ubuntu14-puppet6/Puppetfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
# │ ├── puppet-archive (v3.2.1)
# │ └── camptocamp-systemd (v2.3.0)
# ├── ghoneycutt-facter (v3.5.0)
# ├── computology-packagecloud (v0.3.2)
# ├── puppet-selinux (v1.6.1)
# ├── puppet-nginx (v0.16.0)
# └── puppet-nodejs (v7.0.0)
Expand All @@ -58,7 +57,6 @@ mod 'puppet-rabbitmq'
mod 'puppet-archive' # dependency of puppet-rabbitmq
mod 'camptocamp-systemd' # dependency of puppet-rabbitmq
mod 'ghoneycutt-facter'
mod 'computology-packagecloud'
mod 'puppet-selinux'
mod 'puppet-nginx'
mod 'puppet-nodejs'
Expand Down
2 changes: 0 additions & 2 deletions build/ubuntu16-puppet5/Puppetfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
# │ ├── puppet-archive (v3.2.1)
# │ └── camptocamp-systemd (v2.3.0)
# ├── ghoneycutt-facter (v3.5.0)
# ├── computology-packagecloud (v0.3.2)
# ├── puppet-selinux (v1.6.1)
# ├── puppet-nginx (v0.16.0)
# └── puppet-nodejs (v7.0.0)
Expand All @@ -58,7 +57,6 @@ mod 'puppet-rabbitmq'
mod 'puppet-archive' # dependency of puppet-rabbitmq
mod 'camptocamp-systemd' # dependency of puppet-rabbitmq
mod 'ghoneycutt-facter'
mod 'computology-packagecloud'
mod 'puppet-selinux'
mod 'puppet-nginx'
mod 'puppet-nodejs'
Expand Down
2 changes: 0 additions & 2 deletions build/ubuntu16-puppet6/Puppetfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
# │ ├── puppet-archive (v3.2.1)
# │ └── camptocamp-systemd (v2.3.0)
# ├── ghoneycutt-facter (v3.5.0)
# ├── computology-packagecloud (v0.3.2)
# ├── puppet-selinux (v1.6.1)
# ├── puppet-nginx (v0.16.0)
# └── puppet-nodejs (v7.0.0)
Expand All @@ -58,7 +57,6 @@ mod 'puppet-rabbitmq'
mod 'puppet-archive' # dependency of puppet-rabbitmq
mod 'camptocamp-systemd' # dependency of puppet-rabbitmq
mod 'ghoneycutt-facter'
mod 'computology-packagecloud'
mod 'puppet-selinux'
mod 'puppet-nginx'
mod 'puppet-nodejs'
Expand Down
3 changes: 0 additions & 3 deletions build/ubuntu18-puppet5/Puppetfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
# ├── puppetlabs-stdlib (v5.2.0)
# ├─┬ puppetlabs-apt (v6.3.0)
# │ └── puppetlabs-translate (v1.2.0)
# ├── puppet-wget (v2.0.1)
# ├── saz-sudo (v6.0.0)
# ├─┬ puppet-python (v2.2.2)
# │ └── stahnma-epel (v1.3.1)
Expand All @@ -48,7 +47,6 @@ mod 'jamtur01-httpauth'
mod 'puppetlabs-apt'
mod 'stahnma-epel'
mod 'puppetlabs-translate' # dependency of puppetlabs-apt
mod 'puppet-wget'
mod 'saz-sudo'
mod 'puppet-python'
mod 'puppet-mongodb'
Expand All @@ -58,7 +56,6 @@ mod 'puppet-rabbitmq'
mod 'puppet-archive' # dependency of puppet-rabbitmq
mod 'camptocamp-systemd' # dependency of puppet-rabbitmq
mod 'ghoneycutt-facter'
mod 'computology-packagecloud'
mod 'puppet-selinux'
mod 'puppet-nginx'
mod 'puppet-nodejs'
Expand Down
3 changes: 0 additions & 3 deletions build/ubuntu18-puppet6/Puppetfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
# ├── puppetlabs-stdlib (v5.2.0)
# ├─┬ puppetlabs-apt (v6.3.0)
# │ └── puppetlabs-translate (v1.2.0)
# ├── puppet-wget (v2.0.1)
# ├── saz-sudo (v6.0.0)
# ├─┬ puppet-python (v2.2.2)
# │ └── stahnma-epel (v1.3.1)
Expand All @@ -48,7 +47,6 @@ mod 'jamtur01-httpauth'
mod 'puppetlabs-apt'
mod 'stahnma-epel'
mod 'puppetlabs-translate' # dependency of puppetlabs-apt
mod 'puppet-wget'
mod 'saz-sudo'
mod 'puppet-python'
mod 'puppet-mongodb'
Expand All @@ -58,7 +56,6 @@ mod 'puppet-rabbitmq'
mod 'puppet-archive' # dependency of puppet-rabbitmq
mod 'camptocamp-systemd' # dependency of puppet-rabbitmq
mod 'ghoneycutt-facter'
mod 'computology-packagecloud'
mod 'puppet-selinux'
mod 'puppet-nginx'
mod 'puppet-nodejs'
Expand Down
4 changes: 2 additions & 2 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Version of StackStorm package to install (default = 'present')
# See the package 'ensure' property:
# https://puppet.com/docs/puppet/5.5/types/package.html#package-attribute-ensure
# @param repository
# @param [St2::Repository] repository
# Release repository to enable. 'stable', 'unstable'
# (default = 'stable')
# @param conf_dir
Expand Down Expand Up @@ -223,7 +223,7 @@
#
class st2(
$version = 'present',
$repository = $::st2::params::repository,
St2::Repository $repository = $::st2::params::repository,
$conf_dir = $::st2::params::conf_dir,
$conf_file = "${::st2::params::conf_dir}/st2.conf",
$use_ssl = $::st2::params::use_ssl,
Expand Down
2 changes: 1 addition & 1 deletion manifests/profile/fullinstall.pp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
Anchor['st2::begin']
-> Anchor['st2::bootstrap']
-> class { 'st2::profile::facter': }
-> class { 'st2::profile::repos': }
-> class { 'st2::repo': }
-> class { 'st2::profile::selinux': }
-> Anchor['st2::pre_reqs']
-> class { 'st2::profile::nodejs': }
Expand Down
41 changes: 0 additions & 41 deletions manifests/profile/repos.pp

This file was deleted.

57 changes: 57 additions & 0 deletions manifests/repo.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# @summary Manages the installation of st2 required repos for installing the StackStorm packages.
#
# @example Basic usage
# include st2::repo
#
# @example Installing from unstable
# class { 'st2::repo':
# repository => 'unstable',
# }
#
# @param [Enum['present', 'absent']] ensure
# The basic state the repo should be in
#
# @param [St2::Repository] repository
# Release repository to enable
#
class st2::repo (
Enum['present', 'absent'] $ensure = 'present',
St2::Repository $repository = 'stable',
) {
case $facts['os']['family'] {
'RedHat': {
# RedHat distros need EPEL
require epel

$dist_version = $facts['os']['release']['major']
$baseurl = "https://packagecloud.io/StackStorm/${repository}/el/${dist_version}/\$basearch"
$gpgkey = "https://packagecloud.io/StackStorm/${repository}/gpgkey"

contain st2::repo::yum
}

'Debian': {
# debian, ubuntu, etc
$osname = downcase($facts['os']['name'])
# trusty, xenial, bionic, etc
$release = downcase($facts['os']['distro']['codename'])
$location = "https://packagecloud.io/StackStorm/${repository}/${osname}"
$repos = 'main'

$key_id = $repository ? {
'stable' => '3CE01873543A4CCE',
'staging-stable' => '527B93CA96ADF311',
'staging-unstable' => '9A2236A8CEC0C6A8',
'unstable' => '1CDF3CE710B2CCF3',
default => '3CE01873543A4CCE', # stable
}
$key_source = "https://packagecloud.io/StackStorm/${repository}/gpgkey"

contain st2::repo::apt
}

default: {
fail("Unsupported managed repository for osfamily: ${facts['os']['family']}, operatingsystem: ${facts['os']['name']}")
}
}
}
22 changes: 22 additions & 0 deletions manifests/repo/apt.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Apt repo for StackStorm
class st2::repo::apt {
if $st2::repo::ensure == 'present' {
apt::source { "StackStorm_${st2::repo::repository}":
location => $st2::repo::location,
release => $st2::repo::release,
repos => $st2::repo::repos,
key => {
'id' => $st2::repo::key_id,
'source' => $st2::repo::key_source,
},
}

Apt::Source["StackStorm_${st2::repo::repository}"]
-> Package<| tag == 'st2::server::packages' |>
}
else {
apt::source { "StackStorm_${st2::repo::repository}":
ensure => absent,
}
}
}
20 changes: 20 additions & 0 deletions manifests/repo/yum.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Yum repo for StackStorm
class st2::repo::yum {
if $st2::repo::ensure == 'present' {
yumrepo { "StackStorm_${st2::repo::repository}":
baseurl => $st2::repo::baseurl,
enabled => '1',
gpgcheck => '0',
repo_gpgcheck => '1',
gpgkey => $st2::repo::gpgkey,
}

Yumrepo["StackStorm_${st2::repo::repository}"]
-> Package<| tag == 'st2::server::packages' |>
}
else {
yumrepo { "StackStorm_${st2::repo::repository}":
ensure => absent,
}
}
}
4 changes: 0 additions & 4 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@
"name": "ghoneycutt/facter",
"version_requirement": ">= 3.0.0 < 4.0.0"
},
{
"name": "computology/packagecloud",
"version_requirement": ">= 0.3.1 < 1.0.0"
},
{
"name": "puppet/selinux",
"version_requirement": ">= 0.5.0 < 4.0.0"
Expand Down
2 changes: 2 additions & 0 deletions types/repository.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Validate the type of system package repository for StackStorm
type St2::Repository = Enum['stable', 'unstable', 'staging-stable', 'staging-unstable']