forked from theforeman/puppet-katello_devel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.pp
More file actions
178 lines (163 loc) · 5.18 KB
/
init.pp
File metadata and controls
178 lines (163 loc) · 5.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# @summary Install and configure Katello for development
#
# @param user
# The Katello system user name
#
# @param deployment_dir
# Location to deploy Katello to in development
#
# @param oauth_key
# The oauth key for talking to the candlepin API
#
# @param oauth_secret
# The oauth secret for talking to the candlepin API
#
# @param post_sync_token
# The shared secret for pulp notifying katello about completed syncs
#
#
# @param modulestream_nodejs
# The nodejs modularity stream to use on EL8 and up
#
# @param manage_bundler
# If set to true, will execute the bundler commands needed to run the foreman
# server.
#
# @param initial_organization
# Initial organization to be created
#
# @param initial_location
# Initial location to be created
#
# @param admin_password
# Admin user password for Web application
#
# @param github_username
# Github username to add remotes for
#
# @param use_ssh_fork
# If true, will use SSH to configure Github fork, otherwise HTTPS.
#
# @param fork_remote_name
# Name of the remote that represents your fork
#
# @param upstream_remote_name
# Name of the remote that represents the upstream repository
#
# @param extra_plugins
# Array of Github namespace/repo plugins to setup and configure from git
#
# @param rails_command
# Customize the command used to start rails
#
# @param npm_timeout
# Timeout for npm install step
#
# @param foreman_scm_revision
# Branch or revision to use for Foreman's git checkout
#
# @param katello_scm_revision
# Branch or revision to use for katello's git checkout
#
# @param rex_scm_revision
# Branch or revision to use for foreman_remote_execution's git checkout
#
# @param foreman_manage_repo
# Manage the Foreman git repository
#
# @param katello_manage_repo
# Manage the Katello git repository
#
# @param rex_manage_repo
# Manage the Foreman Remote Execution git repository
#
# @param rails_cache_store
# Manage the type of cache used for Rails, default is Redis.
class katello_devel (
String $user = undef,
Stdlib::Absolutepath $deployment_dir = '/home/vagrant',
String $oauth_key = $katello_devel::params::oauth_key,
String $oauth_secret = $katello_devel::params::oauth_secret,
String $post_sync_token = 'test',
String $modulestream_nodejs = '18',
Boolean $manage_bundler = true,
String $initial_organization = 'Default Organization',
String $initial_location = 'Default Location',
String $admin_password = 'changeme',
Optional[String] $github_username = undef,
Boolean $use_ssh_fork = false,
Optional[String] $fork_remote_name = undef,
String $upstream_remote_name = 'upstream',
Array[Variant[String,Hash]] $extra_plugins = $katello_devel::params::extra_plugins,
String $rails_command = 'puma -w 2 -p $PORT --preload',
Integer[0] $npm_timeout = 2700,
String $foreman_scm_revision = 'develop',
String $katello_scm_revision = 'master',
String $rex_scm_revision = 'master',
Boolean $foreman_manage_repo = true,
Boolean $katello_manage_repo = true,
Boolean $rex_manage_repo = true,
Hash[String, Any] $rails_cache_store = { 'type' => 'redis' },
) inherits katello_devel::params {
$group = $user
$changeme = '$6$lb06/IMy$nZhR3LkR2tUunTQm68INFWMyb/8VA2vfYq0/fRzLoKSfuri.vvtjeLJf9V.wuHzw92.aw8NgUlJchMy/qK25x.'
user { $user:
ensure => present,
managehome => true,
password => $changeme,
} ~>
group { $group:
ensure => present,
}
class { 'katello::params':
candlepin_oauth_key => $oauth_key,
candlepin_oauth_secret => $oauth_secret,
candlepin_client_keypair_group => $group,
}
$fork_remote_name_real = pick_default($fork_remote_name, $github_username)
$foreman_dir = "${deployment_dir}/foreman"
$foreman_cert_dir = "${deployment_dir}/foreman-certs"
include certs
$candlepin_url = $katello::params::candlepin_url
$candlepin_ca_cert = $certs::katello_default_ca_cert
$ssl_ca_file = "${foreman_cert_dir}/proxy_ca.pem"
$ssl_certificate = "${foreman_cert_dir}/client_cert.pem"
$ssl_priv_key = "${foreman_cert_dir}/client_key.pem"
file { $foreman_cert_dir:
ensure => directory,
owner => $user,
group => $group,
mode => '0775',
}
class { 'certs::foreman':
client_cert => $ssl_certificate,
client_key => $ssl_priv_key,
ssl_ca_cert => $ssl_ca_file,
owner => $user,
group => $group,
before => Class['katello_devel::config'],
}
Class['certs'] ~>
class { 'certs::apache': } ~>
class { 'katello_devel::apache': } ~>
class { 'katello_devel::install': } ~>
class { 'katello_devel::config': } ~>
class { 'katello_devel::database': }
if $manage_bundler {
class { 'katello_devel::setup':
require => Class['katello::candlepin'],
subscribe => Class['katello_devel::database'],
}
}
$artemis_client_dn = katello::build_dn([['CN', $certs::foreman::hostname], ['OU', $certs::foreman::org_unit], ['O', $certs::foreman::org], ['ST', $certs::foreman::state], ['C', $certs::foreman::country]])
class { 'katello::candlepin':
artemis_client_dn => $artemis_client_dn,
}
file { '/usr/local/bin/ktest':
ensure => file,
content => template('katello_devel/ktest.sh.erb'),
owner => $user,
group => $group,
mode => '0755',
}
}