
system to create a working .deb, based on the makefile. Adds a new script to start up the web daemon. Adds a new script to test if the database is provisioned Adds a new script used by Puppet to provision the database Adds puppet manifests (mirrored in main puppet) Moves api/ to artifice/api Alters some of the relative imports Moves artifice.py to why_is_this_called_artifice.py, as it was causing import issues. Change-Id: Id8a909f7ffcc64a5c4e3281c6b5ba83cef73b596
28 lines
781 B
Puppet
28 lines
781 B
Puppet
class artifice::database (
|
|
$provider,
|
|
$host,
|
|
$port,
|
|
$user,
|
|
$password,
|
|
$database_name
|
|
) {
|
|
# I think the install path should
|
|
#
|
|
if $provider != "postgres" and $provider != "mysql" {
|
|
fail("Provider must be postgres or mysql")
|
|
}
|
|
$install_path = "/opt/stack/artifice"
|
|
|
|
# Create is handled by the Galera setup earlier.
|
|
# exec {"create.database":
|
|
# command => $create_command,
|
|
# cwd => $pwd,
|
|
# onlyif => $unless_command
|
|
# }
|
|
exec {"sqlalchemy.create":
|
|
command => "/usr/bin/python $install_path/initdb.py",
|
|
environment => "DATABASE_URI=$provider://$user:$password@$host/$database_name",
|
|
onlyif => "/usr/bin/python $install_path/is_provisioned.py",
|
|
}
|
|
}
|