mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-14 21:43:18 +00:00
Update directory structure & allow to configure paths (tmp, log, cache)
This commit is contained in:
13
resources/vagrant/vms/phraseanet-php54-nginx/puphpet/puppet/modules/sqlite/Modulefile
vendored
Normal file
13
resources/vagrant/vms/phraseanet-php54-nginx/puphpet/puppet/modules/sqlite/Modulefile
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
name 'puppetlabs-sqlite'
|
||||
version '0.0.1'
|
||||
source 'https://github.com/puppetlabs/puppetlabs-sqlite/'
|
||||
author 'puppetlabs'
|
||||
license 'Apache'
|
||||
summary 'Manage a sqlite installation and databases'
|
||||
description 'This module provides a sqlite class to manage
|
||||
the installation of sqlite on a node. It also provides
|
||||
a sqlite::db defined type to manage databases on a system'
|
||||
project_page 'http://projects.puppetlabs.com/projects/modules/issues'
|
||||
|
||||
## Add dependencies, if any:
|
||||
# dependency 'username/name', '>= 1.2.0'
|
32
resources/vagrant/vms/phraseanet-php54-nginx/puphpet/puppet/modules/sqlite/README.md
vendored
Normal file
32
resources/vagrant/vms/phraseanet-php54-nginx/puphpet/puppet/modules/sqlite/README.md
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
sqlite
|
||||
======
|
||||
|
||||
Author: Carl Caum <carl@puppetlabs.com>
|
||||
Copyright (c) 2011, Puppet Labs Inc.
|
||||
|
||||
ABOUT
|
||||
=====
|
||||
|
||||
This module manages [sqlite](http://www.sqlite.org). Through declarion of the `sqlite` class, sqlite will be installed on the system.
|
||||
|
||||
The `sqlite::db` defined type allows for the management of a sqlite database on the node
|
||||
|
||||
CONFIGURATION
|
||||
=============
|
||||
|
||||
The main class (sqlite) only needs to be declared. No class parameters or top scope variables are needed.
|
||||
|
||||
The `sqlite::db` defined type can be used to manage a sqlite database on the system.
|
||||
The following parameters are available for the resources declaration:
|
||||
|
||||
location What directory the database should go in. The presence of the directory must be managed separately of the defined type.
|
||||
owner The owner of the sqlite database file on disk
|
||||
group The group owning the sqlite database file on disk
|
||||
mode The mode of the sqlite database file on disk
|
||||
ensure Whether the database should be `present` or `absent`. Default to `present`
|
||||
sqlite_cmd The sqlite command for the node's platform. Defaults to `sqlite3`
|
||||
|
||||
TODO
|
||||
====
|
||||
|
||||
* Allow for sql commands to be based to sqlite::db for use during creation
|
44
resources/vagrant/vms/phraseanet-php54-nginx/puphpet/puppet/modules/sqlite/manifests/db.pp
vendored
Normal file
44
resources/vagrant/vms/phraseanet-php54-nginx/puphpet/puppet/modules/sqlite/manifests/db.pp
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
# Define: sqlite::db
|
||||
#
|
||||
# This define allows for managing the existance of a sqlite database
|
||||
#
|
||||
# Parameters:
|
||||
# $location:
|
||||
# The location on disk to store the sqlite database
|
||||
# $owner:
|
||||
# The owner of the sqlite database file on disk
|
||||
# $group:
|
||||
# The group owning the sqlite database file on disk
|
||||
# $mode:
|
||||
# The mode of the sqlite datbase file on disk
|
||||
# $ensure:
|
||||
# Whether the database should be `present` or `absent`. Defaults to `present`
|
||||
# $sqlite_cmd:
|
||||
# The sqlite command for the node's platform. Defaults to `sqlite3`
|
||||
define sqlite::db(
|
||||
$location = '',
|
||||
$owner = 'root',
|
||||
$group = 0,
|
||||
$mode = '755',
|
||||
$ensure = present,
|
||||
$sqlite_cmd = 'sqlite3'
|
||||
) {
|
||||
|
||||
$safe_location = $location ? {
|
||||
'' => "/var/lib/sqlite/${name}.db",
|
||||
default => $location,
|
||||
}
|
||||
|
||||
file { $safe_location:
|
||||
ensure => $ensure,
|
||||
owner => $owner,
|
||||
group => $group,
|
||||
notify => Exec["create_${name}_db"],
|
||||
}
|
||||
|
||||
exec { "create_${name}_db":
|
||||
command => "${sqlite_cmd} $safe_location",
|
||||
path => '/usr/bin:/usr/local/bin',
|
||||
refreshonly => true,
|
||||
}
|
||||
}
|
16
resources/vagrant/vms/phraseanet-php54-nginx/puphpet/puppet/modules/sqlite/manifests/init.pp
vendored
Normal file
16
resources/vagrant/vms/phraseanet-php54-nginx/puphpet/puppet/modules/sqlite/manifests/init.pp
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
# Class: sqlite
|
||||
#
|
||||
# This class manages the installation of the sqlite
|
||||
# database.
|
||||
#
|
||||
# Sample Usage:
|
||||
# class { 'sqlite': }
|
||||
class sqlite {
|
||||
package { 'sqlite':
|
||||
ensure => installed,
|
||||
}
|
||||
|
||||
file { '/var/lib/sqlite/':
|
||||
ensure => directory,
|
||||
}
|
||||
}
|
12
resources/vagrant/vms/phraseanet-php54-nginx/puphpet/puppet/modules/sqlite/metadata.json
vendored
Normal file
12
resources/vagrant/vms/phraseanet-php54-nginx/puphpet/puppet/modules/sqlite/metadata.json
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
/*
|
||||
+-----------------------------------------------------------------------+
|
||||
| |
|
||||
| ==> DO NOT EDIT THIS FILE! <== |
|
||||
| |
|
||||
| You should edit the `Modulefile` and run `puppet-module build` |
|
||||
| to generate the `metadata.json` file for your releases. |
|
||||
| |
|
||||
+-----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
{}
|
6
resources/vagrant/vms/phraseanet-php54-nginx/puphpet/puppet/modules/sqlite/spec/spec.opts
vendored
Normal file
6
resources/vagrant/vms/phraseanet-php54-nginx/puphpet/puppet/modules/sqlite/spec/spec.opts
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
--format
|
||||
s
|
||||
--colour
|
||||
--loadby
|
||||
mtime
|
||||
--backtrace
|
18
resources/vagrant/vms/phraseanet-php54-nginx/puphpet/puppet/modules/sqlite/spec/spec_helper.rb
vendored
Normal file
18
resources/vagrant/vms/phraseanet-php54-nginx/puphpet/puppet/modules/sqlite/spec/spec_helper.rb
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
require 'pathname'
|
||||
dir = Pathname.new(__FILE__).parent
|
||||
$LOAD_PATH.unshift(dir, dir + 'lib', dir + '../lib')
|
||||
|
||||
require 'mocha'
|
||||
require 'puppet'
|
||||
gem 'rspec', '=1.2.9'
|
||||
require 'spec/autorun'
|
||||
|
||||
Spec::Runner.configure do |config|
|
||||
config.mock_with :mocha
|
||||
end
|
||||
|
||||
# We need this because the RAL uses 'should' as a method. This
|
||||
# allows us the same behaviour but with a different method name.
|
||||
class Object
|
||||
alias :must :should
|
||||
end
|
1
resources/vagrant/vms/phraseanet-php54-nginx/puphpet/puppet/modules/sqlite/tests/init.pp
vendored
Normal file
1
resources/vagrant/vms/phraseanet-php54-nginx/puphpet/puppet/modules/sqlite/tests/init.pp
vendored
Normal file
@@ -0,0 +1 @@
|
||||
include sqlite
|
Reference in New Issue
Block a user