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
5 changes: 5 additions & 0 deletions .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,8 @@ fixtures:
puppet_version: '>= 6.0.0'
systemd: "https://github.com/camptocamp/puppet-systemd"
rhsm: "https://github.com/voxpupuli/puppet-rhsm"
podman:
repo: 'https://github.com/ehelms/puppet-podman'
branch: 'allow-disabled-quadlet'
iop: "https://github.com/ehelms/puppet-iop"
hashfile: "https://github.com/southalc/hashfile"
5 changes: 4 additions & 1 deletion manifests/bundle.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
String $user = $katello_devel::user,
Stdlib::Absolutepath $cwd = $katello_devel::foreman_dir,
Integer[0] $timeout = 600,
Optional[String] $command = undef,
) {
$bundle_command = pick($command, $title)

exec { "bundle-${title}":
command => "bundle ${title}",
command => "bundle ${bundle_command}",
environment => $environment + ["HOME=/home/${user}"],
cwd => $cwd,
user => $user,
Expand Down
4 changes: 2 additions & 2 deletions manifests/database.pp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
database => 'all',
user => 'all',
address => '127.0.0.1/32',
order => 2,
order => 4,
auth_method => 'trust',
}

Expand All @@ -47,7 +47,7 @@
database => 'all',
user => 'all',
address => '::1/128',
order => 3,
order => 5,
auth_method => 'trust',
}

Expand Down
9 changes: 9 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@
#
# @param rails_cache_store
# Manage the type of cache used for Rails, default is Redis.
#
# @param enable_iop
# Enable iop integration
#
class katello_devel (
String $user = undef,
Stdlib::Absolutepath $deployment_dir = '/home/vagrant',
Expand All @@ -98,6 +102,7 @@
Boolean $katello_manage_repo = true,
Boolean $rex_manage_repo = true,
Hash[String, Any] $rails_cache_store = { 'type' => 'redis' },
Boolean $enable_iop = false,
) inherits katello_devel::params {
$group = $user

Expand Down Expand Up @@ -175,4 +180,8 @@
group => $group,
mode => '0755',
}

if $enable_iop {
include katello_devel::iop
}
}
39 changes: 39 additions & 0 deletions manifests/iop.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# @summary Insights on Premise (IoP) integration for Katello development
# @api private
class katello_devel::iop {
postgresql::server::pg_hba_rule { 'inventory_db IPV4':
type => 'host',
database => 'inventory_db',
user => 'all',
address => '127.0.0.1/32',
order => 2,
auth_method => 'md5',
}

postgresql::server::pg_hba_rule { 'inventory_db IPV6':
type => 'host',
database => 'inventory_db',
user => 'all',
address => '::1/128',
order => 3,
auth_method => 'md5',
}

# Create directory structure for Foreman assets
file {
[
'/var/lib/foreman',
'/var/lib/foreman/public',
'/var/lib/foreman/public/assets',
'/var/lib/foreman/public/assets/apps',
]:
ensure => directory,
owner => 'root',
group => 'root',
mode => '0755',
} ->
Katello_devel::Git_repo['foreman'] ->
katello_devel::plugin { 'theforeman/foreman_rh_cloud': } ->
Katello_devel::Bundle['exec rake db:migrate'] ->
class { 'iop': }
}
6 changes: 5 additions & 1 deletion manifests/setup.pp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
String $admin_password = $katello_devel::admin_password,
Integer[0] $npm_timeout = $katello_devel::npm_timeout,
) {
$pidfile = "${foreman_dir}/tmp/pids/server.pid"
$pidfile = "${foreman_dir}/tmp/pids/main-server.pid"

$seed_env = [
"SEED_ORGANIZATION=${initial_organization}",
Expand All @@ -29,6 +29,7 @@

if defined(Class['foreman_proxy::register']) {
katello_devel::bundle { 'exec rails s -d':
command => "exec rails s -d -P ${pidfile}",
unless => "/usr/bin/pgrep --pidfile ${pidfile}",
subscribe => Katello_devel::Bundle['exec rake db:seed'],
} ->
Expand All @@ -37,6 +38,9 @@
command => "/usr/bin/pkill -9 --pidfile ${pidfile}",
logoutput => 'on_failure',
timeout => '600',
} ->
file { $pidfile:
ensure => absent,
}
}
}
16 changes: 16 additions & 0 deletions spec/acceptance/iop_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
require 'spec_helper_acceptance'

describe 'Scenario: install katello_devel' do
let(:manifest) do
<<-PUPPET
class { 'katello_devel':
user => 'vagrant',
enable_iop => true,
}
PUPPET
end

it 'applies with no errors' do
apply_manifest(manifest, catch_failures: true)
end
end
9 changes: 9 additions & 0 deletions spec/setup_acceptance_node.pp
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,12 @@
ensure => present,
managehome => true,
}

package { ['rubygem-oauth', 'puppet-agent-oauth']:
ensure => installed,
require => Class['foreman::repo'],
}

package { 'podman':
ensure => latest,
}