Skip to content

Commit 5cd0fcf

Browse files
committed
Enable IoP
Signed-off-by: Eric D. Helms <ericdhelms@gmail.com>
1 parent 13ed5f6 commit 5cd0fcf

File tree

8 files changed

+89
-4
lines changed

8 files changed

+89
-4
lines changed

.fixtures.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,8 @@ fixtures:
2626
puppet_version: '>= 6.0.0'
2727
systemd: "https://github.com/camptocamp/puppet-systemd"
2828
rhsm: "https://github.com/voxpupuli/puppet-rhsm"
29+
podman:
30+
repo: 'https://github.com/ehelms/puppet-podman'
31+
branch: 'allow-disabled-quadlet'
32+
iop: "https://github.com/ehelms/puppet-iop"
33+
hashfile: "https://github.com/southalc/hashfile"

manifests/bundle.pp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@
66
String $user = $katello_devel::user,
77
Stdlib::Absolutepath $cwd = $katello_devel::foreman_dir,
88
Integer[0] $timeout = 600,
9+
Optional[String] $command = undef,
910
) {
11+
$bundle_command = pick($command, $title)
12+
1013
exec { "bundle-${title}":
11-
command => "bundle ${title}",
14+
command => "bundle ${bundle_command}",
1215
environment => $environment + ["HOME=/home/${user}"],
1316
cwd => $cwd,
1417
user => $user,

manifests/database.pp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
database => 'all',
3939
user => 'all',
4040
address => '127.0.0.1/32',
41-
order => 2,
41+
order => 4,
4242
auth_method => 'trust',
4343
}
4444

@@ -47,7 +47,7 @@
4747
database => 'all',
4848
user => 'all',
4949
address => '::1/128',
50-
order => 3,
50+
order => 5,
5151
auth_method => 'trust',
5252
}
5353

manifests/init.pp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@
7373
#
7474
# @param rails_cache_store
7575
# Manage the type of cache used for Rails, default is Redis.
76+
#
77+
# @param enable_iop
78+
# Enable iop integration
79+
#
7680
class katello_devel (
7781
String $user = undef,
7882
Stdlib::Absolutepath $deployment_dir = '/home/vagrant',
@@ -98,6 +102,7 @@
98102
Boolean $katello_manage_repo = true,
99103
Boolean $rex_manage_repo = true,
100104
Hash[String, Any] $rails_cache_store = { 'type' => 'redis' },
105+
Boolean $enable_iop = false,
101106
) inherits katello_devel::params {
102107
$group = $user
103108

@@ -175,4 +180,8 @@
175180
group => $group,
176181
mode => '0755',
177182
}
183+
184+
if $enable_iop {
185+
include katello_devel::iop
186+
}
178187
}

manifests/iop.pp

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# @summary Insights on Premise (IoP) integration for Katello development
2+
# @api private
3+
class katello_devel::iop {
4+
postgresql::server::pg_hba_rule { 'inventory_db IPV4':
5+
type => 'host',
6+
database => 'inventory_db',
7+
user => 'all',
8+
address => '127.0.0.1/32',
9+
order => 2,
10+
auth_method => 'md5',
11+
}
12+
13+
postgresql::server::pg_hba_rule { 'inventory_db IPV6':
14+
type => 'host',
15+
database => 'inventory_db',
16+
user => 'all',
17+
address => '::1/128',
18+
order => 3,
19+
auth_method => 'md5',
20+
}
21+
22+
# Create directory structure for Foreman assets
23+
file {
24+
[
25+
'/var/lib/foreman',
26+
'/var/lib/foreman/public',
27+
'/var/lib/foreman/public/assets',
28+
'/var/lib/foreman/public/assets/apps',
29+
]:
30+
ensure => directory,
31+
owner => 'root',
32+
group => 'root',
33+
mode => '0755',
34+
} ->
35+
Katello_devel::Git_repo['foreman'] ->
36+
katello_devel::plugin { 'theforeman/foreman_rh_cloud': } ->
37+
Katello_devel::Bundle['exec rake db:migrate'] ->
38+
class { 'iop': }
39+
}

manifests/setup.pp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
String $admin_password = $katello_devel::admin_password,
99
Integer[0] $npm_timeout = $katello_devel::npm_timeout,
1010
) {
11-
$pidfile = "${foreman_dir}/tmp/pids/server.pid"
11+
$pidfile = "${foreman_dir}/tmp/pids/main-server.pid"
1212

1313
$seed_env = [
1414
"SEED_ORGANIZATION=${initial_organization}",
@@ -29,6 +29,7 @@
2929

3030
if defined(Class['foreman_proxy::register']) {
3131
katello_devel::bundle { 'exec rails s -d':
32+
command => "exec rails s -d -P ${pidfile}",
3233
unless => "/usr/bin/pgrep --pidfile ${pidfile}",
3334
subscribe => Katello_devel::Bundle['exec rake db:seed'],
3435
} ->
@@ -37,6 +38,9 @@
3738
command => "/usr/bin/pkill -9 --pidfile ${pidfile}",
3839
logoutput => 'on_failure',
3940
timeout => '600',
41+
} ->
42+
file { $pidfile:
43+
ensure => absent,
4044
}
4145
}
4246
}

spec/acceptance/iop_spec.rb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
require 'spec_helper_acceptance'
2+
3+
describe 'Scenario: install katello_devel' do
4+
let(:manifest) do
5+
<<-PUPPET
6+
class { 'katello_devel':
7+
user => 'vagrant',
8+
enable_iop => true,
9+
}
10+
PUPPET
11+
end
12+
13+
it 'applies with no errors' do
14+
apply_manifest(manifest, catch_failures: true)
15+
end
16+
end

spec/setup_acceptance_node.pp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,12 @@
1212
ensure => present,
1313
managehome => true,
1414
}
15+
16+
package { ['rubygem-oauth', 'puppet-agent-oauth']:
17+
ensure => installed,
18+
require => Class['foreman::repo'],
19+
}
20+
21+
package { 'podman':
22+
ensure => latest,
23+
}

0 commit comments

Comments
 (0)