Skip to content

Commit

Permalink
Merge 8bcf9b6 into acddaa3
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Hoolboom committed Sep 16, 2015
2 parents acddaa3 + 8bcf9b6 commit db9b291
Show file tree
Hide file tree
Showing 16 changed files with 340 additions and 38 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
## Under Development
* Configure st2client CLI settings for any user (*improvement*)

## 0.9.0 (Sept 16, 2015)
* Add support for RHEL/CentOS 6 & 7

## 0.8.0 (Sept 10, 2015)
* Release StackStorm v0.13.2
* Stop `st2::pack` resource restarting StackStorm (*improvement*)
Expand Down
2 changes: 1 addition & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@
$syslog_protocol = 'udp',
$syslog_port = 514,
$syslog_facility = 'local7',
) { }
) {}
7 changes: 6 additions & 1 deletion manifests/package/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@
undef => st2_latest_stable_revision($_version, $_type),
default => $revision,
}
$_package_version = "${_version}-${_revision}"
# Temporary Hack while fixing build pipeline
if $name =~ /client/ {
$_package_version = "${_version}.${_revision}-1"
} else {
$_package_version = "${_version}-${_revision}"
}
}
default: { fail("Class[st2::package]: $st2::notice::unsupported_os") }
}
Expand Down
4 changes: 2 additions & 2 deletions manifests/package/redhat.pp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
$version = $::st2::version,
) inherits st2 {
$_os = downcase($::operatingsystem)
$_osver = $::operatingsystemrelease
$_osver = $::operatingsystemmajrelease

if $version =~ /dev$/ {
$_suite = "unstable"
Expand All @@ -21,7 +21,7 @@

yumrepo { 'stackstorm':
ensure => present,
baseurl => "https://downloads.stackstorm.net/rpm/${_os}/${_osver}/${_suite}",
baseurl => "https://downloads.stackstorm.net/rpm/el/${_osver}/${_suite}",
descr => 'StackStorm RPM Repository',
enabled => 1,
gpgcheck => 0,
Expand Down
20 changes: 17 additions & 3 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,23 @@
'st2auth',
'st2debug',
]
$st2_client_packages = [
'python-st2client',
]
case $::osfamily {
'Debian': {
$st2_client_packages = [
'python-st2client',
]
}
'RedHat': {
$st2_client_packages = [
'st2client',
]
}
default: {
$st2_client_packages = [
'python-st2client',
]
}
}

### Debian Specific Information ###
$debian_dependencies = [
Expand Down
28 changes: 24 additions & 4 deletions manifests/profile/client.pp
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,33 @@
wget::fetch { 'Download st2client requirements.txt':
source => "https://raw.githubusercontent.com/StackStorm/st2/${_git_tag}/st2client/requirements.txt",
cache_dir => '/var/cache/wget',
destination => '/tmp/st2client-requirements.txt',
before => Python::Requirements['/tmp/st2client-requirements.txt'],
destination => '/tmp/st2client-requirements.txt'
}
}

python::requirements { '/tmp/st2client-requirements.txt':
notify => File['/etc/facter/facts.d/st2client_bootstrapped.txt'],
# More RedHat 6 hackery. Need to use pip2.7.
case $::osfamily {
'Debian': {
python::requirements { '/tmp/st2client-requirements.txt':
notify => File['/etc/facter/facts.d/st2client_bootstrapped.txt'],
require => Wget::Fetch['Download st2client requirements.txt']
}
}
'RedHat': {
if $operatingsystemmajrelease == '6' {
exec { 'pip27_install_st2client_reqs':
path => '/usr/bin:/usr/sbin:/bin:/sbin',
command => 'pip2.7 install -U -r /tmp/st2client-requirements.txt',
notify => File['/etc/facter/facts.d/st2client_bootstrapped.txt'],
require => Wget::Fetch['Download st2client requirements.txt']
}
} else {
python::requirements { '/tmp/st2client-requirements.txt':
notify => File['/etc/facter/facts.d/st2client_bootstrapped.txt'],
require => Wget::Fetch['Download st2client requirements.txt']
}
}
}
}

# Setup st2client settings for Root user by default
Expand Down
33 changes: 33 additions & 0 deletions manifests/profile/facter.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# == Class: st2::profile::facter
#
# setup custom fact locations
#
# === Parameters
#
# This module contains no parameters
#
# === Variables
#
# This module contains no variables
#
# === Examples
#
# include st2::profile::facter
#
class st2::profile::facter {
# The hackery is strong. Not sure where else to hack this in.
file{'/etc/facter':
ensure => 'directory',
owner => 'root',
group => 'root',
mode => '0444'
}

file{'/etc/facter/facts.d':
ensure => 'directory',
owner => 'root',
group => 'root',
mode => '0444',
require => File['/etc/facter']
}
}
16 changes: 16 additions & 0 deletions manifests/profile/fullinstall.pp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@
# include st2::profile::fullinstall
#
class st2::profile::fullinstall inherits st2 {

class { '::st2::profile::facter':
before => Anchor['st2::bootstrap']
}

class { '::st2::profile::repos':
before => Anchor['st2::bootstrap']
}

class { '::st2::profile::python':
before => Anchor['st2::pre_reqs'],
}
Expand All @@ -31,8 +40,15 @@
before => Anchor['st2::pre_reqs'],
}

anchor { 'st2::bootstrap': }
anchor { 'st2::pre_reqs': }

Anchor['st2::bootstrap']
-> Class['::st2::profile::python']
-> Class['::st2::profile::rabbitmq']
-> Class['::st2::profile::mongodb']
-> Class['::st2::profile::mistral']

Anchor['st2::pre_reqs']
-> class { '::st2::profile::client': }
-> class { '::st2::profile::server': }
Expand Down
40 changes: 30 additions & 10 deletions manifests/profile/mistral.pp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
$disable_executor = false,
$disable_engine = false,
) inherits st2 {
include '::st2::dependencies'
require '::st2::dependencies'

$_st2_version = $autoupdate ? {
undef => st2_latest_stable(),
Expand Down Expand Up @@ -140,10 +140,16 @@

### END Mistral Downloads ###

if ($::osfamily == "RedHat") and ($operatingsystemmajrelease == '6') {
$python_version = '2.7'
} else {
$python_version = 'system'
}

### Bootstrap Python ###
python::virtualenv { $_mistral_root:
ensure => present,
version => 'system',
version => $python_version,
systempkgs => false,
venv_dir => "${_mistral_root}/.venv",
cwd => $_mistral_root,
Expand All @@ -157,7 +163,7 @@
# Not using virtualenv requirements attribute because oslo has bad wheel, and fails
python::requirements { 'mistral':
requirements => "${_mistral_root}/requirements.txt",
virtualenv => "${_mistral_root}/.venv",
virtualenv => "${_mistral_root}/.venv"
}

python::pip { 'python-mistralclient':
Expand All @@ -168,6 +174,7 @@
Exec['setup st2mistral plugin'],
Exec['setup mistral database'],
],
virtualenv => "${_mistral_root}/.venv"
}
### END Bootstrap Python ###

Expand Down Expand Up @@ -292,7 +299,7 @@
owner => 'root',
group => 'root',
mode => '0444',
content => 'mistral_bootstrapped=true'
content => 'mistral_bootstrapped=true',
}

### Set Mistral API Settings. Useful when setting up uWSGI or other server
Expand Down Expand Up @@ -351,12 +358,25 @@
}
}
'RedHat': {
file { '/etc/systemd/system/mistral.service':
ensure => file,
owner => 'root',
group => 'root',
mode => '0444',
content => template('st2/etc/systemd/mistral.service.erb'),
case $::operatingsystemmajrelease {
'7': {
file { '/etc/systemd/system/mistral.service':
ensure => file,
owner => 'root',
group => 'root',
mode => '0444',
content => template('st2/etc/systemd/system/mistral.service.erb'),
}
}
'6': {
file { '/etc/init.d/mistral':
ensure => file,
owner => 'root',
group => 'root',
mode => '0755',
content => template('st2/etc/init.d/mistral.erb'),
}
}
}
}
}
Expand Down
9 changes: 8 additions & 1 deletion manifests/profile/mongodb.pp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,14 @@
include '::st2::params'

if !defined(Class['::mongodb::server']) {
class { '::mongodb::server': }
if $::osfamily == "RedHat" {
Yumrepo['epel']->
class {'::mongodb::server': }->
class {'::mongodb::client': }

}else{
class { '::mongodb::server': }
}
}

$_mongodb_dependencies = $::osfamily ? {
Expand Down
31 changes: 25 additions & 6 deletions manifests/profile/python.pp
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,31 @@
# include st2::profile::python
#
class st2::profile::python {
if !defined(Class['::python']) {
class { '::python':
version => 'system',
pip => true,
dev => true,
virtualenv => true,
if ($::osfamily == "RedHat") and ($operatingsystemmajrelease == '6') {
package {'python27':
ensure => 'latest'
}
package {'python27-virtualenv':
ensure => 'latest'
}
package {'python27-devel':
ensure => 'latest'
}
exec {'install_pip27':
path => '/usr/bin:/usr/sbin:/bin:/sbin',
command => 'easy_install-2.7 pip',
require => Package['python27']
}
} else {
if !defined(Class['::python']) {
class { '::python':
version => 'system',
pip => true,
dev => true,
virtualenv => true,
}
}
}


}
15 changes: 15 additions & 0 deletions manifests/profile/rabbitmq.pp
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,19 @@
package_apt_pin => '100',
}
}

if $::osfamily == "RedHat" {
class {'::erlang': }

yumrepo { 'erlang-solutions':
ensure => present,
baseurl => "http://packages.erlang-solutions.com/rpm/centos/\$releasever/\$basearch",
descr => 'Centos $releasever - $basearch - Erlang Solutions',
enabled => 1,
gpgcheck => 0,
}
Yumrepo['erlang-solutions']
-> Class['::erlang']
-> Class['::rabbitmq']
}
}
31 changes: 31 additions & 0 deletions manifests/profile/repos.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# == Class: st2::profile::python
#
# Installation of st2 required repos
#
# === Parameters
#
# This module contains no parameters
#
# === Variables
#
# This module contains no variables
#
# === Examples
#
# include st2::profile::repos
#
class st2::profile::repos {
if $::osfamily == "RedHat" {
require epel

if $operatingsystemmajrelease == '6' {
package{'ius-release':
ensure => 'installed',
provider => 'rpm',
source => 'https://dl.iuscommunity.org/pub/ius/stable/CentOS/6/x86_64/ius-release-1.0-14.ius.centos6.noarch.rpm',
install_options => '--nodeps',
require => Yumrepo['epel']
}
}
}
}
Loading

0 comments on commit db9b291

Please sign in to comment.