Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
puppet-icinga2_testing
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
15
Issues
15
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
testing
puppet-icinga2_testing
Commits
2d9d272c
Commit
2d9d272c
authored
Dec 07, 2016
by
Markus Frosch
📣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ido_pgsql: Add for parallel database setup
parent
718f807d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
0 deletions
+58
-0
manifests/helpers/icinga2/ido_pgsql.pp
manifests/helpers/icinga2/ido_pgsql.pp
+58
-0
No files found.
manifests/helpers/icinga2/ido_pgsql.pp
0 → 100644
View file @
2d9d272c
class
icinga2_testing::helpers::icinga2::ido_pgsql
(
$ido_dbname
=
$::icinga2::feature::ido_pgsql::database
,
$ido_username
=
$::icinga2::feature::ido_pgsql::user
,
$ido_password
=
$::icinga2::feature::ido_pgsql::password
,
)
inherits
::
icinga2::feature::ido_pgsql
{
# Install schema
if
$::osfamily
==
'Debian'
{
$_schema_create
=
'/usr/share/dbconfig-common/data/icinga2-ido-pgsql/install/pgsql'
}
elsif
$::osfamily
==
'Redhat'
{
$_schema_create
=
'/usr/share/icinga2-ido-pgsql/schema/pgsql.sql'
}
else
{
fail
(
"Schema creating not supported on
${::operatingsystem}
(
${::osfamily}
)"
)
}
$_psql
=
"psql -U '
${ido_username}
' -h '
${host}
' -d '
${ido_dbname}
'"
Package
[
'icinga2-ido-pgsql'
]
->
exec
{
'import icinga2 pgsql schema'
:
user
=>
'root'
,
path
=>
$::path
,
command
=>
"
${_psql}
< '
${_schema_create}
'"
,
unless
=>
"
${_psql}
-c 'SELECT version FROM icinga_dbversion'"
,
environment
=>
[
"PGPASSWORD=
${ido_password}
"
,
],
}
~>
Class
[
'::icinga2::service'
]
unless
defined
(
File
[
'icinga2-schema-upgrade'
])
{
file
{
'icinga2-schema-upgrade'
:
ensure
=>
file
,
owner
=>
'root'
,
group
=>
'root'
,
mode
=>
'0755'
,
path
=>
'/usr/local/bin/icinga2-schema-upgrade'
,
content
=>
file
(
'icinga2_testing/icinga2-schema-upgrade'
),
}
}
exec
{
'icinga2-schema-upgrade-pgsql'
:
path
=>
$::path
,
environment
=>
[
"IDO_DATABASE=
${ido_dbname}
"
,
"IDO_USERNAME=
${ido_username}
"
,
"IDO_PASSWORD=
${ido_password}
"
,
],
logoutput
=>
true
,
command
=>
'/usr/local/bin/icinga2-schema-upgrade'
,
onlyif
=>
'/usr/local/bin/icinga2-schema-upgrade --check'
,
notify
=>
Class
[
'::icinga2::service'
],
require
=>
[
Exec
[
'import icinga2 pgsql schema'
],
File
[
'icinga2-schema-upgrade'
],
],
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment