Skip to content

Commit

Permalink
Trying to fix rhel 7 integration test for st2web
Browse files Browse the repository at this point in the history
  • Loading branch information
nmaludy committed Nov 27, 2017
1 parent b4eff43 commit 7c8ac56
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions manifests/profile/web.pp
Expand Up @@ -15,10 +15,10 @@
# class { '::st2::profile::web': }
#
class st2::profile::web(
$ssl_dir = $::st2::st2web_ssl_dir,
$ssl_cert = $::st2::st2web_ssl_cert,
$ssl_key = $::st2::st2web_ssl_key,
$version = $::st2::version,
$ssl_dir = $st2::st2web_ssl_dir,
$ssl_cert = $st2::st2web_ssl_cert,
$ssl_key = $st2::st2web_ssl_key,
$version = $st2::version,
) inherits st2 {
# include nginx here only
# if we include this in ::st2::profile::fullinstall Anchor['pre_reqs'] then
Expand All @@ -27,7 +27,7 @@
include ::st2::profile::nginx

## Install the packages
package { $::st2::params::st2_web_packages:
package { $st2::params::st2_web_packages:
ensure => $version,
tag => 'st2::web::packages',
}
Expand All @@ -46,31 +46,31 @@
}

## st2 nginx config
file { "${::st2::params::nginx_conf_d}/st2.conf":
file { "${st2::params::nginx_conf_d}/st2.conf":
ensure => 'file',
owner => 'root',
group => 'root',
mode => '0644',
source => $::st2::params::nginx_st2_conf,
subscribe => Package[$::st2::params::st2_server_package],
source => $st2::params::nginx_st2_conf,
subscribe => Package[$st2::params::st2_server_package],
notify => Service['nginx'],
}

## Modify default nginx config
case $::osfamily {
'RedHat': {
# remove 'default_server' string from default nginx config
exec { $::st2::params::nginx_default_conf:
command => "sed -i 's/default_server//g' ${::st2::params::nginx_default_conf}",
unless => "test `grep 'default_server' ${::st2::params::nginx_default_conf} | wc -l` > 0",
exec { $st2::params::nginx_default_conf:
command => "sed -i 's/default_server//g' ${st2::params::nginx_default_conf}",
unless => "test `grep 'default_server' ${st2::params::nginx_default_conf} | wc -l` > 0",
path => ['/usr/bin', '/bin'],
require => Package['nginx'],
notify => Service['nginx'],
}
}
'Debian': {
# remove the default nginx config
file { $::st2::params::nginx_default_conf:
file { $st2::params::nginx_default_conf:
ensure => 'absent',
require => Package['nginx'],
notify => Service['nginx'],
Expand All @@ -86,6 +86,6 @@
-> Package<| tag == 'st2::web::packages' |>
-> File[$ssl_dir]
-> Exec["generate ssl cert ${ssl_cert}"]
-> File["${::st2::params::nginx_conf_d}/st2.conf"]
-> File["${st2::params::nginx_conf_d}/st2.conf"]
~> Service['nginx'] # notify to force a refresh
}

0 comments on commit 7c8ac56

Please sign in to comment.