diff --git a/.gitignore b/.gitignore
index d0f4a919cde..9b639ce64a6 100755
--- a/.gitignore
+++ b/.gitignore
@@ -17,7 +17,4 @@ doxygen_warnings.log
*.iml
Thumbs.db
# Vagrant generated files
-.vagrant
-/index.html
-/phpmyadmin
-/xhprof
+.vagrant
\ No newline at end of file
diff --git a/.travis.yml b/.travis.yml
index 9c7f18481f5..104bb1d00c2 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -87,18 +87,22 @@ before_script:
script:
- cd htdocs/install
+ - date
- php upgrade.php 3.4.0 3.5.0 > upgrade.log
- php upgrade2.php 3.4.0 3.5.0 > upgrade2.log
- php upgrade.php 3.5.0 3.6.0 >> upgrade.log
- php upgrade2.php 3.5.0 3.6.0 >> upgrade2.log
+ - php upgrade.php 3.6.0 3.7.0 >> upgrade.log
+ - php upgrade2.php 3.6.0 3.7.0 >> upgrade2.log
# - cat upgrade.log
# - cat upgrade2.log
- cd ../..
- date
+ - phpunit -d memory_limit=-1 --configuration test/phpunit/phpunittest.xml test/phpunit/AllTests.php
+ - date
# - phpcs -p --warning-severity=0 -s --report-summary --standard=dev/codesniffer/ruleset.xml --tab-width=4 --ignore=/build/html/,/dev/vagrant/,/documents/,/includes/,/test/report/ htdocs/core/class/dolgraph.class.php 2>&1
- phpcs -p --warning-severity=0 -s --report-checkstyle --report-summary --standard=dev/codesniffer/ruleset.xml --tab-width=4 --ignore=/build/html/,/dev/vagrant/,/documents/,/includes/,/test/report/ . 2>&1
- date
- - phpunit -d memory_limit=-1 --configuration test/phpunit/phpunittest.xml test/phpunit/AllTests.php
after_script:
# - echo Output dolibarr log file; cat $(pwd)/htdocs/documents/dolibarr.log
diff --git a/ChangeLog b/ChangeLog
index d6ba26267a6..c19e957e820 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,98 @@
English Dolibarr ChangeLog
--------------------------------------------------------------
+
+***** ChangeLog for 3.7 compared to 3.6.* *****
+For users:
+- New: On contact list can set filter on both active and not active (no more exclusive select).
+- New: Each user can include its own external ics calendar into dolibarr agenda view.
+- New: Intervention documents are now available in ECM module.
+- New: Can attach supplier order to a customer order.
+- New: Supervisor is now visible into user list.
+- New: Add user of creation and validation on invoice export.
+- New: Add info page about browser.
+- New: Enable feature developed for 3.6 we forgot to enabled: Adding prefix
+ on uploaded file names.
+- New: No more dependency between contract and service module.
+- New: [ task #867 ] Remove ESAEB external module code from core.
+- New: Can create proposal from an intervention.
+- New: Can filter events on a group of users.
+- New: Can filter events of a thirdparty.
+- New: Split Agenda view (month, week, day) into different tabs.
+- New: Form to add a photo is immediatly available on photo page if
+ permissions are ok (save one click per photo to add).
+- New: Add option PRODUCT_MAX_VISIBLE_PHOTO to limit number of photos
+ shown on main product card.
+- New: Add event FICHINTER_CLASSIFY_BILLED into list of possible events to
+ create an automatic event into agenda.
+- New: Add new type of event (when type of events are used, not by default)
+- New: Add country into table of thirdparties type. This will allow to provide
+ a list of thirdparty types specific to a country (like argentina that
+ need type A or B).
+- New: Can force a specific bank account onto an invoice/order.
+- New: Home page of project area shows list of draft project (like other main page).
+- New: Can search on project ref or string from project main page (like other main page).
+- New: First change to match accessibility rules: http://www.w3.org/TR/WCAG10-HTML-TECHS/
+ Differentiate text and img.
+ Use label into quick search form.
+ Use accesskey on form search.
+- New: Intervention documents are now available in ECM module
+- New: Add attachments on user card + in ECM module
+- New: Can add __PROJECT_REF__ and __TIHRPARTY_NAME__ into email topic or content template.
+- New: [ task #1204 ] add Numering contrat module free (like leopard in product module)
+- New: [ task #712 ] Add warning when creating invoice from proposal or order, when there is already one invoice
+- New: Enable supplier price log table
+- New: [ task #1204 ] add a External reference to contract
+- New: [ task #1218 ] Can drag and drop an event from calendar to change its day.
+- Fix: [ bug #1487 ] PAYMENT_DELETE trigger does not intercept trigger action
+- Fix: [ bug #1470, #1472, #1473] User trigger problem
+- Fix: [ bug #1489, #1491 ] Intervention trigger problem
+- Fix: [ bug #1492, #1493 ] Member trigger problem
+- Fix: [ bug #1474, #1475 ] Contract trigger problem
+- Fix: [ bug #1496 ] ACTION_DELETE trigger does not show trigger error
+- Fix: [ bug #1494 ] CATEGORY_CREATE and CATEGORY_MODIFY triggers do not intercept trigger action
+- Fix: [ bug #1502 ] DON_CREATE trigger does not intercept trigger action
+- Fix: [ bug #1505, #1504] Project trigger problem
+- Fix: [ bug #1463, #1464 ] Proposal triggers problem
+- Fix: [ bug #1498, #1499 ] Shipment/Delivery triggers problem
+- Fix: [ bug #1465, #1466 ] Product triggers problem
+- Fix: [ bug #1508 ] STOCK_MOVEMENT does not show trigger error message
+- Fix: [ bug #1501 ] DEPLACEMENT_CREATE trigger do not intercept trigger action
+- Fix: [ bug #1506, #1507 ] ECM trigger error problem
+- Fix: [ bug #1469 ] Triggers CONTACT_MODIFY and CONTACT_DELETE duplicates error message
+- Fix: [ bug #1537 ] Difference between societe.nom and adherent.societe.
+
+For translators:
+- Update language files.
+- New: When a translation is not available we always jump to en_US and only en_US.
+
+For developers:
+- New: Select list of users can return user into hierarchy.
+- New: getBrowserInfo can return type of layout of browser (classic/phone/tablet)
+- New: Add hook "searchAgendaFrom".
+- New: Add trigger DON_UPDATE, DON_DELETE
+- New: Add country iso code on 3 chars into table of countries.
+- Qual: Removed hard coded rowid into data init of table llx_c_action_trigger.
+- LINEBILL_DELETE, LINK_DELETE, ORDER_SUPPLIER_DELETE, RESOURCE_DELETE trigger called before SQL delete
+- New: [ Task #1481 ] Add trigger BILL_SUPPLIER_UPDATE.
+- New: [ Task #1495 ] Add trigger LINECONTRACT_CREATE.
+- New: Added hook "formConfirm" and "doActions" for supplier invoice card
+- New: [ task #1511, #1426 ] Added hook "doActions" for supplier card and supplier order card
+- New: renamed table llx_c_pays to llx_c_country & libelle field to label
+- Qual: Renamed table llx_c_civilite into llx_c_civility
+ field civilite into label in the same table
+ and field civilite into civility in other table
+
+WARNING: Following change may create regression for some external modules, but was necessary to make
+Dolibarr better:
+
+- Changed the way parameters are provided to scripts sync_xxx_ldap2dolibarr.php
+- Some field into database wwere renamed from "libelle" to "label".
+- Table llx_c_pays were renamed into llx_c_country.
+- Triggers *_BUILDDOC are removed. Building a doc is not a business event. For action after
+ creation of a pdf or odt, hook "afterPDFCreation" or "afterODTCreation" must be used instead.
+
+
***** ChangeLog for 3.6 compared to 3.5.* *****
For users:
- New: Update ckeditor to version 4.
@@ -66,6 +158,9 @@ For users:
- Fix: Add actions events not implemented.
- Fix: Price min of composition is not supplier price min by quantity.
- Fix: [ bug #1356 ] Bank accountancy number is limited to 8 numbers.
+- Fix: [ bug #1439 ] impossible to remove a a translation (multilanguage-feature)
+- New: If multilangue is enabled, mail (from propal, invoice, etc...) message is pre-defaulted in Customer language
+- Fix: [ bug #1459 ] _ADD_CONTACT and _DEL_CONTACT triggers do not intercept insertion when reported an error
- Fix: [ bug #1478 ] BILL_PAYED trigger action does not intercept failure under some circumstances
- Fix: [ bug #1479 ] Several customer invoice triggers do not intercept trigger action
- Fix: [ bug #1477 ] Several customer invoice triggers do not show trigger error messages
@@ -93,6 +188,8 @@ For developers:
- New: A module can disable a standard ECM view.
- New: Add multilang support into product webservice.
- New: Add hooks on project card page.
+- New: Add call_trigger method on CommonObject class. So new trigger call within object is just :
+$result = $this->call_trigger($trigger_name, $user)
WARNING: Following change may create regression for some external modules, but was necessary to make
Dolibarr better:
@@ -100,11 +197,11 @@ Dolibarr better:
- The deprecated way (with 4 parameters) to declare a new tab into a module descriptor file has been
removed. You must now use the 6 parameters way. See file modMyModule.class.php for example.
- Remove the javascript function ac_delay() that is not used anymore by core code.
-- Properties "dictionnaries" into module descriptor files has been renamed into "dictionaries".
+- Properties "dictionnaries" into module descriptor files have been renamed into "dictionaries".
- Method form->select_currency() has been removed. Use instead print form->selectCurrency().
- Method form->select_methodes_commande() has been renamed into english name selectInputMethod().
- The following hooks are now 'addreplace' hooks: "formCreateThirdpartyOptions"
- So check that return value is 0 to keep default standard behaviour after hook or 1 to disable
+ So check that return value is 0 to keep default standard behaviour after hook, or 1 to disable
default standard behaviour.
- Properties "civilite_id" were renamed into "civility_id".
- Remove add_photo_web() that is ot used anymore by core code.
diff --git a/build/debian/README.howto b/build/debian/README.howto
index 6b6e71c4874..d0bdd4574f4 100644
--- a/build/debian/README.howto
+++ b/build/debian/README.howto
@@ -153,6 +153,7 @@ from origin/upstream and origin/pristine.
* Into root dir, launch:
> debian/get-orig-source.sh
+If script fails with error Bad certificate, you can set "export PERL_LWP_SSL_VERIFY_HOSTNAME=0 " to solve this.
* Staying into git root directory, run
> git-import-orig -vv ../tcpdf_x.y.z+dfsg.orig.tar.xz
@@ -162,7 +163,7 @@ Note: If there was errors solved manually, you may need to make a git commit
* Add an entry into debian/changelog
> dch -v x.y.z-dsfg-1 "My comment" will add entry.
For example: dch -v x.y.z-dsfg-1 "New upstream release." for a new version
-Then modify changelog to replace "unstable" with "UNRELEASED".
+Then modify changelog to replace "version" or "unstable" with "UNRELEASED".
Warning: Date must have format reported by "date -R"
Warning: Name and email must match value into debian/control file (Entry added here is used by next step).
@@ -228,8 +229,13 @@ from origin/upstream and origin/pristine.
* If new upstream is available onto sourceforge, launch:
> debian/get-orig-source.sh
+If script fails with error Bad certificate, you can set "export PERL_LWP_SSL_VERIFY_HOSTNAME=0 " to solve this.
-* Edit tgz file to remove ckeditor and phpexcel and rename file into
+* Edit tgz file to remove
+- ckeditor
+- phpexcel
+- tcpdf
+And rename file into
dolibarr-x.y.z+dsfgw.tgz
(x.y.z = version, w start from 1 and is increased for each new import)
@@ -244,7 +250,7 @@ Note: If there was errors solved manually after get-orig-sources.sh, you may nee
* Add an entry into debian/changelog
> dch -v x.y.z-w "My comment" will add entry.
For example: dch -v x.y.z-w "New upstream release." for a new version (x.y.z = version, w start from 1 and increaed for each new import)
-Then modify changelog to replace "unstable" with "UNRELEASED".
+Then modify changelog to replace "version" or "unstable" with "UNRELEASED".
Then check/modify also the user/date signature:
- Date must have format reported by "date -R"
- Name and email must match value into debian/control file (Entry added here is used by next step).
diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl
index 77f19c1500a..b0ee55e399b 100755
--- a/build/makepack-dolibarr.pl
+++ b/build/makepack-dolibarr.pl
@@ -960,8 +960,8 @@ if ($nboftargetok) {
}
}
- # Build package for each target
- #------------------------------
+ # Publish package for each target
+ #--------------------------------
foreach my $target (keys %CHOOSEDPUBLISH)
{
if ($CHOOSEDPUBLISH{$target} < 0) { next; }
@@ -1039,9 +1039,7 @@ if ($nboftargetok) {
print "$command\n";
my $ret=`$command 2>&1`;
print "$ret\n";
-
}
-
}
}
}
diff --git a/build/rpm/conf.php b/build/rpm/conf.php
index 2e8bd46cf0f..406ba3145c1 100755
--- a/build/rpm/conf.php
+++ b/build/rpm/conf.php
@@ -5,4 +5,3 @@
//
// This file will be filled by installer
//
-?>
\ No newline at end of file
diff --git a/dev/codesniffer/ruleset.xml b/dev/codesniffer/ruleset.xml
index 38ea1310d22..6b498e7d167 100755
--- a/dev/codesniffer/ruleset.xml
+++ b/dev/codesniffer/ruleset.xml
@@ -11,10 +11,16 @@
+
+
+
0
+
+
+
@@ -24,9 +30,6 @@
0
-
-
-
@@ -153,6 +156,10 @@
+
+
+
+
@@ -270,4 +277,10 @@
+
+
+
+
+
+
diff --git a/dev/dolibarr_changes.txt b/dev/dolibarr_changes.txt
index 7f3490da165..f63969ea170 100644
--- a/dev/dolibarr_changes.txt
+++ b/dev/dolibarr_changes.txt
@@ -44,6 +44,8 @@ In htdocs/includes/tcpdf/tcpdf.php
- protected $default_monospaced_font = 'courier';
+ protected $default_monospaced_font = 'freemono';
+* Renamed getmypid into dol_getmypid().
+
JSGANTT:
--------
diff --git a/dev/initdata/generate-facture.php b/dev/initdata/generate-facture.php
index 0316671d62b..5c630454ba7 100755
--- a/dev/initdata/generate-facture.php
+++ b/dev/initdata/generate-facture.php
@@ -94,7 +94,7 @@ while ($i < GEN_NUMBER_FACTURE && $result >= 0)
print "Invoice ".$i." for socid ".$socid;
- $facture = new Facture($db, $socids[$socid]);
+ $facture = new Facture($db);
$facture->date = time();
$facture->cond_reglement_id = 3;
$facture->mode_reglement_id = 3;
diff --git a/dev/initdata/generate-propale.php b/dev/initdata/generate-propale.php
index a62df516481..2efd2af2f08 100755
--- a/dev/initdata/generate-propale.php
+++ b/dev/initdata/generate-propale.php
@@ -122,7 +122,7 @@ while ($i < GEN_NUMBER_PROPAL && $result >= 0)
$soc = new Societe($db);
- $propal = new Propal($db, $socids[$socid]);
+ $propal = new Propal($db);
$obj = $conf->global->PROPALE_ADDON;
$modPropale = new $obj;
@@ -130,6 +130,7 @@ while ($i < GEN_NUMBER_PROPAL && $result >= 0)
$propal->ref = $numpr;
$propal->contactid = $contids[$socids[$socid]][0];
+ $propal->socid = $socids[$socid];
$propal->datep = time();
$propal->cond_reglement_id = 3;
$propal->mode_reglement_id = 3;
diff --git a/dev/skeletons/modMyModule.class.php b/dev/skeletons/modMyModule.class.php
index bdeb61a7821..4c09e379d9b 100644
--- a/dev/skeletons/modMyModule.class.php
+++ b/dev/skeletons/modMyModule.class.php
@@ -173,7 +173,7 @@ class modMyModule extends DolibarrModules
// Add here list of permission defined by an id, a label, a boolean and two constant strings.
// Example:
- // $this->rights[$r][0] = 2000; // Permission id (must not be already used)
+ // $this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used)
// $this->rights[$r][1] = 'Permision label'; // Permission label
// $this->rights[$r][3] = 1; // Permission by default for new user (0/1)
// $this->rights[$r][4] = 'level1'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
diff --git a/dev/skeletons/skeleton_class.class.php b/dev/skeletons/skeleton_class.class.php
index c36dad4b4b5..781bbc1f77c 100644
--- a/dev/skeletons/skeleton_class.class.php
+++ b/dev/skeletons/skeleton_class.class.php
@@ -91,7 +91,7 @@ class Skeleton_Class extends CommonObject
$this->db->begin();
- dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG);
+ dol_syslog(get_class($this)."::create", LOG_DEBUG);
$resql=$this->db->query($sql);
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
@@ -105,10 +105,8 @@ class Skeleton_Class extends CommonObject
// want this action calls a trigger.
//// Call triggers
- //include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
- //$interface=new Interfaces($this->db);
- //$result=$interface->run_triggers('MYOBJECT_CREATE',$this,$user,$langs,$conf);
- //if ($result < 0) { $error++; $this->errors=$interface->errors; }
+ //$result=$this->call_trigger('MYOBJECT_CREATE',$user);
+ //if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
//// End call triggers
}
}
@@ -135,10 +133,11 @@ class Skeleton_Class extends CommonObject
/**
* Load object in memory from the database
*
- * @param int $id Id object
+ * @param int $id Id object
+ * @param string $ref Ref
* @return int <0 if KO, >0 if OK
*/
- function fetch($id)
+ function fetch($id,$ref='')
{
global $langs;
$sql = "SELECT";
@@ -147,9 +146,10 @@ class Skeleton_Class extends CommonObject
$sql.= " t.field2";
//...
$sql.= " FROM ".MAIN_DB_PREFIX."mytable as t";
- $sql.= " WHERE t.rowid = ".$id;
+ if ($ref) $sql.= " WHERE t.ref = '".$ref."'";
+ else $sql.= " WHERE t.rowid = ".$id;
- dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG);
+ dol_syslog(get_class($this)."::fetch");
$resql=$this->db->query($sql);
if ($resql)
{
@@ -169,7 +169,6 @@ class Skeleton_Class extends CommonObject
else
{
$this->error="Error ".$this->db->lasterror();
- dol_syslog(get_class($this)."::fetch ".$this->error, LOG_ERR);
return -1;
}
}
@@ -204,7 +203,7 @@ class Skeleton_Class extends CommonObject
$this->db->begin();
- dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG);
+ dol_syslog(get_class($this)."::update");
$resql = $this->db->query($sql);
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
@@ -216,12 +215,10 @@ class Skeleton_Class extends CommonObject
// want this action calls a trigger.
//// Call triggers
- //include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
- //$interface=new Interfaces($this->db);
- //$result=$interface->run_triggers('MYOBJECT_MODIFY',$this,$user,$langs,$conf);
- //if ($result < 0) { $error++; $this->errors=$interface->errors; }
+ //$result=$this->call_trigger('MYOBJECT_MODIFY',$user);
+ //if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
//// End call triggers
- }
+ }
}
// Commit or rollback
@@ -264,12 +261,10 @@ class Skeleton_Class extends CommonObject
// Uncomment this and change MYOBJECT to your own tag if you
// want this action calls a trigger.
- //// Call triggers
- //include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
- //$interface=new Interfaces($this->db);
- //$result=$interface->run_triggers('MYOBJECT_DELETE',$this,$user,$langs,$conf);
- //if ($result < 0) { $error++; $this->errors=$interface->errors; }
- //// End call triggers
+ //// Call triggers
+ //$result=$this->call_trigger('MYOBJECT_DELETE',$user);
+ //if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
+ //// End call triggers
}
}
@@ -278,7 +273,7 @@ class Skeleton_Class extends CommonObject
$sql = "DELETE FROM ".MAIN_DB_PREFIX."mytable";
$sql.= " WHERE rowid=".$this->id;
- dol_syslog(get_class($this)."::delete sql=".$sql);
+ dol_syslog(get_class($this)."::delete");
$resql = $this->db->query($sql);
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
}
diff --git a/dev/skeletons/skeleton_page.php b/dev/skeletons/skeleton_page.php
index bf63a769af7..67d6298863a 100644
--- a/dev/skeletons/skeleton_page.php
+++ b/dev/skeletons/skeleton_page.php
@@ -43,6 +43,7 @@ if (! $res && file_exists("../../../dolibarr/htdocs/main.inc.php")) $res=@includ
if (! $res && file_exists("../../../../dolibarr/htdocs/main.inc.php")) $res=@include '../../../../dolibarr/htdocs/main.inc.php'; // Used on dev env only
if (! $res) die("Include of main fails");
// Change this following line to use the correct relative path from htdocs
+include_once(DOL_DOCUMENT_ROOT.'/core/class/formcompany.class.php');
dol_include_once('/module/class/skeleton_class.class.php');
// Load traductions files requiredby by page
@@ -52,6 +53,7 @@ $langs->load("other");
// Get parameters
$id = GETPOST('id','int');
$action = GETPOST('action','alpha');
+$backtopage = GETPOST('backtopage');
$myparam = GETPOST('myparam','alpha');
// Protection if external user
@@ -60,6 +62,16 @@ if ($user->societe_id > 0)
//accessforbidden();
}
+if (empty($action) && empty($id) && empty($ref)) $action='create';
+
+// Load object if id or ref is provided as parameter
+$object=new Skeleton_Class($db);
+if (($id > 0 || ! empty($ref)) && $action != 'add')
+{
+ $result=$object->fetch($id,$ref);
+ if ($result < 0) dol_print_error($db);
+}
+
/*******************************************************************
@@ -68,19 +80,104 @@ if ($user->societe_id > 0)
* Put here all code to do according to value of "action" parameter
********************************************************************/
+// Action to add record
if ($action == 'add')
{
- $object=new Skeleton_Class($db);
- $object->prop1=$_POST["field1"];
- $object->prop2=$_POST["field2"];
- $result=$object->create($user);
+ if (GETPOST('cancel'))
+ {
+ $urltogo=$backtopage?$backtopage:dol_buildpath('/buildingmanagement/list.php',1);
+ header("Location: ".$urltogo);
+ exit;
+ }
+
+ $error=0;
+
+ /* object_prop_getpost_prop */
+ $object->prop1=GETPOST("field1");
+ $object->prop2=GETPOST("field2");
+
+ if (empty($object->ref))
+ {
+ $error++;
+ setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Ref")),'errors');
+ }
+
+ if (! $error)
+ {
+ $result=$object->create($user);
+ if ($result > 0)
+ {
+ // Creation OK
+ $urltogo=$backtopage?$backtopage:dol_buildpath('/mymodule/list.php',1);
+ header("Location: ".$urltogo);
+ exit;
+ }
+ {
+ // Creation KO
+ if (! empty($object->errors)) setEventMessage($object->errors, 'errors');
+ else setEventMessage($object->error, 'errors');
+ $action='create';
+ }
+ }
+ else
+ {
+ $action='create';
+ }
+}
+
+// Cancel
+if ($action == 'update' && GETPOST('cancel')) $action='view';
+
+// Action to update record
+if ($action == 'update' && ! GETPOST('cancel'))
+{
+ $error=0;
+
+ $object->prop1=GETPOST("field1");
+ $object->prop2=GETPOST("field2");
+
+ if (empty($object->ref))
+ {
+ $error++;
+ setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Ref")),'errors');
+ }
+
+ if (! $error)
+ {
+ $result=$object->update($user);
+ if ($result > 0)
+ {
+ $action='view';
+ }
+ else
+ {
+ // Creation KO
+ if (! empty($object->errors)) setEventMessage($object->errors, 'errors');
+ else setEventMessage($object->error, 'errors');
+ $action='edit';
+ }
+ }
+ else
+ {
+ $action='edit';
+ }
+}
+
+// Action to delete
+if ($action == 'confirm_delete')
+{
+ $result=$object->delete($user);
if ($result > 0)
{
- // Creation OK
+ // Delete OK
+ setEventMessage($langs->trans("RecordDeleted"));
+ header("Location: ".dol_buildpath('/buildingmanagement/list.php',1));
+ exit;
}
+ else
{
- // Creation KO
- $mesg=$object->error;
+ if (! empty($object->errors)) setEventMessage($object->errors,'errors');
+ else setEventMessage($object->error,'errors');
}
}
@@ -101,7 +198,7 @@ $form=new Form($db);
// Put here content of your page
-// Example 1 : Adding jquery code
+// Example : Adding jquery code
print '';
-// Example 2 : Adding links to objects
-// The class must extends CommonObject class to have this method available
-//$somethingshown=$object->showLinkedObjectBlock();
-
-
-// Example 3 : List of data
-if ($action == 'list')
+// Part to show a list
+if ($action == 'list' || empty($id))
{
$sql = "SELECT";
$sql.= " t.rowid,";
@@ -139,27 +231,24 @@ if ($action == 'list')
print_liste_field_titre($langs->trans('field2'),$_SERVER['PHP_SELF'],'t.field2','',$param,'',$sortfield,$sortorder);
print '';
- dol_syslog($script_file." sql=".$sql, LOG_DEBUG);
+ dol_syslog($script_file, LOG_DEBUG);
$resql=$db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
$i = 0;
- if ($num)
+ while ($i < $num)
{
- while ($i < $num)
+ $obj = $db->fetch_object($resql);
+ if ($obj)
{
- $obj = $db->fetch_object($resql);
- if ($obj)
- {
- // You can use here results
- print '
';
- print $obj->field1;
- print $obj->field2;
- print ' ';
- }
- $i++;
+ // You can use here results
+ print '';
+ print $obj->field1;
+ print $obj->field2;
+ print ' ';
}
+ $i++;
}
}
else
@@ -173,6 +262,100 @@ if ($action == 'list')
+// Part to create
+if ($action == 'create')
+{
+ print_fiche_titre($langs->trans("NewResidence"));
+
+ dol_fiche_head();
+
+ print '';
+
+ dol_fiche_end();
+}
+
+
+
+// Part to edit record
+if (($id || $ref) && $action == 'edit')
+{
+ dol_fiche_head();
+
+ print '';
+
+ dol_fiche_end();
+}
+
+
+
+// Part to show record
+if ($id && (empty($action) || $action == 'view'))
+{
+ dol_fiche_head();
+
+
+
+ dol_fiche_end();
+
+
+ // Buttons
+ print ''."\n";
+ $parameters=array();
+ $reshook=$hookmanager->executeHooks('addMoreActionsButtons',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
+ if (empty($reshook))
+ {
+ if ($user->rights->mymodule->write)
+ {
+ print '
'."\n";
+ }
+
+ if ($user->rights->mymodule->delete)
+ {
+ if ($conf->use_javascript_ajax && empty($conf->dol_use_jmobile)) // We can't use preloaded confirm form with jmobile
+ {
+ print '
'.$langs->trans('Delete').'
'."\n";
+ }
+ else
+ {
+ print '
'."\n";
+ }
+ }
+ }
+ print '
'."\n";
+
+
+ // Example 2 : Adding links to objects
+ // The class must extends CommonObject class to have this method available
+ //$somethingshown=$object->showLinkedObjectBlock();
+
+}
+
+
// End of page
llxFooter();
$db->close();
diff --git a/dev/skeletons/skeleton_script.php b/dev/skeletons/skeleton_script.php
index b10b57a730a..35904c9bfd3 100644
--- a/dev/skeletons/skeleton_script.php
+++ b/dev/skeletons/skeleton_script.php
@@ -57,7 +57,7 @@ if (! $result > 0) { dol_print_error('',$user->error); exit; }
$user->getrights();
-print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n";
+print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n";
if (! isset($argv[1])) { // Check parameters
print "Usage: ".$script_file." param1 param2 ...\n";
exit(-1);
@@ -119,7 +119,7 @@ $sql.= " FROM ".MAIN_DB_PREFIX."skeleton";
$sql.= " WHERE field3 = 'xxx'";
$sql.= " ORDER BY field1 ASC";
-dol_syslog($script_file." sql=".$sql, LOG_DEBUG);
+dol_syslog($script_file, LOG_DEBUG);
$resql=$db->query($sql);
if ($resql)
{
diff --git a/dev/vagrant/README.md b/dev/vagrant/README.md
index 8056643520e..dc0bc4234e2 100644
--- a/dev/vagrant/README.md
+++ b/dev/vagrant/README.md
@@ -23,7 +23,7 @@ Usage
`cd` into the vagrant box directory and simply type `vagrant up`.
-That's all you need to do. It will build a brand new VirtalBox machine for you with everything you need to develop on Dolibarr.
+That's all you need to do. It will build a brand new VirtualBox machine for you with everything you need to develop on Dolibarr.
### Name resolution
For easy access to the VM you need to setup name resolution to the machines IP.
@@ -45,9 +45,16 @@ Somewhat bleeding edge vagrant box for develop branch related work.
- IP: 192.168.42.101
- Vhost: dev.dolibarr.org
-- OS: Debian Wheezy 7.5
+- OS: Debian Wheezy 7.5 x64
- Webserver: Apache 2.2.22
-- PHP: mod_php 5.5.13-1~dotdeb.1
+- PHP: mod_php 5.5.14-1~dotdeb.1
+ Installed modules:
+ - cli
+ - curl
+ - gd
+ - imagick
+ - intl
+ - mcrypt
- Database: MySQL 5.5
- Root user: root
- Root password: root
@@ -55,7 +62,13 @@ Somewhat bleeding edge vagrant box for develop branch related work.
- Database user: user
- Database password: user
- Initial data: dev/initdata/mysqldump_dolibarr-3.5.0.sql
+- Database: PostgreSQL 9.3
+- Adminer: lightweight database management. Access through http://192.168.42.101/adminer
- Debugger: XDebug
-- Profiler: Xhprof
+- Profiler: Xhprof. Access through http://192.168.42.101/xhprof/xhprof_html
You can access MailCatcher to read all outgoing emails at http://192.168.42.101:1080
+
+To access the machine you must use the following private keys:
+- User root: located at puphpet/files/dot/ssh/root_rsa
+- User vagrant: located at puphpet/files/dot/ssh/id_rsa
diff --git a/dev/vagrant/dolibarrdev/Vagrantfile b/dev/vagrant/dolibarrdev/Vagrantfile
index f73476207d0..a0bcc88ced6 100644
--- a/dev/vagrant/dolibarrdev/Vagrantfile
+++ b/dev/vagrant/dolibarrdev/Vagrantfile
@@ -23,13 +23,62 @@ Vagrant.configure("2") do |config|
end
end
+ if Vagrant.has_plugin?('vagrant-hostsupdater')
+ hosts = Array.new()
+
+ if !configValues['apache']['install'].nil? &&
+ configValues['apache']['install'].to_i == 1 &&
+ configValues['apache']['vhosts'].is_a?(Hash)
+ configValues['apache']['vhosts'].each do |i, vhost|
+ hosts.push(vhost['servername'])
+
+ if vhost['serveraliases'].is_a?(Array)
+ vhost['serveraliases'].each do |vhost_alias|
+ hosts.push(vhost_alias)
+ end
+ end
+ end
+ elsif !configValues['nginx']['install'].nil? &&
+ configValues['nginx']['install'].to_i == 1 &&
+ configValues['nginx']['vhosts'].is_a?(Hash)
+ configValues['nginx']['vhosts'].each do |i, vhost|
+ hosts.push(vhost['server_name'])
+
+ if vhost['server_aliases'].is_a?(Array)
+ vhost['server_aliases'].each do |x, vhost_alias|
+ hosts.push(vhost_alias)
+ end
+ end
+ end
+ end
+
+ if hosts.any?
+ contents = File.open("#{dir}/puphpet/shell/hostsupdater-notice.txt", 'r'){ |file| file.read }
+ puts "\n\033[34m#{contents}\033[0m\n"
+
+ if config.vm.hostname.to_s.strip.length == 0
+ config.vm.hostname = 'puphpet-dev-machine'
+ end
+
+ config.hostsupdater.aliases = hosts
+ end
+ end
+
data['vm']['synced_folder'].each do |i, folder|
if folder['source'] != '' && folder['target'] != ''
- nfs = (folder['nfs'] == "true") ? "nfs" : nil
- if nfs == "nfs"
- config.vm.synced_folder "#{folder['source']}", "#{folder['target']}", id: "#{i}", type: nfs
+ if folder['sync_type'] == 'nfs'
+ config.vm.synced_folder "#{folder['source']}", "#{folder['target']}", id: "#{i}", type: "nfs"
+ elsif folder['sync_type'] == 'smb'
+ config.vm.synced_folder "#{folder['source']}", "#{folder['target']}", id: "#{i}", type: "smb"
+ elsif folder['sync_type'] == 'rsync'
+ rsync_args = !folder['rsync']['args'].nil? ? folder['rsync']['args'] : ["--verbose", "--archive", "--delete", "-z"]
+ rsync_auto = !folder['rsync']['auto'].nil? ? folder['rsync']['auto'] : true
+ rsync_exclude = !folder['rsync']['exclude'].nil? ? folder['rsync']['exclude'] : [".vagrant/"]
+
+ config.vm.synced_folder "#{folder['source']}", "#{folder['target']}", id: "#{i}",
+ rsync__args: rsync_args, rsync__exclude: rsync_exclude, rsync__auto: rsync_auto, type: "rsync"
else
- config.vm.synced_folder "#{folder['source']}", "#{folder['target']}", id: "#{i}", type: nfs,
+ config.vm.synced_folder "#{folder['source']}", "#{folder['target']}", id: "#{i}",
group: 'www-data', owner: 'www-data', mount_options: ["dmode=775", "fmode=764"]
end
end
@@ -45,6 +94,9 @@ Vagrant.configure("2") do |config|
if key == "memory"
next
end
+ if key == "cpus"
+ next
+ end
if key == "natdnshostresolver1"
value = value ? "on" : "off"
@@ -54,6 +106,7 @@ Vagrant.configure("2") do |config|
end
virtualbox.customize ["modifyvm", :id, "--memory", "#{data['vm']['memory']}"]
+ virtualbox.customize ["modifyvm", :id, "--cpus", "#{data['vm']['cpus']}"]
if data['vm']['hostname'].to_s.strip.length != 0
virtualbox.customize ["modifyvm", :id, "--name", config.vm.hostname]
@@ -69,11 +122,15 @@ Vagrant.configure("2") do |config|
if key == "memsize"
next
end
+ if key == "cpus"
+ next
+ end
v.vmx["#{key}"] = "#{value}"
end
v.vmx["memsize"] = "#{data['vm']['memory']}"
+ v.vmx["numvcpus"] = "#{data['vm']['cpus']}"
if data['vm']['hostname'].to_s.strip.length != 0
v.vmx["displayName"] = config.vm.hostname
@@ -89,11 +146,15 @@ Vagrant.configure("2") do |config|
if key == "memsize"
next
end
+ if key == "cpus"
+ next
+ end
v.customize ["set", :id, "--#{key}", "#{value}"]
end
v.memory = "#{data['vm']['memory']}"
+ v.cpus = "#{data['vm']['cpus']}"
if data['vm']['hostname'].to_s.strip.length != 0
v.name = config.vm.hostname
@@ -111,7 +172,8 @@ Vagrant.configure("2") do |config|
kg.path = "puphpet/shell/ssh-keygen.sh"
kg.args = "#{ssh_username}"
end
- config.vm.provision :shell, :path => "puphpet/shell/update-puppet.sh"
+ config.vm.provision :shell, :path => "puphpet/shell/install-ruby.sh"
+ config.vm.provision :shell, :path => "puphpet/shell/install-puppet.sh"
config.vm.provision :puppet do |puppet|
puppet.facter = {
@@ -128,7 +190,14 @@ Vagrant.configure("2") do |config|
end
end
- config.vm.provision :shell, :path => "puphpet/shell/execute-files.sh"
+ config.vm.provision :shell do |s|
+ s.path = "puphpet/shell/execute-files.sh"
+ s.args = ["exec-once", "exec-always"]
+ end
+ config.vm.provision :shell, run: "always" do |s|
+ s.path = "puphpet/shell/execute-files.sh"
+ s.args = ["startup-once", "startup-always"]
+ end
config.vm.provision :shell, :path => "puphpet/shell/important-notices.sh"
if File.file?("#{dir}/puphpet/files/dot/ssh/id_rsa")
@@ -168,3 +237,4 @@ Vagrant.configure("2") do |config|
end
+
diff --git a/dev/vagrant/dolibarrdev/puphpet/.gitattributes b/dev/vagrant/dolibarrdev/puphpet/.gitattributes
index 93f9975f88e..5bb817f8e45 100644
--- a/dev/vagrant/dolibarrdev/puphpet/.gitattributes
+++ b/dev/vagrant/dolibarrdev/puphpet/.gitattributes
@@ -2,9 +2,4 @@
* text=auto
# Force the following filetypes to have unix eols, so Windows does not break them
-*.pp text eol=lf
-*.sh text eol=lf
-*.yaml text eol=lf
-Puppetfile text eol=lf
-.bash_aliases text eol=lf
-.vimrc text eol=lf
+*.* text eol=lf
diff --git a/dev/vagrant/dolibarrdev/puphpet/config.yaml b/dev/vagrant/dolibarrdev/puphpet/config.yaml
index 5cfb2601f21..e88a3e13003 100644
--- a/dev/vagrant/dolibarrdev/puphpet/config.yaml
+++ b/dev/vagrant/dolibarrdev/puphpet/config.yaml
@@ -5,6 +5,7 @@ vagrantfile-local:
box_url: puphpet/debian75-x64
hostname: null
memory: '512'
+ cpus: '1'
chosen_provider: virtualbox
network:
private_network: 192.168.42.101
@@ -29,10 +30,12 @@ vagrantfile-local:
- '--hiera_config /vagrant/puphpet/puppet/hiera.yaml'
- '--parser future'
synced_folder:
- PL1BkioqqvGY:
+ w6GqzzS2a7lu:
source: ../../../
- target: /var/www
- nfs: 'false'
+ target: /var/www/dolibarr
+ sync_type: default
+ rsync:
+ auto: 'false'
usable_port_range: 2200..2250
ssh:
host: null
@@ -61,8 +64,7 @@ mailcatcher:
smtp_port: 1025
http_ip: 0.0.0.0
http_port: '1080'
- mailcatcher_path: /usr/local/bin
- log_path: /var/log/mailcatcher/mailcatcher.log
+ mailcatcher_path: /usr/local/rvm/wrappers/default
firewall:
install: '1'
rules: null
@@ -71,7 +73,7 @@ apache:
settings:
user: www-data
group: www-data
- default_vhost: false
+ default_vhost: true
manage_user: false
manage_group: false
sendfile: 0
@@ -79,9 +81,9 @@ apache:
- php
- rewrite
vhosts:
- CGyWQB0fx4x0:
+ syTi8VestVdG:
servername: dev.dolibarr.org
- docroot: /var/www/htdocs
+ docroot: /var/www/dolibarr/htdocs
port: '80'
setenv:
- 'APP_ENV dev'
@@ -96,8 +98,12 @@ apache:
mod_spdy: 0
nginx:
install: 0
+ settings:
+ default_vhost: 1
+ proxy_buffer_size: 128k
+ proxy_buffers: '4 256k'
vhosts:
- jeF1sybIJ3V2:
+ kZiLLcLAIVAF:
server_name: awesome.dev
server_aliases:
- www.awesome.dev
@@ -152,7 +158,7 @@ mysql:
root_password: root
adminer: 0
databases:
- 2OfuuapoIqsl:
+ HHTBm64g1siG:
grant:
- ALTER
- CREATE
@@ -166,16 +172,16 @@ mysql:
host: localhost
user: user
password: user
- sql_file: /var/www/dev/initdata/mysqldump_dolibarr_3.5.0.sql
+ sql_file: /var/www/dolibarr/dev/initdata/mysqldump_dolibarr_3.5.0.sql
postgresql:
- install: 0
+ install: '1'
settings:
- root_password: '123'
+ root_password: root
user_group: postgres
encoding: UTF8
version: '9.3'
databases: { }
- adminer: 0
+ adminer: '1'
mariadb:
install: 0
root_password: '123'
diff --git a/dev/vagrant/dolibarrdev/puphpet/files/dot/.gitignore b/dev/vagrant/dolibarrdev/puphpet/files/dot/.gitignore
index dcf60545594..e9b023ea6a6 100644
--- a/dev/vagrant/dolibarrdev/puphpet/files/dot/.gitignore
+++ b/dev/vagrant/dolibarrdev/puphpet/files/dot/.gitignore
@@ -1,4 +1 @@
-ssh/id_rsa
-ssh/id_rsa.pub
-ssh/insecure_private_key
-ssh/id_rsa.ppk
\ No newline at end of file
+ssh/*
\ No newline at end of file
diff --git a/dev/vagrant/dolibarrdev/puphpet/files/startup-always/empty b/dev/vagrant/dolibarrdev/puphpet/files/startup-always/empty
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/dev/vagrant/dolibarrdev/puphpet/files/startup-once/empty b/dev/vagrant/dolibarrdev/puphpet/files/startup-once/empty
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/manifest.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/manifest.pp
index 57f759e5531..ea27564f8c9 100644
--- a/dev/vagrant/dolibarrdev/puphpet/puppet/manifest.pp
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/manifest.pp
@@ -197,8 +197,8 @@ if is_array($server_values['packages']) and count($server_values['packages']) >
}
define add_dotdeb ($release){
- apt::source { $name:
- location => 'http://packages.dotdeb.org',
+ apt::source { "${name}-repo.puphpet":
+ location => 'http://repo.puphpet.com/dotdeb/',
release => $release,
repos => 'all',
required_packages => 'debian-keyring debian-archive-keyring',
@@ -270,7 +270,7 @@ if hash_key_equals($mailcatcher_values, 'install', 1) {
create_resources('class', { 'mailcatcher' => $mailcatcher_values['settings'] })
- if ! defined(Firewall["100 tcp/${mailcatcher_values['settings']['smtp_port']},${mailcatcher_values['settings']['http_port']}"]) {
+ if ! defined(Firewall["100 tcp/${mailcatcher_values['settings']['smtp_port']}, ${mailcatcher_values['settings']['http_port']}"]) {
firewall { "100 tcp/${mailcatcher_values['settings']['smtp_port']}, ${mailcatcher_values['settings']['http_port']}":
port => [$mailcatcher_values['settings']['smtp_port'], $mailcatcher_values['settings']['http_port']],
proto => tcp,
@@ -279,30 +279,39 @@ if hash_key_equals($mailcatcher_values, 'install', 1) {
}
if ! defined(Class['supervisord']) {
+ class{ 'puphpet::python::pip': }
+
class { 'supervisord':
- install_pip => true,
+ install_pip => false,
+ require => [
+ Class['my_fw::post'],
+ Class['Puphpet::Python::Pip'],
+ ],
}
}
- $supervisord_mailcatcher_options = sort(join_keys_to_values({
+ $mailcatcher_path = $mailcatcher_values['settings']['mailcatcher_path']
+
+ $mailcatcher_options = sort(join_keys_to_values({
' --smtp-ip' => $mailcatcher_values['settings']['smtp_ip'],
' --smtp-port' => $mailcatcher_values['settings']['smtp_port'],
' --http-ip' => $mailcatcher_values['settings']['http_ip'],
' --http-port' => $mailcatcher_values['settings']['http_port']
}, ' '))
- $supervisord_mailcatcher_cmd = "mailcatcher ${supervisord_mailcatcher_options} -f >> ${mailcatcher_values['settings']['log']}"
-
supervisord::program { 'mailcatcher':
- command => $supervisord_mailcatcher_cmd,
+ command => "${mailcatcher_path}/mailcatcher ${mailcatcher_options} -f",
priority => '100',
user => 'mailcatcher',
autostart => true,
autorestart => 'true',
environment => {
- 'PATH' => "/bin:/sbin:/usr/bin:/usr/sbin:${mailcatcher_values['settings']['path']}"
+ 'PATH' => "/bin:/sbin:/usr/bin:/usr/sbin:${mailcatcher_path}"
},
- require => Package['mailcatcher']
+ require => [
+ Class['mailcatcher::config'],
+ File['/var/log/mailcatcher']
+ ],
}
}
@@ -312,10 +321,6 @@ if $firewall_values == undef {
$firewall_values = hiera('firewall', false)
}
-resources { 'firewall':
- purge => true
-}
-
Firewall {
before => Class['my_fw::post'],
require => Class['my_fw::pre'],
@@ -383,16 +388,15 @@ if hash_key_equals($apache_values, 'install', 1) {
include puphpet::params
include apache::params
- $webroot_location = $puphpet::params::apache_webroot_location
+ $webroot_location = $puphpet::params::apache_webroot_location
+ $apache_provider_types = ['virtualbox', 'vmware_fusion', 'vmware_desktop', 'parallels']
exec { "exec mkdir -p ${webroot_location}":
command => "mkdir -p ${webroot_location}",
creates => $webroot_location,
}
- if (downcase($::provisioner_type) in ['virtualbox', 'vmware_fusion'])
- and ! defined(File[$webroot_location])
- {
+ if (downcase($::provisioner_type) in $apache_provider_types) and ! defined(File[$webroot_location]) {
file { $webroot_location:
ensure => directory,
mode => 0775,
@@ -401,11 +405,7 @@ if hash_key_equals($apache_values, 'install', 1) {
Group['www-data']
]
}
- }
-
- if !(downcase($::provisioner_type) in ['virtualbox', 'vmware_fusion'])
- and ! defined(File[$webroot_location])
- {
+ } elsif ! (downcase($::provisioner_type) in $apache_provider_types) and ! defined(File[$webroot_location]) {
file { $webroot_location:
ensure => directory,
group => 'www-data',
@@ -435,8 +435,8 @@ if hash_key_equals($apache_values, 'install', 1) {
}
if $::operatingsystem == 'ubuntu'
- and hash_key_equals($php_values, 'install', 1)
- and hash_key_equals($php_values, 'version', 55)
+ and hash_key_equals($php_values, 'install', 1)
+ and hash_key_equals($php_values, 'version', 55)
{
$apache_version = '2.4'
} else {
@@ -467,15 +467,16 @@ if hash_key_equals($apache_values, 'install', 1) {
$apache_vhosts = merge($apache_values['vhosts'], {
'default_vhost_80' => {
'servername' => 'default',
- 'serveraliases' => ['*'],
'docroot' => '/var/www/default',
'port' => 80,
+ 'default_vhost' => true,
},
'default_vhost_443' => {
'servername' => 'default',
- 'serveraliases' => ['*'],
'docroot' => '/var/www/default',
'port' => 443,
+ 'default_vhost' => true,
+ 'ssl' => 1,
},
})
} else {
@@ -489,7 +490,7 @@ if hash_key_equals($apache_values, 'install', 1) {
creates => $vhost['docroot'],
}
- if (downcase($::provisioner_type) in ['virtualbox', 'vmware_fusion'])
+ if (downcase($::provisioner_type) in $apache_provider_types)
and ! defined(File[$vhost['docroot']])
{
file { $vhost['docroot']:
@@ -497,9 +498,7 @@ if hash_key_equals($apache_values, 'install', 1) {
mode => 0765,
require => Exec["exec mkdir -p ${vhost['docroot']} @ key ${key}"]
}
- }
-
- if !(downcase($::provisioner_type) in ['virtualbox', 'vmware_fusion'])
+ } elsif !(downcase($::provisioner_type) in $apache_provider_types)
and ! defined(File[$vhost['docroot']])
{
file { $vhost['docroot']:
@@ -515,11 +514,11 @@ if hash_key_equals($apache_values, 'install', 1) {
create_resources(apache::vhost, { "${key}" => merge($vhost, {
'custom_fragment' => template('puphpet/apache/custom_fragment.erb'),
- 'ssl' => 'ssl' in $vhost and str2bool($vhost['ssl']) ? { true => true, default => false },
- 'ssl_cert' => 'ssl_cert' in $vhost and $vhost['ssl_cert'] ? { undef => undef, '' => undef, default => $vhost['ssl_cert'] },
- 'ssl_key' => 'ssl_key' in $vhost and $vhost['ssl_key'] ? { undef => undef, '' => undef, default => $vhost['ssl_key'] },
- 'ssl_chain' => 'ssl_chain' in $vhost and $vhost['ssl_chain'] ? { undef => undef, '' => undef, default => $vhost['ssl_chain'] },
- 'ssl_certs_dir' => 'ssl_certs_dir' in $vhost and $vhost['ssl_certs_dir'] ? { undef => undef, '' => undef, default => $vhost['ssl_certs_dir'] }
+ 'ssl' => 'ssl' in $vhost and str2bool($vhost['ssl']) ? { true => true, default => false },
+ 'ssl_cert' => hash_key_true($vhost, 'ssl_cert') ? { true => $vhost['ssl_cert'], default => undef },
+ 'ssl_key' => hash_key_true($vhost, 'ssl_key') ? { true => $vhost['ssl_key'], default => undef },
+ 'ssl_chain' => hash_key_true($vhost, 'ssl_chain') ? { true => $vhost['ssl_chain'], default => undef },
+ 'ssl_certs_dir' => hash_key_true($vhost, 'ssl_certs_dir') ? { true => $vhost['ssl_certs_dir'], default => undef }
})
})
@@ -578,33 +577,25 @@ if hash_key_equals($nginx_values, 'install', 1) {
}
}
- $webroot_location = $puphpet::params::nginx_webroot_location
+ $webroot_location = $puphpet::params::nginx_webroot_location
+ $nginx_provider_types = ['virtualbox', 'vmware_fusion', 'vmware_desktop', 'parallels']
exec { "exec mkdir -p ${webroot_location}":
command => "mkdir -p ${webroot_location}",
creates => $webroot_location,
}
- if (downcase($::provisioner_type) in ['virtualbox', 'vmware_fusion'])
- and ! defined(File[$webroot_location])
- {
+ if (downcase($::provisioner_type) in $nginx_provider_types) and ! defined(File[$webroot_location]) {
file { $webroot_location:
ensure => directory,
mode => 0775,
- require => [
- Exec["exec mkdir -p ${webroot_location}"],
- Group['www-data']
- ]
+ require => Exec["exec mkdir -p ${webroot_location}"],
}
- }
-
- if !(downcase($::provisioner_type) in ['virtualbox', 'vmware_fusion'])
- and ! defined(File[$webroot_location])
- {
+ } elsif ! (downcase($::provisioner_type) in $nginx_provider_types) and ! defined(File[$webroot_location]) {
file { $webroot_location:
ensure => directory,
- group => 'www-data',
mode => 0775,
+ group => 'www-data',
require => [
Exec["exec mkdir -p ${webroot_location}"],
Group['www-data']
@@ -626,12 +617,10 @@ if hash_key_equals($nginx_values, 'install', 1) {
if hash_key_equals($php_values, 'install', 1) {
$php5_fpm_sock = '/var/run/php5-fpm.sock'
- if $php_values['version'] == undef {
- $fastcgi_pass = null
- } elsif $php_values['version'] == '53' {
- $fastcgi_pass = '127.0.0.1:9000'
- } else {
- $fastcgi_pass = "unix:${php5_fpm_sock}"
+ $fastcgi_pass = $php_values['version'] ? {
+ '53' => '127.0.0.1:9000',
+ undef => null,
+ default => "unix:${php5_fpm_sock}"
}
if $::osfamily == 'redhat' and $fastcgi_pass == "unix:${php5_fpm_sock}" {
@@ -641,7 +630,7 @@ if hash_key_equals($nginx_values, 'install', 1) {
require => Package['nginx'],
}
- exec { "listen = 127.0.0.1:9000 => listen = ${php5_fpm_sock}":
+ exec { "'listen = 127.0.0.1:9000' => 'listen = ${php5_fpm_sock}'":
command => "perl -p -i -e 's#listen = 127.0.0.1:9000#listen = ${php5_fpm_sock}#gi' /etc/php-fpm.d/www.conf",
unless => "grep -c 'listen = 127.0.0.1:9000' '${php5_fpm_sock}'",
notify => [
@@ -651,29 +640,51 @@ if hash_key_equals($nginx_values, 'install', 1) {
require => Exec["create ${php5_fpm_sock} file"]
}
- set_php5_fpm_sock_group_and_user { 'php_rhel':
+ set_nginx_php5_fpm_sock_group_and_user { 'php_rhel':
require => Exec["create ${php5_fpm_sock} file"],
}
} else {
- set_php5_fpm_sock_group_and_user { 'php':
+ set_nginx_php5_fpm_sock_group_and_user { 'php':
require => Package['nginx'],
subscribe => Service['php5-fpm'],
}
}
} elsif hash_key_equals($hhvm_values, 'install', 1) {
- $fastcgi_pass = '127.0.0.1:9000'
-
- set_php5_fpm_sock_group_and_user { 'hhvm':
- require => Package['nginx'],
- }
+ $fastcgi_pass = '127.0.0.1:9000'
} else {
- $fastcgi_pass = ''
+ $fastcgi_pass = null
}
class { 'nginx': }
- if count($nginx_values['vhosts']) > 0 {
- each( $nginx_values['vhosts'] ) |$key, $vhost| {
+ if hash_key_equals($nginx_values['settings'], 'default_vhost', 1) {
+ $nginx_vhosts = merge($nginx_values['vhosts'], {
+ 'default' => {
+ 'server_name' => '_',
+ 'server_aliases' => [],
+ 'www_root' => '/var/www/html',
+ 'listen_port' => 80,
+ 'index_files' => ['index', 'index.html', 'index.htm', 'index.php'],
+ 'envvars' => [],
+ 'ssl' => '0',
+ 'ssl_cert' => '',
+ 'ssl_key' => '',
+ },
+ })
+
+ if ! defined(File[$puphpet::params::nginx_default_conf_location]) {
+ file { $puphpet::params::nginx_default_conf_location:
+ ensure => absent,
+ require => Package['nginx'],
+ notify => Class['nginx::service'],
+ }
+ }
+ } else {
+ $nginx_vhosts = $nginx_values['vhosts']
+ }
+
+ if count($nginx_vhosts) > 0 {
+ each( $nginx_vhosts ) |$key, $vhost| {
exec { "exec mkdir -p ${vhost['www_root']} @ key ${key}":
command => "mkdir -p ${vhost['www_root']}",
creates => $vhost['www_root'],
@@ -695,7 +706,7 @@ if hash_key_equals($nginx_values, 'install', 1) {
}
}
- create_resources(nginx_vhost, $nginx_values['vhosts'])
+ create_resources(nginx_vhost, $nginx_vhosts)
}
if ! defined(Firewall['100 tcp/443']) {
@@ -743,41 +754,12 @@ define nginx_vhost (
$fastcgi_param_parts = []
}
- if $ssl == 0 or $ssl == false or $ssl == '' {
- $ssl_set = false
- } else {
- $ssl_set = true
- }
-
- if $ssl_cert == 0 or $ssl_cert == false or $ssl_cert == '' {
- $ssl_cert_set = $puphpet::params::ssl_cert_location
- } else {
- $ssl_cert_set = $ssl_cert
- }
-
- if $ssl_key == 0 or $ssl_key == false or $ssl_key == '' {
- $ssl_key_set = $puphpet::params::ssl_key_location
- } else {
- $ssl_key_set = $ssl_key
- }
-
- if $ssl_port == 0 or $ssl_port == false or $ssl_port == '' {
- $ssl_port_set = '443'
- } else {
- $ssl_port_set = $ssl_port
- }
-
- if $rewrite_to_https == 0 or $rewrite_to_https == false or $rewrite_to_https == '' {
- $rewrite_to_https_set = false
- } else {
- $rewrite_to_https_set = true
- }
-
- if $spdy == off or $spdy == 0 or $spdy == false or $spdy == '' {
- $spdy_set = off
- } else {
- $spdy_set = on
- }
+ $ssl_set = value_true($ssl) ? { true => true, default => false, }
+ $ssl_cert_set = value_true($ssl_cert) ? { true => $ssl_cert, default => $puphpet::params::ssl_cert_location, }
+ $ssl_key_set = value_true($ssl_key) ? { true => $ssl_key, default => $puphpet::params::ssl_key_location, }
+ $ssl_port_set = value_true($ssl_port) ? { true => $ssl_port, default => '443', }
+ $rewrite_to_https_set = value_true($rewrite_to_https) ? { true => true, default => false, }
+ $spdy_set = value_true($spdy) ? { true => on, default => off, }
nginx::resource::vhost { $server_name:
server_name => $merged_server_name,
@@ -798,6 +780,19 @@ define nginx_vhost (
$fastcgi_param = concat($fastcgi_param_parts, $envvars)
+ $fastcgi_pass_hash = fastcgi_pass ? {
+ null => {},
+ '' => {},
+ default => {'fastcgi_pass' => $fastcgi_pass},
+ }
+
+ $location_cfg_append = merge({
+ 'fastcgi_split_path_info' => '^(.+\.php)(/.+)$',
+ 'fastcgi_param' => $fastcgi_param,
+ 'fastcgi_index' => 'index.php',
+ 'include' => 'fastcgi_params'
+ }, $fastcgi_pass_hash)
+
nginx::resource::location { "${server_name}-php":
ensure => present,
vhost => $server_name,
@@ -806,20 +801,17 @@ define nginx_vhost (
try_files => ['$uri', '$uri/', "/${try_files}?\$args"],
ssl => $ssl_set,
www_root => $www_root,
- location_cfg_append => {
- 'fastcgi_split_path_info' => '^(.+\.php)(/.+)$',
- 'fastcgi_param' => $fastcgi_param,
- 'fastcgi_pass' => $fastcgi_pass,
- 'fastcgi_index' => 'index.php',
- 'include' => 'fastcgi_params'
- },
+ location_cfg_append => $location_cfg_append,
notify => Class['nginx::service'],
}
}
-define set_php5_fpm_sock_group_and_user (){
+define set_nginx_php5_fpm_sock_group_and_user () {
exec { 'set php5_fpm_sock group and user':
- command => "chmod 660 ${php5_fpm_sock} && chown www-data ${php5_fpm_sock} && chgrp www-data ${php5_fpm_sock} && touch /.puphpet-stuff/php5_fpm_sock",
+ command => "chmod 660 ${php5_fpm_sock} && \
+ chown www-data ${php5_fpm_sock} && \
+ chgrp www-data ${php5_fpm_sock} && \
+ touch /.puphpet-stuff/php5_fpm_sock",
creates => '/.puphpet-stuff/php5_fpm_sock',
}
}
@@ -998,7 +990,7 @@ if hash_key_equals($php_values, 'install', 1) {
{
puphpet::ini { 'sendmail_path':
entry => 'CUSTOM/sendmail_path',
- value => '/usr/bin/env catchmail',
+ value => "${mailcatcher_values['settings']['mailcatcher_path']}/catchmail -f",
php_version => $php_values['version'],
webserver => $php_webserver_service_ini
}
@@ -1096,7 +1088,7 @@ if hash_key_equals($xhprof_values, 'install', 1)
}
if hash_key_equals($apache_values, 'install', 1) {
- $xhprof_webroot_location = $puphpet::params::apache_webroot_location
+ $xhprof_webroot_location = '/var/www/default'
$xhprof_webserver_service = 'httpd'
} elsif hash_key_equals($nginx_values, 'install', 1) {
$xhprof_webroot_location = $puphpet::params::nginx_webroot_location
@@ -1216,11 +1208,11 @@ if hash_key_equals($mysql_values, 'install', 1) {
if hash_key_equals($mysql_values, 'adminer', 1) and $mysql_php_installed {
if hash_key_equals($apache_values, 'install', 1) {
- $mysql_adminer_webroot_location = $puphpet::params::apache_webroot_location
+ $mysql_adminer_webroot_location = '/var/www/default'
} elsif hash_key_equals($nginx_values, 'install', 1) {
$mysql_adminer_webroot_location = $puphpet::params::nginx_webroot_location
} else {
- $mysql_adminer_webroot_location = $puphpet::params::apache_webroot_location
+ $mysql_adminer_webroot_location = '/var/www/default'
}
class { 'puphpet::adminer':
@@ -1329,11 +1321,11 @@ if hash_key_equals($postgresql_values, 'install', 1) {
if hash_key_equals($postgresql_values, 'adminer', 1) and $postgresql_php_installed {
if hash_key_equals($apache_values, 'install', 1) {
- $postgresql_adminer_webroot_location = $puphpet::params::apache_webroot_location
+ $postgresql_adminer_webroot_location = '/var/www/default'
} elsif hash_key_equals($nginx_values, 'install', 1) {
$postgresql_adminer_webroot_location = $puphpet::params::nginx_webroot_location
} else {
- $postgresql_adminer_webroot_location = $puphpet::params::apache_webroot_location
+ $postgresql_adminer_webroot_location = '/var/www/default'
}
class { 'puphpet::adminer':
@@ -1364,7 +1356,7 @@ define postgresql_db (
$table = "${name}.*"
exec{ "${name}-import":
- command => "psql ${name} < ${sql_file}",
+ command => "sudo -u postgres psql ${name} < ${sql_file}",
logoutput => true,
refreshonly => $refresh,
require => Postgresql::Server::Db[$name],
@@ -1491,11 +1483,11 @@ if hash_key_equals($mariadb_values, 'install', 1) {
if hash_key_equals($mariadb_values, 'adminer', 1) and $mariadb_php_installed {
if hash_key_equals($apache_values, 'install', 1) {
- $mariadb_adminer_webroot_location = $puphpet::params::apache_webroot_location
+ $mariadb_adminer_webroot_location = '/var/www/default'
} elsif hash_key_equals($nginx_values, 'install', 1) {
$mariadb_adminer_webroot_location = $puphpet::params::nginx_webroot_location
} else {
- $mariadb_adminer_webroot_location = $puphpet::params::apache_webroot_location
+ $mariadb_adminer_webroot_location = '/var/www/default'
}
class { 'puphpet::adminer':
@@ -1662,7 +1654,7 @@ if $beanstalkd_values == undef {
}
if hash_key_equals($apache_values, 'install', 1) {
- $beanstalk_console_webroot_location = "${puphpet::params::apache_webroot_location}/beanstalk_console"
+ $beanstalk_console_webroot_location = '/var/www/default/beanstalk_console'
} elsif hash_key_equals($nginx_values, 'install', 1) {
$beanstalk_console_webroot_location = "${puphpet::params::nginx_webroot_location}/beanstalk_console"
} else {
@@ -1724,6 +1716,11 @@ if hash_key_equals($apache_values, 'install', 1)
}
if hash_key_equals($rabbitmq_values, 'install', 1) {
+ if $::osfamily == 'redhat' {
+ Class['erlang'] -> Class['rabbitmq']
+ include 'erlang'
+ }
+
create_resources('class', { 'rabbitmq' => $rabbitmq_values['settings'] })
if hash_key_equals($php_values, 'install', 1) and ! defined(Php::Pecl::Module['amqp']) {
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/Gemfile b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/Gemfile
new file mode 100644
index 00000000000..95c7a5dd0b0
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/Gemfile
@@ -0,0 +1,15 @@
+source 'https://rubygems.org'
+
+group :development, :test do
+ gem 'rake', :require => false
+ gem 'rspec-puppet', :require => false
+ gem 'puppetlabs_spec_helper', :require => false
+ gem 'puppet-lint', :require => false
+ gem 'rspec-system-puppet', '~>2.0.0'
+end
+
+if puppetversion = ENV['PUPPET_GEM_VERSION']
+ gem 'puppet', puppetversion, :require => false
+else
+ gem 'puppet', :require => false
+end
\ No newline at end of file
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/LICENSE b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/LICENSE
new file mode 100644
index 00000000000..009b66b6cc2
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/LICENSE
@@ -0,0 +1,13 @@
+Copyright 2012-2014 Michael Stahnke
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/Modulefile b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/Modulefile
new file mode 100644
index 00000000000..237d164011a
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/Modulefile
@@ -0,0 +1,8 @@
+name 'stahnma-epel'
+version '0.1.0'
+source 'http://github.com/stahnma/puppet-module-epel'
+author 'stahnma'
+license 'Apache License, Version 2.0'
+summary 'Setup the EPEL package repo'
+description 'Setup the EPEL package repo on Centos/RHEL et all'
+project_page 'http://github.com/stahnma/puppet-module-epel'
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/README.md b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/README.md
new file mode 100644
index 00000000000..33b87278574
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/README.md
@@ -0,0 +1,90 @@
+# Configure EPEL (Extra Repository for Enterprise Linux)
+
+# About
+This module basically just mimics the epel-release rpm. The same repos are
+enabled/disabled and the GPG key is imported. In the end you will end up with
+the EPEL repos configured.
+
+The following Repos will be setup and enabled by default:
+
+ * epel
+
+Other repositories that will setup but disabled (as per the epel-release setup)
+
+ * epel-debuginfo
+ * epel-source
+ * epel-testing
+ * epel-testing-debuginfo
+ * epel-testing-source
+
+# Proxy
+If you have an http proxy required to access the internet, you can use either
+a class parameter in the _epel_ class, or edit the $proxy variable in the
+params.pp file. By default no proxy is assumed.
+
+# Why?
+I am a big fan of EPEL. I actually was one of the people who helped get it
+going. I am also the owner of the epel-release package, so in general this
+module should stay fairly up to date with the official upstream package.
+
+I just got sick of coding Puppet modules and basically having an assumption
+that EPEL was setup or installed. I can now depend on this module instead.
+
+I realize it is fairly trivial to get EPEL setup. Every now-and-then however
+the path to epel-release changes because something changes in the package (mass
+rebuild, rpm build macros updates, etc). This module will bypass the changing
+URL and just setup the package mirrors.
+
+This does mean that if you are looking for RPM macros that are normally
+included with EPEL release, this will not have them.
+
+# Futher Information
+
+* [EPEL Wiki](http://fedoraproject.org/wiki/EPEL)
+* [epel-release package information](http://mirrors.servercentral.net/fedora/epel/6/i386/repoview/epel-release.html)
+
+# Testing
+
+* This is commonly used on Puppet Enterprise 3.x
+* This was tested using Puppet 3.3.0 on Centos5/6
+* This was tested using Puppet 3.1.1 on Amazon's AWS Linux
+* I assume it will work on any RHEL variant (Amazon Linux is debatable as a variant)
+
+# Lifecycle
+* No functionality has been introduced that should break Puppet 2.6 or 2.7, but I am no longer testing these versions of Puppet as they are end-of-lifed from Puppet Labs.
+
+## Unit tests
+
+Install the necessary gems
+
+ bundle install
+
+Run the RSpec and puppet-lint tests
+
+ bundle exec rake ci
+
+## System tests
+
+If you have Vagrant >=1.1.0 you can also run system tests:
+
+ RSPEC_SET=centos-64-x64 bundle exec rake spec:system
+
+Available RSPEC_SET options are in .nodeset.yml
+
+# License
+Apache Software License 2.0
+
+# Author/Contributors
+ * Chad Metcalf
+ * Joseph Swick
+ * Matthaus Owens
+ * Michael Stahnke
+ * Michael Stahnke
+ * Pro Cabales
+ * Proletaryo Cabales
+ * Stefan Goethals
+ * Tim Rupp
+ * Trey Dockendorf
+ * Troy Bollinger
+ * Vlastimil Holer
+ * Ewoud Kohl van Wijngaarden
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/Rakefile b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/Rakefile
new file mode 100644
index 00000000000..5a71d17767d
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/Rakefile
@@ -0,0 +1,17 @@
+require 'puppetlabs_spec_helper/rake_tasks'
+require 'puppet-lint/tasks/puppet-lint'
+require 'rspec-system/rake_task'
+
+task :default do
+ sh %{rake -T}
+end
+
+# Disable specific puppet-lint checks
+PuppetLint.configuration.send("disable_80chars")
+PuppetLint.configuration.send("disable_class_inherits_from_params_class")
+
+desc "Run rspec-puppet and puppet-lint tasks"
+task :ci => [
+ :lint,
+ :spec,
+]
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/files/RPM-GPG-KEY-EPEL-5 b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/files/RPM-GPG-KEY-EPEL-5
new file mode 100644
index 00000000000..5a13bb4f9f9
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/files/RPM-GPG-KEY-EPEL-5
@@ -0,0 +1,30 @@
+-----BEGIN PGP PUBLIC KEY BLOCK-----
+Version: GnuPG v1.2.6 (GNU/Linux)
+
+mQGiBEXopTIRBACZDBMOoFOakAjaxw1LXjeSvh/kmE35fU1rXfM7T0AV31NATCLF
+l5CQiNDA4oWreDThg2Bf6+LIVTsGQb1V+XXuLak4Em5yTYwMTVB//4/nMxQEbpl/
+QB2XwlJ7EQ0vW+kiPDz/7pHJz1p1jADzd9sQQicMtzysS4qT2i5A23j0VwCg1PB/
+lpYqo0ZhWTrevxKMa1n34FcD/REavj0hSLQFTaKNLHRotRTF8V0BajjSaTkUT4uk
+/RTaZ8Kr1mTosVtosqmdIAA2XHxi8ZLiVPPSezJjfElsSqOAxEKPL0djfpp2wrTm
+l/1iVnX+PZH5DRKCbjdCMLDJhYap7YUhcPsMGSeUKrwmBCBJUPc6DhjFvyhA9IMl
+1T0+A/9SKTv94ToP/JYoCTHTgnG5MoVNafisfe0wojP2mWU4gRk8X4dNGKMj6lic
+vM6gne3hESyjcqZSmr7yELPPGhI9MNauJ6Ob8cTR2T12Fmv9w03DD3MnBstR6vhP
+QcqZKhc5SJYYY7oVfxlSOfF4xfwcHQKoD5TOKwIAQ6T8jyFpKbQkRmVkb3JhIEVQ
+RUwgPGVwZWxAZmVkb3JhcHJvamVjdC5vcmc+iGQEExECACQFAkXopTICGwMFCRLM
+AwAGCwkIBwMCAxUCAwMWAgECHgECF4AACgkQEZzANiF1IfabmQCgzvE60MnHSOBa
+ZXXF7uU2Vzu8EOkAoKg9h+j0NuNom6WUYZyJQt4zc5seuQINBEXopTYQCADapnR/
+blrJ8FhlgNPl0X9S3JE/kygPbNXIqne4XBVYisVp0uzNCRUxNZq30MpY027JCs2J
+nL2fMpwvx33f0phU029vrIZKA3CmnnwVsjcWfMJOVPBmVN7m5bGU68F+PdRIcDsl
+PMOWRLkTBZOGolLgIbM4719fqA8etewILrX6uPvRDwywV7/sPCFpRcfNNBUY+Zx3
+5bf4fnkaCKxgXgQS3AT+hGYhlzIqQVTkGNveHTnt4SSzgAqR9sSwQwqvEfVtYNeS
+w5rDguLG41HQm1Hojv59HNYjH6F/S1rClZi21bLgZbKpCFX76qPt8CTw+iQLBPPd
+yoOGHfzyp7nsfhUrAAMFB/9/H9Gpk822ZpBexQW4y3LGFo9ZSnmu+ueOZPU3SqDA
+DW1ovZdYzGuJTGGM9oMl6bL8eZrcUBBOFaWge5wZczIE3hx2exEOkDdvq+MUDVD1
+axmN45q/7h1NYRp5GQL2ZsoV4g9U2gMdzHOFtZCER6PP9ErVlfJpgBUCdSL93V4H
+Sgpkk7znmTOklbCM6l/G/A6q4sCRqfzHwVSTiruyTBiU9lfROsAl8fjIq2OzWJ2T
+P9sadBe1llUYaow7txYSUxssW+89avct35gIyrBbof5M+CBXyAOUaSWmpM2eub24
+0qbqiSr/Y6Om0t6vSzR8gRk7g+1H6IE0Tt1IJCvCAMimiE8EGBECAA8FAkXopTYC
+GwwFCRLMAwAACgkQEZzANiF1IfZQYgCgiZHCv4xb+sTHCn/otc1Ovvi/OgMAnRXY
+bbsLFWOfmzAnNIGvFRWy+YHi
+=MMNL
+-----END PGP PUBLIC KEY BLOCK-----
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/files/RPM-GPG-KEY-EPEL-6 b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/files/RPM-GPG-KEY-EPEL-6
new file mode 100644
index 00000000000..7a2030489d2
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/files/RPM-GPG-KEY-EPEL-6
@@ -0,0 +1,29 @@
+-----BEGIN PGP PUBLIC KEY BLOCK-----
+Version: GnuPG v1.4.5 (GNU/Linux)
+
+mQINBEvSKUIBEADLGnUj24ZVKW7liFN/JA5CgtzlNnKs7sBg7fVbNWryiE3URbn1
+JXvrdwHtkKyY96/ifZ1Ld3lE2gOF61bGZ2CWwJNee76Sp9Z+isP8RQXbG5jwj/4B
+M9HK7phktqFVJ8VbY2jfTjcfxRvGM8YBwXF8hx0CDZURAjvf1xRSQJ7iAo58qcHn
+XtxOAvQmAbR9z6Q/h/D+Y/PhoIJp1OV4VNHCbCs9M7HUVBpgC53PDcTUQuwcgeY6
+pQgo9eT1eLNSZVrJ5Bctivl1UcD6P6CIGkkeT2gNhqindRPngUXGXW7Qzoefe+fV
+QqJSm7Tq2q9oqVZ46J964waCRItRySpuW5dxZO34WM6wsw2BP2MlACbH4l3luqtp
+Xo3Bvfnk+HAFH3HcMuwdaulxv7zYKXCfNoSfgrpEfo2Ex4Im/I3WdtwME/Gbnwdq
+3VJzgAxLVFhczDHwNkjmIdPAlNJ9/ixRjip4dgZtW8VcBCrNoL+LhDrIfjvnLdRu
+vBHy9P3sCF7FZycaHlMWP6RiLtHnEMGcbZ8QpQHi2dReU1wyr9QgguGU+jqSXYar
+1yEcsdRGasppNIZ8+Qawbm/a4doT10TEtPArhSoHlwbvqTDYjtfV92lC/2iwgO6g
+YgG9XrO4V8dV39Ffm7oLFfvTbg5mv4Q/E6AWo/gkjmtxkculbyAvjFtYAQARAQAB
+tCFFUEVMICg2KSA8ZXBlbEBmZWRvcmFwcm9qZWN0Lm9yZz6JAjYEEwECACAFAkvS
+KUICGw8GCwkIBwMCBBUCCAMEFgIDAQIeAQIXgAAKCRA7Sd8qBgi4lR/GD/wLGPv9
+qO39eyb9NlrwfKdUEo1tHxKdrhNz+XYrO4yVDTBZRPSuvL2yaoeSIhQOKhNPfEgT
+9mdsbsgcfmoHxmGVcn+lbheWsSvcgrXuz0gLt8TGGKGGROAoLXpuUsb1HNtKEOwP
+Q4z1uQ2nOz5hLRyDOV0I2LwYV8BjGIjBKUMFEUxFTsL7XOZkrAg/WbTH2PW3hrfS
+WtcRA7EYonI3B80d39ffws7SmyKbS5PmZjqOPuTvV2F0tMhKIhncBwoojWZPExft
+HpKhzKVh8fdDO/3P1y1Fk3Cin8UbCO9MWMFNR27fVzCANlEPljsHA+3Ez4F7uboF
+p0OOEov4Yyi4BEbgqZnthTG4ub9nyiupIZ3ckPHr3nVcDUGcL6lQD/nkmNVIeLYP
+x1uHPOSlWfuojAYgzRH6LL7Idg4FHHBA0to7FW8dQXFIOyNiJFAOT2j8P5+tVdq8
+wB0PDSH8yRpn4HdJ9RYquau4OkjluxOWf0uRaS//SUcCZh+1/KBEOmcvBHYRZA5J
+l/nakCgxGb2paQOzqqpOcHKvlyLuzO5uybMXaipLExTGJXBlXrbbASfXa/yGYSAG
+iVrGz9CE6676dMlm8F+s3XXE13QZrXmjloc6jwOljnfAkjTGXjiB7OULESed96MR
+XtfLk0W5Ab9pd7tKDR6QHI7rgHXfCopRnZ2VVQ==
+=V/6I
+-----END PGP PUBLIC KEY BLOCK-----
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/files/RPM-GPG-KEY-EPEL-7 b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/files/RPM-GPG-KEY-EPEL-7
new file mode 100644
index 00000000000..f205ede4637
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/files/RPM-GPG-KEY-EPEL-7
@@ -0,0 +1,29 @@
+-----BEGIN PGP PUBLIC KEY BLOCK-----
+Version: GnuPG v1.4.11 (GNU/Linux)
+
+mQINBFKuaIQBEAC1UphXwMqCAarPUH/ZsOFslabeTVO2pDk5YnO96f+rgZB7xArB
+OSeQk7B90iqSJ85/c72OAn4OXYvT63gfCeXpJs5M7emXkPsNQWWSju99lW+AqSNm
+jYWhmRlLRGl0OO7gIwj776dIXvcMNFlzSPj00N2xAqjMbjlnV2n2abAE5gq6VpqP
+vFXVyfrVa/ualogDVmf6h2t4Rdpifq8qTHsHFU3xpCz+T6/dGWKGQ42ZQfTaLnDM
+jToAsmY0AyevkIbX6iZVtzGvanYpPcWW4X0RDPcpqfFNZk643xI4lsZ+Y2Er9Yu5
+S/8x0ly+tmmIokaE0wwbdUu740YTZjCesroYWiRg5zuQ2xfKxJoV5E+Eh+tYwGDJ
+n6HfWhRgnudRRwvuJ45ztYVtKulKw8QQpd2STWrcQQDJaRWmnMooX/PATTjCBExB
+9dkz38Druvk7IkHMtsIqlkAOQMdsX1d3Tov6BE2XDjIG0zFxLduJGbVwc/6rIc95
+T055j36Ez0HrjxdpTGOOHxRqMK5m9flFbaxxtDnS7w77WqzW7HjFrD0VeTx2vnjj
+GqchHEQpfDpFOzb8LTFhgYidyRNUflQY35WLOzLNV+pV3eQ3Jg11UFwelSNLqfQf
+uFRGc+zcwkNjHh5yPvm9odR1BIfqJ6sKGPGbtPNXo7ERMRypWyRz0zi0twARAQAB
+tChGZWRvcmEgRVBFTCAoNykgPGVwZWxAZmVkb3JhcHJvamVjdC5vcmc+iQI4BBMB
+AgAiBQJSrmiEAhsPBgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgAAKCRBqL66iNSxk
+5cfGD/4spqpsTjtDM7qpytKLHKruZtvuWiqt5RfvT9ww9GUUFMZ4ZZGX4nUXg49q
+ixDLayWR8ddG/s5kyOi3C0uX/6inzaYyRg+Bh70brqKUK14F1BrrPi29eaKfG+Gu
+MFtXdBG2a7OtPmw3yuKmq9Epv6B0mP6E5KSdvSRSqJWtGcA6wRS/wDzXJENHp5re
+9Ism3CYydpy0GLRA5wo4fPB5uLdUhLEUDvh2KK//fMjja3o0L+SNz8N0aDZyn5Ax
+CU9RB3EHcTecFgoy5umRj99BZrebR1NO+4gBrivIfdvD4fJNfNBHXwhSH9ACGCNv
+HnXVjHQF9iHWApKkRIeh8Fr2n5dtfJEF7SEX8GbX7FbsWo29kXMrVgNqHNyDnfAB
+VoPubgQdtJZJkVZAkaHrMu8AytwT62Q4eNqmJI1aWbZQNI5jWYqc6RKuCK6/F99q
+thFT9gJO17+yRuL6Uv2/vgzVR1RGdwVLKwlUjGPAjYflpCQwWMAASxiv9uPyYPHc
+ErSrbRG0wjIfAR3vus1OSOx3xZHZpXFfmQTsDP7zVROLzV98R3JwFAxJ4/xqeON4
+vCPFU6OsT3lWQ8w7il5ohY95wmujfr6lk89kEzJdOTzcn7DBbUru33CQMGKZ3Evt
+RjsC7FDbL017qxS+ZVA/HGkyfiu4cpgV8VUnbql5eAZ+1Ll6Dw==
+=hdPa
+-----END PGP PUBLIC KEY BLOCK-----
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/lib/facter/os_maj_version.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/lib/facter/os_maj_version.rb
new file mode 100644
index 00000000000..ba5cb84043e
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/lib/facter/os_maj_version.rb
@@ -0,0 +1,11 @@
+# This is a simple fact to get the Major version of an OS without having to
+# have the entire LSB suite installed. LSB seems to pull in about 300 megs of
+# stuff I often don't require. This fact is quick to load so it shouldn't be
+# much of an issue.
+
+Facter.add(:os_maj_version) do
+ setcode do
+ v = Facter.value(:operatingsystemrelease)
+ v.split('.')[0].strip
+ end
+end
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/manifests/init.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/manifests/init.pp
new file mode 100644
index 00000000000..f9f4be114a6
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/manifests/init.pp
@@ -0,0 +1,135 @@
+# Class epel
+#
+# Actions:
+# Configure the proper repositories and import GPG keys
+#
+# Reqiures:
+# You should probably be on an Enterprise Linux variant. (Centos, RHEL,
+# Scientific, Oracle, Ascendos, et al)
+#
+# Sample Usage:
+# include epel
+#
+class epel (
+ $epel_mirrorlist = $epel::params::epel_mirrorlist,
+ $epel_baseurl = $epel::params::epel_baseurl,
+ $epel_failovermethod = $epel::params::epel_failovermethod,
+ $epel_proxy = $epel::params::epel_proxy,
+ $epel_enabled = $epel::params::epel_enabled,
+ $epel_gpgcheck = $epel::params::epel_gpgcheck,
+ $epel_testing_baseurl = $epel::params::epel_testing_baseurl,
+ $epel_testing_failovermethod = $epel::params::epel_testing_failovermethod,
+ $epel_testing_proxy = $epel::params::epel_testing_proxy,
+ $epel_testing_enabled = $epel::params::epel_testing_enabled,
+ $epel_testing_gpgcheck = $epel::params::epel_testing_gpgcheck,
+ $epel_source_mirrorlist = $epel::params::epel_source_mirrorlist,
+ $epel_source_baseurl = $epel::params::epel_source_baseurl,
+ $epel_source_failovermethod = $epel::params::epel_source_failovermethod,
+ $epel_source_proxy = $epel::params::epel_source_proxy,
+ $epel_source_enabled = $epel::params::epel_source_enabled,
+ $epel_source_gpgcheck = $epel::params::epel_source_gpgcheck,
+ $epel_debuginfo_mirrorlist = $epel::params::epel_debuginfo_mirrorlist,
+ $epel_debuginfo_baseurl = $epel::params::epel_debuginfo_baseurl,
+ $epel_debuginfo_failovermethod = $epel::params::epel_debuginfo_failovermethod,
+ $epel_debuginfo_proxy = $epel::params::epel_debuginfo_proxy,
+ $epel_debuginfo_enabled = $epel::params::epel_debuginfo_enabled,
+ $epel_debuginfo_gpgcheck = $epel::params::epel_debuginfo_gpgcheck,
+ $epel_testing_source_baseurl = $epel::params::epel_testing_source_baseurl,
+ $epel_testing_source_failovermethod = $epel::params::epel_testing_source_failovermethod,
+ $epel_testing_source_proxy = $epel::params::epel_testing_source_proxy,
+ $epel_testing_source_enabled = $epel::params::epel_testing_source_enabled,
+ $epel_testing_source_gpgcheck = $epel::params::epel_testing_source_gpgcheck,
+ $epel_testing_debuginfo_baseurl = $epel::params::epel_testing_debuginfo_baseurl,
+ $epel_testing_debuginfo_failovermethod = $epel::params::epel_testing_debuginfo_failovermethod,
+ $epel_testing_debuginfo_proxy = $epel::params::epel_testing_debuginfo_proxy,
+ $epel_testing_debuginfo_enabled = $epel::params::epel_testing_debuginfo_enabled,
+ $epel_testing_debuginfo_gpgcheck = $epel::params::epel_testing_debuginfo_gpgcheck
+) inherits epel::params {
+
+ if $::osfamily == 'RedHat' and $::operatingsystem !~ /Fedora|Amazon/ {
+ yumrepo { 'epel-testing':
+ baseurl => $epel_testing_baseurl,
+ failovermethod => $epel_testing_failovermethod,
+ proxy => $epel_testing_proxy,
+ enabled => $epel_testing_enabled,
+ gpgcheck => $epel_testing_gpgcheck,
+ gpgkey => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-${::os_maj_version}",
+ descr => "Extra Packages for Enterprise Linux ${::os_maj_version} - Testing - \$basearch ",
+ }
+
+ yumrepo { 'epel-testing-debuginfo':
+ baseurl => $epel_testing_debuginfo_baseurl,
+ failovermethod => $epel_testing_debuginfo_failovermethod,
+ proxy => $epel_testing_debuginfo_proxy,
+ enabled => $epel_testing_debuginfo_enabled,
+ gpgcheck => $epel_testing_debuginfo_gpgcheck,
+ gpgkey => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-${::os_maj_version}",
+ descr => "Extra Packages for Enterprise Linux ${::os_maj_version} - Testing - \$basearch - Debug",
+ }
+
+ yumrepo { 'epel-testing-source':
+ baseurl => $epel_testing_source_baseurl,
+ failovermethod => $epel_testing_source_failovermethod,
+ proxy => $epel_testing_source_proxy,
+ enabled => $epel_testing_source_enabled,
+ gpgcheck => $epel_testing_source_gpgcheck,
+ gpgkey => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-${::os_maj_version}",
+ descr => "Extra Packages for Enterprise Linux ${::os_maj_version} - Testing - \$basearch - Source",
+ }
+
+ yumrepo { 'epel':
+ mirrorlist => $epel_mirrorlist,
+ baseurl => $epel_baseurl,
+ failovermethod => $epel_failovermethod,
+ proxy => $epel_proxy,
+ enabled => $epel_enabled,
+ gpgcheck => $epel_gpgcheck,
+ gpgkey => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-${::os_maj_version}",
+ descr => "Extra Packages for Enterprise Linux ${::os_maj_version} - \$basearch",
+ }
+
+ yumrepo { 'epel-debuginfo':
+ mirrorlist => $epel_debuginfo_mirrorlist,
+ baseurl => $epel_debuginfo_baseurl,
+ failovermethod => $epel_debuginfo_failovermethod,
+ proxy => $epel_debuginfo_proxy,
+ enabled => $epel_debuginfo_enabled,
+ gpgcheck => $epel_debuginfo_gpgcheck,
+ gpgkey => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-${::os_maj_version}",
+ descr => "Extra Packages for Enterprise Linux ${::os_maj_version} - \$basearch - Debug",
+ }
+
+ yumrepo { 'epel-source':
+ mirrorlist => $epel_source_mirrorlist,
+ baseurl => $epel_source_baseurl,
+ failovermethod => $epel_source_failovermethod,
+ proxy => $epel_source_proxy,
+ enabled => $epel_source_enabled,
+ gpgcheck => $epel_source_gpgcheck,
+ gpgkey => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-${::os_maj_version}",
+ descr => "Extra Packages for Enterprise Linux ${::os_maj_version} - \$basearch - Source",
+ }
+
+ file { "/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-${::os_maj_version}":
+ ensure => present,
+ owner => 'root',
+ group => 'root',
+ mode => '0644',
+ source => "puppet:///modules/epel/RPM-GPG-KEY-EPEL-${::os_maj_version}",
+ }
+
+ epel::rpm_gpg_key{ "EPEL-${::os_maj_version}":
+ path => "/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-${::os_maj_version}",
+ before => Yumrepo['epel','epel-source','epel-debuginfo','epel-testing','epel-testing-source','epel-testing-debuginfo'],
+ }
+
+ } elsif $::osfamily == 'RedHat' and $::operatingsystem == 'Amazon' {
+ yumrepo { 'epel':
+ enabled => $epel_enabled,
+ gpgcheck => $epel_gpgcheck,
+ }
+ } else {
+ notice ("Your operating system ${::operatingsystem} will not have the EPEL repository applied")
+ }
+
+}
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/manifests/params.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/manifests/params.pp
new file mode 100644
index 00000000000..0939de9045a
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/manifests/params.pp
@@ -0,0 +1,45 @@
+# Optional parameters in setting up EPEL
+class epel::params {
+ # Setting to 'absent' will fall back to the yum.conf
+ # Setting proxy here will be the default for all repos.
+ #
+ # If you wish to set a proxy for an individual set of repos,
+ # you can declare $proxy in that class, and should scope to
+ # the most specific declaration of proxy.
+ $proxy = 'absent'
+
+ $epel_mirrorlist = "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-${::os_maj_version}&arch=\$basearch"
+ $epel_baseurl = 'absent'
+ $epel_failovermethod = 'priority'
+ $epel_proxy = $proxy
+ $epel_enabled = '1'
+ $epel_gpgcheck = '1'
+ $epel_testing_baseurl = "http://download.fedoraproject.org/pub/epel/testing/${::os_maj_version}/\$basearch"
+ $epel_testing_failovermethod = 'priority'
+ $epel_testing_proxy = $proxy
+ $epel_testing_enabled = '0'
+ $epel_testing_gpgcheck = '1'
+ $epel_source_mirrorlist = "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-source-${::os_maj_version}&arch=\$basearch"
+ $epel_source_baseurl = 'absent'
+ $epel_source_failovermethod = 'priority'
+ $epel_source_proxy = $proxy
+ $epel_source_enabled = '0'
+ $epel_source_gpgcheck = '1'
+ $epel_debuginfo_mirrorlist = "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-debug-${::os_maj_version}&arch=\$basearch"
+ $epel_debuginfo_baseurl = 'absent'
+ $epel_debuginfo_failovermethod = 'priority'
+ $epel_debuginfo_proxy = $proxy
+ $epel_debuginfo_enabled = '0'
+ $epel_debuginfo_gpgcheck = '1'
+ $epel_testing_source_baseurl = "http://download.fedoraproject.org/pub/epel/testing/${::os_maj_version}/SRPMS"
+ $epel_testing_source_failovermethod = 'priority'
+ $epel_testing_source_proxy = $proxy
+ $epel_testing_source_enabled = '0'
+ $epel_testing_source_gpgcheck = '1'
+ $epel_testing_debuginfo_baseurl = "http://download.fedoraproject.org/pub/epel/testing/${::os_maj_version}/\$basearch/debug"
+ $epel_testing_debuginfo_failovermethod = 'priority'
+ $epel_testing_debuginfo_proxy = $proxy
+ $epel_testing_debuginfo_enabled = '0'
+ $epel_testing_debuginfo_gpgcheck = '1'
+
+}
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/manifests/rpm_gpg_key.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/manifests/rpm_gpg_key.pp
new file mode 100644
index 00000000000..ee0604dbbf9
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/manifests/rpm_gpg_key.pp
@@ -0,0 +1,28 @@
+# Define epel::rpm_gpg_key
+#
+# Actions:
+# Import a RPM gpg key
+#
+# Parameters:
+#
+# [*path*]
+# Path of the RPM GPG key to import
+#
+# Reqiures:
+# You should probably be on an Enterprise Linux variant. (Centos, RHEL, Scientific, Oracle, Ascendos, et al)
+#
+# Sample Usage:
+# epel::rpm_gpg_key{ "EPEL-6":
+# path => "/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6"
+# }
+#
+define epel::rpm_gpg_key($path) {
+ # Given the path to a key, see if it is imported, if not, import it
+ exec { "import-${name}":
+ path => '/bin:/usr/bin:/sbin:/usr/sbin',
+ command => "rpm --import ${path}",
+ unless => "rpm -q gpg-pubkey-$(echo $(gpg --throw-keyids < ${path}) | cut --characters=11-18 | tr '[A-Z]' '[a-z]')",
+ require => File[$path],
+ logoutput => 'on_failure',
+ }
+}
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/metadata.json b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/metadata.json
new file mode 100644
index 00000000000..ba8770e8b69
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/metadata.json
@@ -0,0 +1,45 @@
+{
+ "name": "stahnma-epel",
+ "version": "0.1.0",
+ "source": "http://github.com/stahnma/puppet-module-epel",
+ "author": "stahnma",
+ "license": "Apache License, Version 2.0",
+ "summary": "Setup the EPEL package repo",
+ "description": "Setup the EPEL package repo on Centos/RHEL et all",
+ "project_page": "http://github.com/stahnma/puppet-module-epel",
+ "dependencies": [
+
+ ],
+ "types": [
+
+ ],
+ "checksums": {
+ "Gemfile": "3189476f30a99858b367d955298fe469",
+ "LICENSE": "94f0b1430ad7e59227ccabf8232f81d5",
+ "Modulefile": "250a4370b189d3f2e68ffd359ee02bb5",
+ "README.md": "6b4c4d2e7f0f9c1b6197529fa1120c88",
+ "Rakefile": "946eced163d7f8e0da85bda4baa7fa9c",
+ "files/RPM-GPG-KEY-EPEL-5": "0466c259781def56dafe0a2cdc9de0c5",
+ "files/RPM-GPG-KEY-EPEL-6": "d865e6b948a74cb03bc3401c0b01b785",
+ "files/RPM-GPG-KEY-EPEL-7": "58fa8ae27c89f37b08429f04fd4a88cc",
+ "lib/facter/os_maj_version.rb": "806fb856251b605df379e973c716a41c",
+ "manifests/init.pp": "61856de8db1eb00700e0a9a93aea506f",
+ "manifests/params.pp": "4fb2e283b4ba6e41abd7a914bdd001b8",
+ "manifests/rpm_gpg_key.pp": "69086f12752a14b200e462afaa59a93c",
+ "spec/classes/epel_spec.rb": "7e8e5973fdccb866e91ed00a3fd0af4c",
+ "spec/classes/shared_base.rb": "a6a46eb7225a1814b9343f32190ba75b",
+ "spec/classes/shared_debuginfo.rb": "1bd23934bc1f7d14d2491c7741f10299",
+ "spec/classes/shared_gpgkey.rb": "38a62fe24acfc9cc8d740d242c9f1c85",
+ "spec/classes/shared_source.rb": "6581989ed1ca2edd589ed98ecb08bdfa",
+ "spec/classes/shared_testing.rb": "50e936b9cf241c9849cf551961492532",
+ "spec/classes/shared_testing_debuginfo.rb": "41e8a2215d347246ff241f1b3a819c91",
+ "spec/classes/shared_testing_source.rb": "8cd827b2cb0b08b1633d70784417f946",
+ "spec/defines/rpm_gpg_key_spec.rb": "489fa716eaa2aba013089a6cf552c5a6",
+ "spec/spec_helper.rb": "a5ad64bd67aa3fe2512fa7ba505c8e8b",
+ "spec/spec_helper_system.rb": "d24a7ffdf4b67dbbd3ef5687292f51cf",
+ "spec/system/basic_spec.rb": "bc475b95f390134b31d905590bf8b039",
+ "spec/system/usage_spec.rb": "04506df5627ecbe975acd1fd0407ae40",
+ "spec/unit/facter/os_maj_version_spec.rb": "67ab2730991d4a8430f1115aad46bcea",
+ "tests/init.pp": "7c69b7adf2ba141cb62cfc9e0704d59e"
+ }
+}
\ No newline at end of file
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/classes/epel_spec.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/classes/epel_spec.rb
new file mode 100644
index 00000000000..5d95a61a5f7
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/classes/epel_spec.rb
@@ -0,0 +1,80 @@
+require 'spec_helper'
+require 'classes/shared_gpgkey'
+require 'classes/shared_base'
+require 'classes/shared_source'
+require 'classes/shared_debuginfo'
+require 'classes/shared_testing'
+require 'classes/shared_testing_source'
+require 'classes/shared_testing_debuginfo'
+
+describe 'epel' do
+ it { should create_class('epel') }
+ it { should contain_class('epel::params') }
+
+ context "operatingsystem => #{default_facts[:operatingsystem]}" do
+ context 'os_maj_version => 6' do
+ include_context :base_6
+ include_context :gpgkey_6
+ include_context :epel_source_6
+ include_context :epel_debuginfo_6
+ include_context :epel_testing_6
+ include_context :epel_testing_source_6
+ include_context :epel_testing_debuginfo_6
+
+ let :facts do
+ default_facts.merge({
+ :operatingsystemrelease => '6.4',
+ :os_maj_version => '6',
+ })
+ end
+
+ context 'epel_baseurl => http://example.com/epel/6/x86_64' do
+ let(:params) {{ :epel_baseurl => "http://example.com/epel/6/x86_64" }}
+ it { should contain_yumrepo('epel').with('baseurl' => 'http://example.com/epel/6/x86_64') }
+ end
+
+ context 'epel_mirrorlist => absent' do
+ let(:params) {{ :epel_mirrorlist => 'absent' }}
+ it { should contain_yumrepo('epel').with('mirrorlist' => 'absent') }
+ end
+ end
+
+ context 'os_maj_version => 5' do
+ include_context :base_5
+ include_context :gpgkey_5
+ include_context :epel_source_5
+ include_context :epel_debuginfo_5
+ include_context :epel_testing_5
+ include_context :epel_testing_source_5
+ include_context :epel_testing_debuginfo_5
+
+ let :facts do
+ default_facts.merge({
+ :operatingsystemrelease => '5.9',
+ :os_maj_version => '5',
+ })
+ end
+ end
+ end
+
+ context 'operatingsystem => Amazon' do
+ let :facts do
+ default_facts.merge({
+ :operatingsystem => 'Amazon',
+ })
+ end
+
+ it { should_not contain_yumrepo('epel-testing') }
+ it { should_not contain_yumrepo('epel-testing-debuginfo') }
+ it { should_not contain_yumrepo('epel-testing-source') }
+ it { should_not contain_yumrepo('epel-debuginfo') }
+ it { should_not contain_yumrepo('epel-source') }
+
+ it do
+ should contain_yumrepo('epel').with({
+ 'enabled' => '1',
+ 'gpgcheck' => '1',
+ })
+ end
+ end
+end
\ No newline at end of file
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/classes/shared_base.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/classes/shared_base.rb
new file mode 100644
index 00000000000..89b3c58cca7
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/classes/shared_base.rb
@@ -0,0 +1,36 @@
+require 'spec_helper'
+
+shared_context :base do
+ it do
+ should contain_yumrepo('epel').with({
+ 'failovermethod' => 'priority',
+ 'proxy' => 'absent',
+ 'enabled' => '1',
+ 'gpgcheck' => '1',
+ })
+ end
+end
+
+shared_context :base_6 do
+ include_context :base
+
+ it do
+ should contain_yumrepo('epel').with({
+ 'mirrorlist' => "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-6&arch=$basearch",
+ 'gpgkey' => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6",
+ 'descr' => "Extra Packages for Enterprise Linux 6 - $basearch",
+ })
+ end
+end
+
+shared_context :base_5 do
+ include_context :base
+
+ it do
+ should contain_yumrepo('epel').with({
+ 'mirrorlist' => "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=$basearch",
+ 'gpgkey' => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-5",
+ 'descr' => "Extra Packages for Enterprise Linux 5 - $basearch",
+ })
+ end
+end
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/classes/shared_debuginfo.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/classes/shared_debuginfo.rb
new file mode 100644
index 00000000000..d47934d1425
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/classes/shared_debuginfo.rb
@@ -0,0 +1,36 @@
+require 'spec_helper'
+
+shared_context :epel_debuginfo do
+ it do
+ should contain_yumrepo('epel-debuginfo').with({
+ 'proxy' => 'absent',
+ 'failovermethod' => 'priority',
+ 'enabled' => '0',
+ 'gpgcheck' => '1',
+ })
+ end
+end
+
+shared_context :epel_debuginfo_6 do
+ include_context :epel_debuginfo
+
+ it do
+ should contain_yumrepo('epel-debuginfo').with({
+ 'mirrorlist' => "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-debug-6&arch=$basearch",
+ 'gpgkey' => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6",
+ 'descr' => "Extra Packages for Enterprise Linux 6 - $basearch - Debug",
+ })
+ end
+end
+
+shared_context :epel_debuginfo_5 do
+ include_context :epel_debuginfo
+
+ it do
+ should contain_yumrepo('epel-debuginfo').with({
+ 'mirrorlist' => "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-debug-5&arch=$basearch",
+ 'gpgkey' => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-5",
+ 'descr' => "Extra Packages for Enterprise Linux 5 - $basearch - Debug",
+ })
+ end
+end
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/classes/shared_gpgkey.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/classes/shared_gpgkey.rb
new file mode 100644
index 00000000000..8b79c8cdd7f
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/classes/shared_gpgkey.rb
@@ -0,0 +1,37 @@
+require 'spec_helper'
+
+shared_context :gpgkey_6 do
+ it do
+ should contain_file("/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6").with({
+ 'ensure' => 'present',
+ 'owner' => 'root',
+ 'group' => 'root',
+ 'mode' => '0644',
+ 'source' => "puppet:///modules/epel/RPM-GPG-KEY-EPEL-6",
+ })
+ end
+
+ it do
+ should contain_epel__rpm_gpg_key("EPEL-6").with({
+ 'path' => "/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6"
+ })
+ end
+end
+
+shared_context :gpgkey_5 do
+ it do
+ should contain_file("/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-5").with({
+ 'ensure' => 'present',
+ 'owner' => 'root',
+ 'group' => 'root',
+ 'mode' => '0644',
+ 'source' => "puppet:///modules/epel/RPM-GPG-KEY-EPEL-5",
+ })
+ end
+
+ it do
+ should contain_epel__rpm_gpg_key("EPEL-5").with({
+ 'path' => "/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-5"
+ })
+ end
+end
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/classes/shared_source.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/classes/shared_source.rb
new file mode 100644
index 00000000000..c371465ba91
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/classes/shared_source.rb
@@ -0,0 +1,36 @@
+require 'spec_helper'
+
+shared_context :epel_source do
+ it do
+ should contain_yumrepo('epel-source').with({
+ 'proxy' => 'absent',
+ 'failovermethod' => 'priority',
+ 'enabled' => '0',
+ 'gpgcheck' => '1',
+ })
+ end
+end
+
+shared_context :epel_source_6 do
+ include_context :epel_source
+
+ it do
+ should contain_yumrepo('epel-source').with({
+ 'mirrorlist' => "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-source-6&arch=$basearch",
+ 'gpgkey' => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6",
+ 'descr' => "Extra Packages for Enterprise Linux 6 - $basearch - Source",
+ })
+ end
+end
+
+shared_context :epel_source_5 do
+ include_context :epel_source
+
+ it do
+ should contain_yumrepo('epel-source').with({
+ 'mirrorlist' => "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-source-5&arch=$basearch",
+ 'gpgkey' => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-5",
+ 'descr' => "Extra Packages for Enterprise Linux 5 - $basearch - Source",
+ })
+ end
+end
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/classes/shared_testing.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/classes/shared_testing.rb
new file mode 100644
index 00000000000..d560edb6e0a
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/classes/shared_testing.rb
@@ -0,0 +1,36 @@
+require 'spec_helper'
+
+shared_context :epel_testing do
+ it do
+ should contain_yumrepo('epel-testing').with({
+ 'failovermethod' => 'priority',
+ 'proxy' => 'absent',
+ 'enabled' => '0',
+ 'gpgcheck' => '1',
+ })
+ end
+end
+
+shared_context :epel_testing_6 do
+ include_context :epel_testing
+
+ it do
+ should contain_yumrepo('epel-testing').with({
+ 'baseurl' => "http://download.fedoraproject.org/pub/epel/testing/6/$basearch",
+ 'gpgkey' => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6",
+ 'descr' => "Extra Packages for Enterprise Linux 6 - Testing - $basearch ",
+ })
+ end
+end
+
+shared_context :epel_testing_5 do
+ include_context :epel_testing
+
+ it do
+ should contain_yumrepo('epel-testing').with({
+ 'baseurl' => "http://download.fedoraproject.org/pub/epel/testing/5/$basearch",
+ 'gpgkey' => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-5",
+ 'descr' => "Extra Packages for Enterprise Linux 5 - Testing - $basearch ",
+ })
+ end
+end
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/classes/shared_testing_debuginfo.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/classes/shared_testing_debuginfo.rb
new file mode 100644
index 00000000000..62f647d3790
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/classes/shared_testing_debuginfo.rb
@@ -0,0 +1,36 @@
+require 'spec_helper'
+
+shared_context :epel_testing_debuginfo do
+ it do
+ should contain_yumrepo('epel-testing-debuginfo').with({
+ 'failovermethod' => 'priority',
+ 'proxy' => 'absent',
+ 'enabled' => '0',
+ 'gpgcheck' => '1',
+ })
+ end
+end
+
+shared_context :epel_testing_debuginfo_6 do
+ include_context :epel_testing_debuginfo
+
+ it do
+ should contain_yumrepo('epel-testing-debuginfo').with({
+ 'baseurl' => "http://download.fedoraproject.org/pub/epel/testing/6/$basearch/debug",
+ 'gpgkey' => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6",
+ 'descr' => "Extra Packages for Enterprise Linux 6 - Testing - $basearch - Debug",
+ })
+ end
+end
+
+shared_context :epel_testing_debuginfo_5 do
+ include_context :epel_testing_debuginfo
+
+ it do
+ should contain_yumrepo('epel-testing-debuginfo').with({
+ 'baseurl' => "http://download.fedoraproject.org/pub/epel/testing/5/$basearch/debug",
+ 'gpgkey' => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-5",
+ 'descr' => "Extra Packages for Enterprise Linux 5 - Testing - $basearch - Debug",
+ })
+ end
+end
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/classes/shared_testing_source.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/classes/shared_testing_source.rb
new file mode 100644
index 00000000000..1a7e0a6ae83
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/classes/shared_testing_source.rb
@@ -0,0 +1,36 @@
+require 'spec_helper'
+
+shared_context :epel_testing_source do
+ it do
+ should contain_yumrepo('epel-testing-source').with({
+ 'failovermethod' => 'priority',
+ 'proxy' => 'absent',
+ 'enabled' => '0',
+ 'gpgcheck' => '1',
+ })
+ end
+end
+
+shared_context :epel_testing_source_6 do
+ include_context :epel_testing_source
+
+ it do
+ should contain_yumrepo('epel-testing-source').with({
+ 'baseurl' => "http://download.fedoraproject.org/pub/epel/testing/6/SRPMS",
+ 'gpgkey' => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6",
+ 'descr' => "Extra Packages for Enterprise Linux 6 - Testing - $basearch - Source",
+ })
+ end
+end
+
+shared_context :epel_testing_source_5 do
+ include_context :epel_testing_source
+
+ it do
+ should contain_yumrepo('epel-testing-source').with({
+ 'baseurl' => "http://download.fedoraproject.org/pub/epel/testing/5/SRPMS",
+ 'gpgkey' => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-5",
+ 'descr' => "Extra Packages for Enterprise Linux 5 - Testing - $basearch - Source",
+ })
+ end
+end
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/defines/rpm_gpg_key_spec.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/defines/rpm_gpg_key_spec.rb
new file mode 100644
index 00000000000..63cfe08ff94
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/defines/rpm_gpg_key_spec.rb
@@ -0,0 +1,57 @@
+require 'spec_helper'
+
+describe 'epel::rpm_gpg_key' do
+ context 'os_maj_version => 6' do
+ let :facts do
+ default_facts.merge({
+ :operatingsystemrelease => '6.4',
+ :os_maj_version => '6',
+ })
+ end
+
+ let :title do
+ 'EPEL-6'
+ end
+
+ let :params do
+ { :path => "/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6" }
+ end
+
+ it do
+ should contain_exec("import-#{title}").with({
+ 'path' => '/bin:/usr/bin:/sbin:/usr/sbin',
+ 'command' => "rpm --import #{params[:path]}",
+ 'unless' => "rpm -q gpg-pubkey-$(echo $(gpg --throw-keyids < #{params[:path]}) | cut --characters=11-18 | tr '[A-Z]' '[a-z]')",
+ 'require' => "File[#{params[:path]}]",
+ 'logoutput' => 'on_failure',
+ })
+ end
+ end
+
+ context 'os_maj_version => 5' do
+ let :facts do
+ default_facts.merge({
+ :operatingsystemrelease => '5.9',
+ :os_maj_version => '5',
+ })
+ end
+
+ let :title do
+ 'EPEL-5'
+ end
+
+ let :params do
+ { :path => "/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-5" }
+ end
+
+ it do
+ should contain_exec("import-#{title}").with({
+ 'path' => '/bin:/usr/bin:/sbin:/usr/sbin',
+ 'command' => "rpm --import #{params[:path]}",
+ 'unless' => "rpm -q gpg-pubkey-$(echo $(gpg --throw-keyids < #{params[:path]}) | cut --characters=11-18 | tr '[A-Z]' '[a-z]')",
+ 'require' => "File[#{params[:path]}]",
+ 'logoutput' => 'on_failure',
+ })
+ end
+ end
+end
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/spec_helper.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/spec_helper.rb
new file mode 100644
index 00000000000..eafe6b60012
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/spec_helper.rb
@@ -0,0 +1,8 @@
+require 'puppetlabs_spec_helper/module_spec_helper'
+
+def default_facts
+ {
+ :osfamily => 'RedHat',
+ :operatingsystem => 'CentOS',
+ }
+end
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/spec_helper_system.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/spec_helper_system.rb
similarity index 69%
rename from dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/spec_helper_system.rb
rename to dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/spec_helper_system.rb
index a790d7d526c..cf680367b94 100644
--- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/spec_helper_system.rb
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/spec_helper_system.rb
@@ -4,22 +4,20 @@ require 'rspec-system-puppet/helpers'
include RSpecSystemPuppet::Helpers
RSpec.configure do |c|
- # Project root
+ # Project root for the this module's code
proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
- # Enable colour
+ # Enable colour in Jenkins
c.tty = true
+ c.include RSpecSystemPuppet::Helpers
+
# This is where we 'setup' the nodes before running our tests
c.before :suite do
# Install puppet
puppet_install
puppet_master_install
- # Replace mymodule with your module name
- puppet_module_install(:source => proj_root, :module_name => 'supervisord')
- shell('puppet module install puppetlabs/stdlib')
- shell('puppet module install puppetlabs/concat')
-
+ puppet_module_install(:source => proj_root, :module_name => 'epel')
end
end
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/system/basic_spec.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/system/basic_spec.rb
new file mode 100644
index 00000000000..569e12d3737
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/system/basic_spec.rb
@@ -0,0 +1,36 @@
+require 'spec_helper_system'
+
+describe 'epel class:' do
+ context puppet_agent do
+ its(:stderr) { should be_empty }
+ its(:exit_code) { should_not == 1 }
+ end
+
+ # Verify the os_maj_version fact is working
+ context shell 'facter --puppet os_maj_version' do
+ its(:stdout) { should_not be_empty }
+ its(:stderr) { should be_empty }
+ its(:exit_code) { should be_zero }
+ end
+
+ pp = "class { 'epel': }"
+
+ context puppet_apply pp do
+ its(:stderr) { should be_empty }
+ its(:exit_code) { should_not == 1 }
+ its(:refresh) { should be_nil }
+ its(:stderr) { should be_empty }
+ its(:exit_code) { should be_zero }
+ end
+
+ context 'test EPEL repo presence' do
+ facts = node.facts
+
+ # Only test for EPEL's presence if not Fedora
+ if facts['operatingsystem'] !~ /Fedora/
+ context shell '/usr/bin/yum-config-manager epel | grep -q "\[epel\]"' do
+ its(:exit_code) { should be_zero }
+ end
+ end
+ end
+end
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/system/usage_spec.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/system/usage_spec.rb
new file mode 100644
index 00000000000..2b0d8f36e28
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/system/usage_spec.rb
@@ -0,0 +1,60 @@
+require 'spec_helper_system'
+
+describe 'standage usage tests:' do
+ context 'test epel baseurl and mirrorlist' do
+ facts = node.facts
+ os_maj_version = facts['operatingsystemrelease'].split('.')[0]
+ pp = <<-EOS
+ class { 'epel':
+ epel_baseurl => 'http://dl.fedoraproject.org/pub/epel/#{os_maj_version}/x86_64/',
+ epel_mirrorlist => 'absent',
+ }
+ EOS
+
+ context puppet_apply pp do
+ its(:stderr) { should be_empty }
+ its(:exit_code) { should_not == 1 }
+ its(:refresh) { should be_nil }
+ its(:stderr) { should be_empty }
+ its(:exit_code) { should be_zero }
+ end
+
+ # Only test for EPEL's presence if not Fedora
+ if facts['operatingsystem'] !~ /Fedora/
+ # Test the yum config to ensure mirrorlist was emptied
+ context shell '/usr/bin/yum-config-manager epel | egrep "^mirrorlist ="' do
+ its(:stdout) { should =~ /mirrorlist =\s+/ }
+ end
+
+ # Test the yum config to ensure baseurl was defined
+ context shell '/usr/bin/yum-config-manager epel | egrep "^baseurl ="' do
+ its(:stdout) { should =~ /baseurl = http:\/\/dl.fedoraproject.org\/pub\/epel\/#{os_maj_version}\/x86_64\// }
+ end
+ end
+ end
+
+ context 'test epel-testing is enabled' do
+ facts = node.facts
+ pp = <<-EOS
+ class { 'epel':
+ epel_testing_enabled => '1',
+ }
+ EOS
+
+ context puppet_apply pp do
+ its(:stderr) { should be_empty }
+ its(:exit_code) { should_not == 1 }
+ its(:refresh) { should be_nil }
+ its(:stderr) { should be_empty }
+ its(:exit_code) { should be_zero }
+ end
+
+ # Only test for EPEL's presence if not Fedora
+ if facts['operatingsystem'] !~ /Fedora/
+ # Test the yum config to ensure epel-testing was enabled
+ context shell '/usr/bin/yum-config-manager epel-testing | grep -q "enabled = True"' do
+ its(:exit_code) { should be_zero }
+ end
+ end
+ end
+end
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/unit/facter/os_maj_version_spec.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/unit/facter/os_maj_version_spec.rb
new file mode 100644
index 00000000000..83bcdffd2c9
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/unit/facter/os_maj_version_spec.rb
@@ -0,0 +1,21 @@
+require 'spec_helper'
+
+describe 'os_maj_version fact' do
+ before :each do
+ Facter.clear
+ end
+
+ context "on 5.9 operatingsystemrelease" do
+ it "should have os_maj_version => 5" do
+ Facter.fact(:operatingsystemrelease).stubs(:value).returns("5.9")
+ Facter.fact(:os_maj_version).value.should == "5"
+ end
+ end
+
+ context "on 6.4 operatingsystemrelease" do
+ it "should have os_maj_version => 6" do
+ Facter.fact(:operatingsystemrelease).stubs(:value).returns("6.4")
+ Facter.fact(:os_maj_version).value.should == "6"
+ end
+ end
+end
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/tests/init.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/tests/init.pp
new file mode 100644
index 00000000000..c2e61d42989
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/tests/init.pp
@@ -0,0 +1,3 @@
+# And by test, I mean, run this thing for me using Puppet apply and I'll check
+# it out.
+include 'epel'
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/.fixtures.yml b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/.fixtures.yml
new file mode 100644
index 00000000000..8968df1f459
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/.fixtures.yml
@@ -0,0 +1,7 @@
+fixtures:
+ repositories:
+ apt: git://github.com/puppetlabs/puppetlabs-apt.git
+ stdlib: git://github.com/puppetlabs/puppetlabs-stdlib.git
+ epel: git://github.com/stahnma/puppet-module-epel.git
+ symlinks:
+ erlang: "#{source_dir}"
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/.nodeset.yml b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/.nodeset.yml
new file mode 100644
index 00000000000..cbd0d57b83d
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/.nodeset.yml
@@ -0,0 +1,35 @@
+---
+default_set: 'centos-64-x64'
+sets:
+ 'centos-59-x64':
+ nodes:
+ "main.foo.vm":
+ prefab: 'centos-59-x64'
+ 'centos-64-x64':
+ nodes:
+ "main.foo.vm":
+ prefab: 'centos-64-x64'
+ 'fedora-18-x64':
+ nodes:
+ "main.foo.vm":
+ prefab: 'fedora-18-x64'
+ 'debian-607-x64':
+ nodes:
+ "main.foo.vm":
+ prefab: 'debian-607-x64'
+ 'debian-70rc1-x64':
+ nodes:
+ "main.foo.vm":
+ prefab: 'debian-70rc1-x64'
+ 'ubuntu-server-10044-x64':
+ nodes:
+ "main.foo.vm":
+ prefab: 'ubuntu-server-10044-x64'
+ 'ubuntu-server-12042-x64':
+ nodes:
+ "main.foo.vm":
+ prefab: 'ubuntu-server-12042-x64'
+ 'sles-11sp1-x64':
+ nodes:
+ "main.foo.vm":
+ prefab: 'sles-11sp1-x64'
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/.rspec b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/.rspec
new file mode 100644
index 00000000000..49d5710b3ef
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/.rspec
@@ -0,0 +1 @@
+--format documentation
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/.travis.yml b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/.travis.yml
new file mode 100644
index 00000000000..cd412bfd344
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/.travis.yml
@@ -0,0 +1,23 @@
+---
+language: ruby
+bundler_args: --without development
+before_install: rm Gemfile.lock || true
+rvm:
+ - 1.8.7
+ - 1.9.3
+ - 2.0.0
+script: bundle exec rake test
+env:
+ - PUPPET_VERSION="~> 2.7.0"
+ - PUPPET_VERSION="~> 3.1.0"
+ - PUPPET_VERSION="~> 3.2.0"
+ - PUPPET_VERSION="~> 3.3.0"
+ - PUPPET_VERSION="~> 3.4.0"
+matrix:
+ exclude:
+ - rvm: 2.0.0
+ env: PUPPET_VERSION="~> 2.7.0"
+ - rvm: 2.0.0
+ env: PUPPET_VERSION="~> 3.1.0"
+ - rvm: 1.9.3
+ env: PUPPET_VERSION="~> 2.7.0"
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/Gemfile b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/Gemfile
new file mode 100644
index 00000000000..39ba7f9f63a
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/Gemfile
@@ -0,0 +1,15 @@
+source "http://rubygems.org"
+
+
+gem "rake"
+gem "puppet", ENV['PUPPET_VERSION'] || '~> 3.2.0'
+gem "puppet-lint"
+gem "rspec-puppet", '~> 1.0.0'
+gem "puppetlabs_spec_helper"
+gem "rspec-system-puppet"
+gem "vagrant-wrapper"
+gem "puppet-syntax"
+
+group :development do
+ gem "puppet-blacksmith"
+end
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/Gemfile.lock b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/Gemfile.lock
new file mode 100644
index 00000000000..d719aa97918
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/Gemfile.lock
@@ -0,0 +1,94 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ builder (3.2.2)
+ diff-lcs (1.2.5)
+ excon (0.31.0)
+ facter (1.7.5)
+ fog (1.20.0)
+ builder
+ excon (~> 0.31.0)
+ formatador (~> 0.2.0)
+ mime-types
+ multi_json (~> 1.0)
+ net-scp (~> 1.1)
+ net-ssh (>= 2.1.3)
+ nokogiri (>= 1.5.11)
+ formatador (0.2.4)
+ hiera (1.3.2)
+ json_pure
+ json_pure (1.8.1)
+ kwalify (0.7.2)
+ metaclass (0.0.4)
+ mime-types (1.25.1)
+ mocha (1.0.0)
+ metaclass (~> 0.0.1)
+ multi_json (1.8.4)
+ net-scp (1.1.2)
+ net-ssh (>= 2.6.5)
+ net-ssh (2.8.0)
+ nokogiri (1.5.11)
+ puppet (3.2.4)
+ facter (~> 1.6)
+ hiera (~> 1.0)
+ rgen (~> 0.6.5)
+ puppet-blacksmith (2.0.2)
+ nokogiri
+ puppet (>= 2.7.16)
+ rest-client
+ puppet-lint (0.3.2)
+ puppet-syntax (1.1.0)
+ puppet (>= 2.7.0)
+ rake
+ puppetlabs_spec_helper (0.4.1)
+ mocha (>= 0.10.5)
+ rake
+ rspec (>= 2.9.0)
+ rspec-puppet (>= 0.1.1)
+ rake (10.1.1)
+ rbvmomi (1.8.1)
+ builder
+ nokogiri (>= 1.4.1)
+ trollop
+ rest-client (1.6.7)
+ mime-types (>= 1.16)
+ rgen (0.6.6)
+ rspec (2.14.1)
+ rspec-core (~> 2.14.0)
+ rspec-expectations (~> 2.14.0)
+ rspec-mocks (~> 2.14.0)
+ rspec-core (2.14.8)
+ rspec-expectations (2.14.5)
+ diff-lcs (>= 1.1.3, < 2.0)
+ rspec-mocks (2.14.6)
+ rspec-puppet (1.0.1)
+ rspec
+ rspec-system (2.8.0)
+ fog (~> 1.18)
+ kwalify (~> 0.7.2)
+ mime-types (~> 1.16)
+ net-scp (~> 1.1)
+ net-ssh (~> 2.7)
+ nokogiri (~> 1.5.10)
+ rbvmomi (~> 1.6)
+ rspec (~> 2.14)
+ systemu (~> 2.5)
+ rspec-system-puppet (2.2.1)
+ rspec-system (~> 2.0)
+ systemu (2.6.3)
+ trollop (2.0)
+ vagrant-wrapper (1.2.1.1)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ puppet (~> 3.2.0)
+ puppet-blacksmith
+ puppet-lint
+ puppet-syntax
+ puppetlabs_spec_helper
+ rake
+ rspec-puppet (~> 1.0.0)
+ rspec-system-puppet
+ vagrant-wrapper
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/LICENSE b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/LICENSE
new file mode 100644
index 00000000000..bf023233a1f
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/LICENSE
@@ -0,0 +1,207 @@
+Apache License
+Version 2.0, January 2004
+http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction, and
+ distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by the
+ copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all other
+ entities that control, are controlled by, or are under common control with
+ that entity. For the purposes of this definition, "control" means (i) the
+ power, direct or indirect, to cause the direction or management of such
+ entity, whether by contract or otherwise, or (ii) ownership of
+ fifty percent (50%) or more of the outstanding shares, or (iii) beneficial
+ ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity exercising
+ permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation source,
+ and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical transformation
+ or translation of a Source form, including but not limited to compiled
+ object code, generated documentation, and conversions to
+ other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or Object
+ form, made available under the License, as indicated by a copyright notice
+ that is included in or attached to the work (an example is provided in the
+ Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object form,
+ that is based on (or derived from) the Work and for which the editorial
+ revisions, annotations, elaborations, or other modifications represent,
+ as a whole, an original work of authorship. For the purposes of this
+ License, Derivative Works shall not include works that remain separable
+ from, or merely link (or bind by name) to the interfaces of, the Work and
+ Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including the original
+ version of the Work and any modifications or additions to that Work or
+ Derivative Works thereof, that is intentionally submitted to Licensor for
+ inclusion in the Work by the copyright owner or by an individual or
+ Legal Entity authorized to submit on behalf of the copyright owner.
+ For the purposes of this definition, "submitted" means any form of
+ electronic, verbal, or written communication sent to the Licensor or its
+ representatives, including but not limited to communication on electronic
+ mailing lists, source code control systems, and issue tracking systems
+ that are managed by, or on behalf of, the Licensor for the purpose of
+ discussing and improving the Work, but excluding communication that is
+ conspicuously marked or otherwise designated in writing by the copyright
+ owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity on
+ behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+2. Grant of Copyright License.
+
+ Subject to the terms and conditions of this License, each Contributor
+ hereby grants to You a perpetual, worldwide, non-exclusive, no-charge,
+ royalty-free, irrevocable copyright license to reproduce, prepare
+ Derivative Works of, publicly display, publicly perform, sublicense,
+ and distribute the Work and such Derivative Works in
+ Source or Object form.
+
+3. Grant of Patent License.
+
+ Subject to the terms and conditions of this License, each Contributor
+ hereby grants to You a perpetual, worldwide, non-exclusive, no-charge,
+ royalty-free, irrevocable (except as stated in this section) patent
+ license to make, have made, use, offer to sell, sell, import, and
+ otherwise transfer the Work, where such license applies only to those
+ patent claims licensable by such Contributor that are necessarily
+ infringed by their Contribution(s) alone or by combination of their
+ Contribution(s) with the Work to which such Contribution(s) was submitted.
+ If You institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work or a
+ Contribution incorporated within the Work constitutes direct or
+ contributory patent infringement, then any patent licenses granted to
+ You under this License for that Work shall terminate as of the date such
+ litigation is filed.
+
+4. Redistribution.
+
+ You may reproduce and distribute copies of the Work or Derivative Works
+ thereof in any medium, with or without modifications, and in Source or
+ Object form, provided that You meet the following conditions:
+
+ 1. You must give any other recipients of the Work or Derivative Works a
+ copy of this License; and
+
+ 2. You must cause any modified files to carry prominent notices stating
+ that You changed the files; and
+
+ 3. You must retain, in the Source form of any Derivative Works that You
+ distribute, all copyright, patent, trademark, and attribution notices from
+ the Source form of the Work, excluding those notices that do not pertain
+ to any part of the Derivative Works; and
+
+ 4. If the Work includes a "NOTICE" text file as part of its distribution,
+ then any Derivative Works that You distribute must include a readable copy
+ of the attribution notices contained within such NOTICE file, excluding
+ those notices that do not pertain to any part of the Derivative Works,
+ in at least one of the following places: within a NOTICE text file
+ distributed as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or, within a
+ display generated by the Derivative Works, if and wherever such
+ third-party notices normally appear. The contents of the NOTICE file are
+ for informational purposes only and do not modify the License.
+ You may add Your own attribution notices within Derivative Works that You
+ distribute, alongside or as an addendum to the NOTICE text from the Work,
+ provided that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and may
+ provide additional or different license terms and conditions for use,
+ reproduction, or distribution of Your modifications, or for any such
+ Derivative Works as a whole, provided Your use, reproduction, and
+ distribution of the Work otherwise complies with the conditions
+ stated in this License.
+
+5. Submission of Contributions.
+
+ Unless You explicitly state otherwise, any Contribution intentionally
+ submitted for inclusion in the Work by You to the Licensor shall be under
+ the terms and conditions of this License, without any additional
+ terms or conditions. Notwithstanding the above, nothing herein shall
+ supersede or modify the terms of any separate license agreement you may
+ have executed with Licensor regarding such Contributions.
+
+6. Trademarks.
+
+ This License does not grant permission to use the trade names, trademarks,
+ service marks, or product names of the Licensor, except as required for
+ reasonable and customary use in describing the origin of the Work and
+ reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty.
+
+ Unless required by applicable law or agreed to in writing, Licensor
+ provides the Work (and each Contributor provides its Contributions)
+ on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+ either express or implied, including, without limitation, any warranties
+ or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS
+ FOR A PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any risks
+ associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability.
+
+ In no event and under no legal theory, whether in tort
+ (including negligence), contract, or otherwise, unless required by
+ applicable law (such as deliberate and grossly negligent acts) or agreed
+ to in writing, shall any Contributor be liable to You for damages,
+ including any direct, indirect, special, incidental, or consequential
+ damages of any character arising as a result of this License or out of
+ the use or inability to use the Work (including but not limited to damages
+ for loss of goodwill, work stoppage, computer failure or malfunction,
+ or any and all other commercial damages or losses), even if such
+ Contributor has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability.
+
+ While redistributing the Work or Derivative Works thereof, You may choose
+ to offer, and charge a fee for, acceptance of support, warranty,
+ indemnity, or other liability obligations and/or rights consistent with
+ this License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf of any
+ other Contributor, and only if You agree to indemnify, defend, and hold
+ each Contributor harmless for any liability incurred by, or claims
+ asserted against, such Contributor by reason of your accepting any such
+ warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
+
+APPENDIX: How to apply the Apache License to your work
+
+ To apply the Apache License to your work, attach the following boilerplate
+ notice, with the fields enclosed by brackets "[]" replaced with your own
+ identifying information. (Don't include the brackets!) The text should be
+ enclosed in the appropriate comment syntax for the file format. We also
+ recommend that a file or class name and description of purpose be included
+ on the same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright 2013 Gareth Rushgrove
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ or implied. See the License for the specific language governing
+ permissions and limitations under the License.
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/Modulefile b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/Modulefile
new file mode 100644
index 00000000000..9ca1ef70427
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/Modulefile
@@ -0,0 +1,10 @@
+name 'garethr-erlang'
+version '0.3.0'
+source 'git://github.com/garethr/garethr-erlang.git'
+author 'Gareth Rushgrove'
+summary 'Module for installing erlang from official repos'
+description 'Install one of the official erlang packages'
+license 'Apache License, Version 2.0'
+dependency 'puppetlabs/apt'
+dependency 'puppetlabs/stdlib'
+dependency 'stahnma/epel'
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/README.md b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/README.md
new file mode 100644
index 00000000000..a1959740bc6
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/README.md
@@ -0,0 +1,28 @@
+Puppet module for installing Erlang from alternative repositories.
+
+On debian it will use the official repositories
+mentioned on the [Erlang
+docs](https://www.erlang-solutions.com/downloads/download-erlang-otp).
+
+On Redhat 5 it'll use an additional EPEL repository hosted by
+[Redhat](http://repos.fedorapeople.org/repos/peter/erlang/epel-erlang.repo).
+
+On Redhat 6 it'll require EPEL.
+
+On SUSE it'll use the official repos.
+
+On Archlinux it'll use community repos.
+
+This module is also available on the [Puppet
+Forge](https://forge.puppetlabs.com/garethr/erlang)
+
+[](http://travis-ci.org/garethr/garethr-erlang)
+
+## Usage
+
+The module includes a single class:
+
+ include 'erlang'
+
+By default this sets up the repository and installs the erlang package.
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/Rakefile b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/Rakefile
new file mode 100644
index 00000000000..d45aa3d5741
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/Rakefile
@@ -0,0 +1,35 @@
+require 'puppetlabs_spec_helper/rake_tasks'
+require 'puppet-lint/tasks/puppet-lint'
+require 'puppet-syntax/tasks/puppet-syntax'
+require 'rspec-system/rake_task'
+
+begin
+ require 'puppet_blacksmith/rake_tasks'
+rescue LoadError
+end
+
+PuppetLint.configuration.log_format = "%{path}:%{linenumber}:%{check}:%{KIND}:%{message}"
+PuppetLint.configuration.fail_on_warnings = true
+
+# Forsake support for Puppet 2.6.2 for the benefit of cleaner code.
+# http://puppet-lint.com/checks/class_parameter_defaults/
+PuppetLint.configuration.send('disable_class_parameter_defaults')
+# http://puppet-lint.com/checks/class_inherits_from_params_class/
+PuppetLint.configuration.send('disable_class_inherits_from_params_class')
+# http://puppet-lint.com/checks/80chars/
+PuppetLint.configuration.send("disable_80chars")
+
+exclude_paths = [
+ "pkg/**/*",
+ "vendor/**/*",
+ "spec/**/*",
+]
+PuppetLint.configuration.ignore_paths = exclude_paths
+PuppetSyntax.exclude_paths = exclude_paths
+
+desc "Run syntax, lint, and spec tests."
+task :test => [
+ :syntax,
+ :lint,
+ :spec,
+]
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/manifests/init.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/manifests/init.pp
new file mode 100644
index 00000000000..045bada9474
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/manifests/init.pp
@@ -0,0 +1,45 @@
+# == Class: erlang
+#
+# Module to install an up-to-date version of Erlang from the
+# official repositories
+#
+# === Parameters
+# [*version*]
+# The package version to install, passed to ensure.
+# Defaults to present.
+#
+class erlang (
+ $epel_enable = $erlang::params::epel_enable,
+ $key_signature = $erlang::params::key_signature,
+ $local_repo_location = $erlang::params::local_repo_location,
+ $package_name = $erlang::params::package_name,
+ $remote_repo_location = $erlang::params::remote_repo_location,
+ $remote_repo_key_location = $erlang::params::remote_repo_key_location,
+ $repos = $erlang::params::repos,
+ $version = 'present',
+) inherits erlang::params {
+ validate_string($version)
+
+ case $::osfamily {
+ 'Debian' : {
+ include '::apt'
+ include '::erlang::repo::apt'
+ }
+ 'RedHat' : {
+ if $epel_enable {
+ # Include epel as this is a requirement for erlang in RHEL6.
+ include '::epel'
+ Class['epel'] -> Package[$package_name]
+ }
+
+ # This is only needed on RHEL5, RHEL6 has erlang in EPEL.
+ if $::operatingsystemrelease =~ /^5/ {
+ include '::erlang::repo::yum'
+ }
+ }
+ default : {
+ }
+ }
+
+ package { $package_name: ensure => $version, }
+}
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/manifests/params.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/manifests/params.pp
new file mode 100644
index 00000000000..9358326cd94
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/manifests/params.pp
@@ -0,0 +1,29 @@
+# == Class: erlang::params
+#
+# Default paramaters setting repository details for different
+# operating systems
+#
+class erlang::params {
+ $epel_enable = false
+
+ case $::osfamily {
+ 'Debian' : {
+ $key_signature = 'D208507CA14F4FCA'
+ $package_name = 'erlang-nox'
+ $remote_repo_key_location = 'http://packages.erlang-solutions.com/debian/erlang_solutions.asc'
+ $remote_repo_location = 'http://packages.erlang-solutions.com/debian'
+ $repos = 'contrib'
+ }
+ 'RedHat', 'SUSE', 'Archlinux' : {
+ $package_name = 'erlang'
+
+ if $::operatingsystemrelease =~ /^5/ {
+ $local_repo_location = '/etc/yum.repos.d/epel-erlang.repo'
+ $remote_repo_location = 'http://repos.fedorapeople.org/repos/peter/erlang/epel-erlang.repo'
+ }
+ }
+ default : {
+ fail("The ${module_name} module is not supported on an ${::osfamily} based system.")
+ }
+ }
+}
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/manifests/repo/apt.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/manifests/repo/apt.pp
new file mode 100644
index 00000000000..dc5dbc9c4fb
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/manifests/repo/apt.pp
@@ -0,0 +1,41 @@
+# == Class: erlang::repo::apt
+#
+# Install an apt package repository containing Erlang.
+# All parameters have sane default values in erlang::params.
+#
+# === Parameters
+# [*key_signature*]
+# The signature for the key used to sign packages in the repository.
+#
+# [*package_name*]
+# Name of the Erlang package in the specified repository.
+#
+# [*remote_repo_key_location*]
+# URL of the public key for the remote repository.
+#
+# [*remote_repo_location*]
+# URL of the remote debian repository.
+#
+# [*repos*]
+# Which of the standard repositories to install from the
+# remote repo. For instance main, contrib, restricted.
+#
+class erlang::repo::apt(
+ $key_signature = $erlang::key_signature,
+ $package_name = $erlang::package_name,
+ $remote_repo_key_location = $erlang::remote_repo_key_location,
+ $remote_repo_location = $erlang::remote_repo_location,
+ $repos = $erlang::repos,
+) {
+
+ Class['erlang::repo::apt'] -> Package<| title == $package_name |>
+
+ apt::source { 'erlang':
+ include_src => false,
+ key => $key_signature,
+ key_source => $remote_repo_key_location,
+ location => $remote_repo_location,
+ repos => $repos,
+ }
+
+}
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/manifests/repo/yum.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/manifests/repo/yum.pp
new file mode 100644
index 00000000000..702e65220b9
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/manifests/repo/yum.pp
@@ -0,0 +1,30 @@
+# == Class: erlang::repo::yum
+#
+# Install a yum package repository containing Erlang.
+# All parameters have sane default values in erlang::params.
+#
+# === Parameters
+# [*local_repo_location*]
+# File system location to store the repository details
+#
+# [*package_name*]
+# Name of the Erlang package in the specified repository
+#
+# [*remote_repo_location*]
+# URL of the remote repository
+#
+class erlang::repo::yum (
+ $local_repo_location = $erlang::local_repo_location,
+ $package_name = $erlang::package_name,
+ $remote_repo_location = $erlang::remote_repo_location,
+) inherits erlang {
+
+ Class['erlang::repo::yum'] -> Package<| title == $package_name |>
+
+ exec { 'erlang-repo-download':
+ command => "curl -o ${local_repo_location} ${remote_repo_location}",
+ path => '/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin',
+ creates => $local_repo_location,
+ }
+
+}
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/spec/classes/erlang_spec.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/spec/classes/erlang_spec.rb
new file mode 100644
index 00000000000..8708eb1afe8
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/spec/classes/erlang_spec.rb
@@ -0,0 +1,138 @@
+require 'spec_helper'
+
+describe 'erlang', :type => :class do
+
+
+ context 'on Debian' do
+ let(:facts) { {
+ :osfamily => 'Debian',
+ :lsbdistid => 'debian',
+ :lsbdistcodename => 'squeeze'
+ }}
+
+ context 'with no parameters' do
+ it { should compile.with_all_deps }
+ it { should contain_package('erlang-nox').with_ensure('present') }
+ it { should contain_apt__source('erlang').with(
+ 'key_source' => 'http://packages.erlang-solutions.com/debian/erlang_solutions.asc',
+ 'key' => 'D208507CA14F4FCA'
+ ) }
+ end
+
+ context 'with a custom version' do
+ let(:params) { {'version' => 'absent' } }
+ it { should contain_package('erlang-nox').with_ensure('absent') }
+ end
+
+ context 'with a custom package name' do
+ let(:params) { {'package_name' => 'not-erlang' } }
+ it { should contain_package('not-erlang').with_ensure('present') }
+ end
+
+ context 'with custom repository details' do
+ let(:params) { {
+ 'key_signature' => '1234ABCD',
+ 'repos' => 'main',
+ 'remote_repo_location' => 'http://example.com/debian',
+ 'remote_repo_key_location' => 'http://example.com/debian/key.asc',
+ } }
+ it { should contain_apt__source('erlang').with(
+ 'location' => 'http://example.com/debian',
+ 'key_source' => 'http://example.com/debian/key.asc',
+ 'key' => '1234ABCD',
+ 'repos' => 'main'
+ ) }
+ end
+
+ end
+
+ context 'on RedHat 5' do
+ let(:facts) { {:osfamily => 'RedHat', :operatingsystemrelease => '5.9' } }
+
+ context "epel enabled" do
+ let(:params) {{ :epel_enable => true }}
+ it { should contain_class('epel') }
+ end
+
+ context "epel disabled" do
+ let(:params) {{ :epel_enable => false }}
+ it { should_not contain_class('epel') }
+ end
+
+ context 'with no parameters' do
+ it { should contain_package('erlang').with_ensure('present') }
+ it { should contain_exec('erlang-repo-download').with(
+ 'command' => 'curl -o /etc/yum.repos.d/epel-erlang.repo http://repos.fedorapeople.org/repos/peter/erlang/epel-erlang.repo',
+ 'path' => '/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin'
+ )
+ }
+ end
+
+ context 'with a custom repository' do
+ let(:params) { {
+ 'local_repo_location' => '/tmp/yum.repos.d/tmp.repo',
+ 'remote_repo_location' => 'http://example.com/fake.repo',
+ } }
+
+ it { should contain_exec('erlang-repo-download').with(
+ 'command' => 'curl -o /tmp/yum.repos.d/tmp.repo http://example.com/fake.repo'
+ )
+ }
+ end
+
+ context 'with a custom version' do
+ let(:params) { {'version' => 'absent' } }
+ it { should contain_package('erlang').with_ensure('absent') }
+ end
+ end
+
+ context 'on RedHat 6' do
+ let(:facts) { {:osfamily => 'RedHat', :operatingsystemrelease => '6.4' } }
+
+ context "epel enabled" do
+ let(:params) {{ :epel_enable => true }}
+ it { should contain_class('epel') }
+ end
+
+ context "epel disabled" do
+ let(:params) {{ :epel_enable => false }}
+ it { should_not contain_class('epel') }
+ end
+
+ context 'with no parameters' do
+ it { should contain_package('erlang').with_ensure('present') }
+ end
+
+ context 'with a custom version' do
+ let(:params) { {'version' => 'absent' } }
+ it { should contain_package('erlang').with_ensure('absent') }
+ end
+ end
+
+ context 'on SUSE' do
+ let(:facts) {{ :osfamily => 'SUSE', }}
+
+ context 'with no parameters' do
+ it { should contain_package('erlang').with_ensure('present') }
+ end
+
+ context 'with a custom version' do
+ let(:params) { {'version' => 'absent' } }
+ it { should contain_package('erlang').with_ensure('absent') }
+ end
+ end
+
+ context 'on Archlinux' do
+ let(:facts) {{ :osfamily => 'Archlinux', }}
+
+ context 'with no parameters' do
+ it { should contain_package('erlang').with_ensure('present') }
+ end
+
+ context 'with a custom version' do
+ let(:params) { {'version' => 'absent' } }
+ it { should contain_package('erlang').with_ensure('absent') }
+ end
+ end
+
+end
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/spec/spec_helper.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/spec/spec_helper.rb
new file mode 100644
index 00000000000..2c6f56649ae
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/spec/spec_helper.rb
@@ -0,0 +1 @@
+require 'puppetlabs_spec_helper/module_spec_helper'
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/spec/spec_helper_system.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/spec/spec_helper_system.rb
new file mode 100644
index 00000000000..5c370248560
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/spec/spec_helper_system.rb
@@ -0,0 +1,17 @@
+require 'rspec-system/spec_helper'
+require 'rspec-system-puppet/helpers'
+
+include RSpecSystemPuppet::Helpers
+
+RSpec.configure do |c|
+ proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
+ c.tty = true
+ c.include RSpecSystemPuppet::Helpers
+
+ c.before :suite do
+ puppet_install
+ puppet_module_install(:source => proj_root, :module_name => 'erlang')
+ shell('puppet module install puppetlabs-apt')
+ shell('puppet module install stahnma-epel')
+ end
+end
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/spec/system/erlang_spec.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/spec/system/erlang_spec.rb
new file mode 100644
index 00000000000..4d5772fa59a
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/spec/system/erlang_spec.rb
@@ -0,0 +1,25 @@
+require 'spec_helper_system'
+
+describe 'The erlang puppet module' do
+ it 'should run without errors' do
+ pp = <<-EOS
+ class { 'erlang':
+ epel_enable => true
+ }
+ EOS
+
+ puppet_apply(pp) do |r|
+ r.exit_code.should == 2
+ r.refresh
+ r.exit_code.should be_zero
+ end
+ end
+
+ it 'should install the erl binary into /usr/bin' do
+ shell 'which erl' do |r|
+ r.stdout.should =~ /\/usr\/bin\/erl/
+ r.stderr.should be_empty
+ r.exit_code.should be_zero
+ end
+ end
+end
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/lib/puppet/parser/functions/hash_key_true.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/lib/puppet/parser/functions/hash_key_true.rb
new file mode 100644
index 00000000000..90401172eb7
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/lib/puppet/parser/functions/hash_key_true.rb
@@ -0,0 +1,46 @@
+#
+# hash_key_true.rb
+#
+
+module Puppet::Parser::Functions
+
+ newfunction(:hash_key_true, :type => :rvalue, :doc => <<-'ENDHEREDOC') do |args|
+
+ Returns true if the key within hash is truthy
+ ENDHEREDOC
+
+ unless args.length == 2
+ raise Puppet::ParseError, ("hash_key_true(): wrong number of arguments (#{args.length}; must be 2)")
+ end
+
+ arr = args[0]
+ key = args[1]
+
+ unless arr.is_a?(Hash)
+ return false
+ end
+
+ unless arr.has_key?(key)
+ return false
+ end
+
+ if arr[key].nil?
+ return false
+ end
+
+ if arr[key] == false
+ return false
+ end
+
+ if arr[key] == 'false'
+ return false
+ end
+
+ if arr[key].empty?
+ return false
+ end
+
+ return true
+
+ end
+end
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/lib/puppet/parser/functions/value_true.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/lib/puppet/parser/functions/value_true.rb
new file mode 100644
index 00000000000..d50c2d8304b
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/lib/puppet/parser/functions/value_true.rb
@@ -0,0 +1,45 @@
+#
+# value_true.rb
+#
+
+module Puppet::Parser::Functions
+
+ newfunction(:value_true, :type => :rvalue, :doc => <<-'ENDHEREDOC') do |args|
+
+ Returns true if value is truthy
+ ENDHEREDOC
+
+ unless args.length == 1
+ raise Puppet::ParseError, ("value_true(): wrong number of arguments (#{args.length}; must be 1)")
+ end
+
+ value = args[0]
+
+ if value.nil?
+ return false
+ end
+
+ if value == false
+ return false
+ end
+
+ if value == 0
+ return false
+ end
+
+ if value == '0'
+ return false
+ end
+
+ if value == 'false'
+ return false
+ end
+
+ if value.empty?
+ return false
+ end
+
+ return true
+
+ end
+end
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/manifests/hhvm.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/manifests/hhvm.pp
index 90083232cdc..7a35d19efe9 100644
--- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/manifests/hhvm.pp
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/manifests/hhvm.pp
@@ -44,7 +44,11 @@ class puphpet::hhvm(
'deb http://security.debian.org/ wheezy/updates main',
'deb-src http://security.debian.org/ wheezy/updates main',
'deb http://http.us.debian.org/debian wheezy-updates main',
- 'deb-src http://http.us.debian.org/debian wheezy-updates main'
+ 'deb-src http://http.us.debian.org/debian wheezy-updates main',
+ 'deb http://http.debian.net/debian wheezy main',
+ 'deb-src http://http.debian.net/debian wheezy main',
+ 'deb http://http.debian.net/debian wheezy-updates main',
+ 'deb-src http://http.debian.net/debian wheezy-updates main',
]
each( $deb_srcs ) |$value| {
@@ -69,17 +73,39 @@ class puphpet::hhvm(
}
}
'centos': {
+ $jemalloc_url = 'http://files.puphpet.com/centos6/jemalloc-3.6.0-1.el6.x86_64.rpm'
+ $jemalloc_download_location = '/.puphpet-stuff/jemalloc-3.6.0-1.el6.x86_64.rpm'
+
+ $require = defined(Class['my_fw::post']) ? {
+ true => Class['my_fw::post'],
+ default => [],
+ }
+
+ exec { "download jemalloc to ${download_location}":
+ creates => $download_location,
+ command => "wget --quiet --tries=5 --connect-timeout=10 -O '${jemalloc_download_location}' '${jemalloc_url}'",
+ timeout => 30,
+ path => '/usr/bin',
+ require => $require
+ }
+
+ package { 'jemalloc':
+ ensure => latest,
+ provider => yum,
+ source => $download_location,
+ require => Exec["download jemalloc to ${download_location}"],
+ }
+
yum::managed_yumrepo { 'hop5':
descr => 'hop5 repository',
baseurl => 'http://www.hop5.in/yum/el6/',
gpgkey => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-HOP5',
enabled => 1,
gpgcheck => 0,
- priority => 1
+ priority => 1,
}
}
}
-
if $real_webserver == 'apache2' {
if ! defined(Class['apache::mod::mime']) {
class { 'apache::mod::mime': }
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/manifests/params.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/manifests/params.pp
index 1a998e9271b..e266f862cdb 100644
--- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/manifests/params.pp
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/manifests/params.pp
@@ -53,9 +53,14 @@ class puphpet::params {
'Redhat' => 'php-cgi'
}
+ $nginx_default_conf_location = $::osfamily ? {
+ 'Debian' => '/etc/nginx/conf.d/default.conf',
+ 'Redhat' => '/etc/nginx/conf.d/default.conf'
+ }
+
$nginx_webroot_location = $::osfamily ? {
'Debian' => '/var/www/html',
- 'Redhat' => '/usr/share/nginx/html'
+ 'Redhat' => '/var/www/html'
}
$mariadb_package_client_name = $::osfamily ? {
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/manifests/php/pear.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/manifests/php/pear.pp
index 4582e67a17a..f570dcd4fc4 100644
--- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/manifests/php/pear.pp
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/manifests/php/pear.pp
@@ -3,7 +3,8 @@
*/
define puphpet::php::pear (
- $service_autorestart
+ $service_name = '',
+ $service_autorestart,
){
$package = {
@@ -15,7 +16,9 @@ define puphpet::php::pear (
'pear_command_packaging' => 'alpha',
'pear_frontend_gtk2' => false,
'php_beautifier' => 'beta',
+ 'php_parser' => 'alpha',
'php_parser_docblockparser' => 'alpha',
+ 'soap' => 'beta',
'testing_selenium' => 'beta',
'versioncontrol_git' => 'alpha',
'versioncontrol_svn' => 'alpha',
@@ -38,7 +41,8 @@ define puphpet::php::pear (
::php::pear::module { $name:
use_package => false,
preferred_state => $preferred_state,
- service_autorestart => $php_webserver_restart,
+ service => $service_name,
+ service_autorestart => $service_autorestart,
}
}
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/manifests/php/pecl.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/manifests/php/pecl.pp
index 2dd2b817fec..dfa04232f42 100644
--- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/manifests/php/pecl.pp
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/manifests/php/pecl.pp
@@ -16,7 +16,10 @@ define puphpet::php::pecl (
$pecl = $::osfamily ? {
'Debian' => {
- #
+ 'mongo' => $::lsbdistcodename ? {
+ 'precise' => 'mongo',
+ default => false,
+ },
},
'Redhat' => {
#
@@ -63,24 +66,34 @@ define puphpet::php::pecl (
}
}
+ $auto_answer_hash = {
+ 'mongo' => 'no\n'
+ }
+
$downcase_name = downcase($name)
- if has_key($ignore, $downcase_name) {
+ if has_key($auto_answer_hash, $downcase_name) {
+ $auto_answer = $auto_answer_hash[$downcase_name]
+ } else {
+ $auto_answer = '\\n'
+ }
+
+ if has_key($ignore, $downcase_name) and $ignore[$downcase_name] {
$pecl_name = $pecl[$downcase_name]
$package_name = false
$preferred_state = 'stable'
}
- elsif has_key($pecl, $downcase_name) {
- $pecl_name = false
+ elsif has_key($pecl, $downcase_name) and $pecl[$downcase_name] {
+ $pecl_name = $pecl[$downcase_name]
$package_name = false
- $preferred_state = false
+ $preferred_state = 'stable'
}
elsif has_key($pecl_beta, $downcase_name) and $pecl_beta[$downcase_name] {
$pecl_name = $pecl_beta[$downcase_name]
$package_name = false
$preferred_state = 'beta'
}
- elsif has_key($package, $downcase_name) {
+ elsif has_key($package, $downcase_name) and $package[$downcase_name] {
$pecl_name = false
$package_name = $package[$downcase_name]
}
@@ -93,6 +106,7 @@ define puphpet::php::pecl (
::php::pecl::module { $pecl_name:
use_package => false,
preferred_state => $preferred_state,
+ auto_answer => $auto_answer,
service_autorestart => $service_autorestart,
}
}
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/manifests/python/pip.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/manifests/python/pip.pp
new file mode 100644
index 00000000000..14b13fe08c6
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/manifests/python/pip.pp
@@ -0,0 +1,22 @@
+class puphpet::python::pip {
+
+ Exec { path => [ '/usr/bin/', '/usr/local/bin', '/bin', '/usr/local/sbin', '/usr/sbin', '/sbin' ] }
+
+ if ! defined(Package['python-setuptools']) {
+ package { 'python-setuptools': }
+ }
+
+ exec { 'easy_install pip':
+ unless => 'which pip',
+ require => Package['python-setuptools'],
+ }
+
+ if $::osfamily == 'RedHat' {
+ exec { 'rhel pip_provider_name_fix':
+ command => 'alternatives --install /usr/bin/pip-python pip-python /usr/bin/pip 1',
+ subscribe => Exec['easy_install pip'],
+ unless => 'which pip-python',
+ }
+ }
+
+}
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/manifests/supervisord.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/manifests/supervisord.pp
new file mode 100644
index 00000000000..a13df08b30b
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/manifests/supervisord.pp
@@ -0,0 +1,18 @@
+# This depends on
+# ajcrowe/supervisord: https://github.com/ajcrowe/puppet-supervisord
+
+class puphpet::supervisord {
+
+ if ! defined(Class['::supervisord']) {
+ class{ 'puphpet::python::pip': }
+
+ class { '::supervisord':
+ install_pip => false,
+ require => [
+ Class['::my_fw::post'],
+ Class['puphpet::python::pip'],
+ ],
+ }
+ }
+
+}
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/README.md b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/README.md
index c6750445516..d956bdedcff 100644
--- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/README.md
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/README.md
@@ -111,6 +111,23 @@ class { 'rabbitmq':
}
```
+**NOTE:** If you are using a version of RabbitMQ less than 3.0,
+you still need to use `x-ha-policy: all` in your client
+applications for any particular queue to take advantage of H/A via
+mirrored queues.
+
+If you are using a version of RabbitMQ >= 3.0 You should set the
+'config_mirrored_queues' parameter if you plan
+on using RabbitMQ Mirrored Queues within your cluster:
+
+```puppet
+class { 'rabbitmq':
+ config_cluster => true,
+ config_mirrored_queues => true,
+ cluster_nodes => ['rabbit1', 'rabbit2'],
+}
+```
+
##Reference
##Classes
@@ -234,6 +251,15 @@ Determines if the service is managed.
The name of the service to manage.
+####`ssl`
+
+Configures the service for using SSL.
+
+####`ssl_only`
+
+Configures the service to only use SSL. No cleartext TCP listeners will be created.
+Requires that ssl => true also.
+
####`stomp_port`
The port to use for Stomp.
@@ -262,6 +288,16 @@ rabbitmq_user { 'dan':
password => 'bar',
}
```
+Optional parameter tags will set further rabbitmq tags like monitoring, policymaker, etc.
+To set the administrator tag use admin-flag.
+```puppet
+rabbitmq_user { 'dan':
+ admin => true,
+ password => 'bar',
+ tags => ['monitoring', 'tag1'],
+}
+```
+
### rabbitmq\_vhost
@@ -317,8 +353,8 @@ The module has been tested on:
Testing on other platforms has been light and cannot be guaranteed.
-### RedHat module dependencies
-To have a suitable erlang version installed on RedHat systems,
+### Module dependencies
+To have a suitable erlang version installed on RedHat and Debian systems,
you have to install another puppet module from http://forge.puppetlabs.com/garethr/erlang with:
puppet module install garethr-erlang
@@ -326,9 +362,18 @@ you have to install another puppet module from http://forge.puppetlabs.com/garet
This module handles the packages for erlang.
To use the module, add the following snippet to your site.pp or an appropriate profile class:
+For RedHat systems:
+
include 'erlang'
class { 'erlang': epel_enable => true}
+For Debian systems:
+
+ include 'erlang'
+ package { 'erlang-base':
+ ensure => 'latest',
+ }
+
##Development
Puppet Labs modules on the Puppet Forge are open projects, and community
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/files/plugins/amqp_client-2.3.1.ez b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/files/plugins/amqp_client-2.3.1.ez
index 6ef6d4ff148..125a89a7b79 100644
Binary files a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/files/plugins/amqp_client-2.3.1.ez and b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/files/plugins/amqp_client-2.3.1.ez differ
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/lib/puppet/provider/rabbitmq_exchange/rabbitmqadmin.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/lib/puppet/provider/rabbitmq_exchange/rabbitmqadmin.rb
index fcc3764fdd8..8e0d6ab862d 100644
--- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/lib/puppet/provider/rabbitmq_exchange/rabbitmqadmin.rb
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/lib/puppet/provider/rabbitmq_exchange/rabbitmqadmin.rb
@@ -2,7 +2,9 @@ require 'puppet'
Puppet::Type.type(:rabbitmq_exchange).provide(:rabbitmqadmin) do
commands :rabbitmqctl => '/usr/sbin/rabbitmqctl'
- commands :rabbitmqadmin => '/usr/local/bin/rabbitmqadmin'
+ has_command(:rabbitmqadmin, '/usr/local/bin/rabbitmqadmin') do
+ environment( { 'HOME' => '' })
+ end
defaultfor :feature => :posix
def should_vhost
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/lib/puppet/provider/rabbitmq_plugin/rabbitmqplugins.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/lib/puppet/provider/rabbitmq_plugin/rabbitmqplugins.rb
index e416cbe02b3..eefc9fb2541 100644
--- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/lib/puppet/provider/rabbitmq_plugin/rabbitmqplugins.rb
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/lib/puppet/provider/rabbitmq_plugin/rabbitmqplugins.rb
@@ -1,10 +1,20 @@
Puppet::Type.type(:rabbitmq_plugin).provide(:rabbitmqplugins) do
if Puppet::PUPPETVERSION.to_f < 3
- commands :rabbitmqplugins => 'rabbitmq-plugins'
+ if Facter.value(:osfamily) == 'RedHat'
+ commands :rabbitmqplugins => '/usr/lib/rabbitmq/bin/rabbitmq-plugins'
+ else
+ commands :rabbitmqplugins => 'rabbitmq-plugins'
+ end
else
- has_command(:rabbitmqplugins, 'rabbitmq-plugins') do
- environment :HOME => "/tmp"
+ if Facter.value(:osfamily) == 'RedHat'
+ has_command(:rabbitmqplugins, '/usr/lib/rabbitmq/bin/rabbitmq-plugins') do
+ environment :HOME => "/tmp"
+ end
+ else
+ has_command(:rabbitmqplugins, 'rabbitmq-plugins') do
+ environment :HOME => "/tmp"
+ end
end
end
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/lib/puppet/provider/rabbitmq_user/rabbitmqctl.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/lib/puppet/provider/rabbitmq_user/rabbitmqctl.rb
index 9cb2e41c293..ef284bdcdc6 100644
--- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/lib/puppet/provider/rabbitmq_user/rabbitmqctl.rb
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/lib/puppet/provider/rabbitmq_user/rabbitmqctl.rb
@@ -27,6 +27,9 @@ Puppet::Type.type(:rabbitmq_user).provide(:rabbitmqctl) do
if resource[:admin] == :true
make_user_admin()
end
+ if !resource[:tags].nil?
+ set_user_tags(resource[:tags])
+ end
end
def destroy
@@ -39,8 +42,18 @@ Puppet::Type.type(:rabbitmq_user).provide(:rabbitmqctl) do
end
end
- # def password
- # def password=()
+
+ def tags
+ get_user_tags.entries.sort
+ end
+
+
+ def tags=(tags)
+ if ! tags.nil?
+ set_user_tags(tags)
+ end
+ end
+
def admin
if usertags = get_user_tags
(:true if usertags.include?('administrator')) || :false
@@ -49,7 +62,6 @@ Puppet::Type.type(:rabbitmq_user).provide(:rabbitmqctl) do
end
end
-
def admin=(state)
if state == :true
make_user_admin()
@@ -60,6 +72,16 @@ Puppet::Type.type(:rabbitmq_user).provide(:rabbitmqctl) do
end
end
+ def set_user_tags(tags)
+ is_admin = get_user_tags().member?("administrator") \
+ || resource[:admin] == :true
+ usertags = Set.new(tags)
+ if is_admin
+ usertags.add("administrator")
+ end
+ rabbitmqctl('set_user_tags', resource[:name], usertags.entries.sort)
+ end
+
def make_user_admin
usertags = get_user_tags
usertags.add('administrator')
@@ -73,5 +95,4 @@ Puppet::Type.type(:rabbitmq_user).provide(:rabbitmqctl) do
end.compact.first
Set.new(match[1].split(/, /)) if match
end
-
end
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/lib/puppet/type/rabbitmq_user.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/lib/puppet/type/rabbitmq_user.rb
index 642710d1c07..be5219d5c90 100644
--- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/lib/puppet/type/rabbitmq_user.rb
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/lib/puppet/type/rabbitmq_user.rb
@@ -33,6 +33,10 @@ Puppet::Type.newtype(:rabbitmq_user) do
defaultto :false
end
+ newproperty(:tags, :array_matching => :all) do
+ desc 'additional tags for the user'
+ end
+
validate do
if self[:ensure] == :present and ! self[:password]
raise ArgumentError, 'must set password when creating user' unless self[:password]
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/manifests/config.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/manifests/config.pp
index 96877f6a631..8894280f6de 100644
--- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/manifests/config.pp
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/manifests/config.pp
@@ -17,11 +17,14 @@ class rabbitmq::config {
$port = $rabbitmq::port
$service_name = $rabbitmq::service_name
$ssl = $rabbitmq::ssl
+ $ssl_only = $rabbitmq::ssl_only
$ssl_cacert = $rabbitmq::ssl_cacert
$ssl_cert = $rabbitmq::ssl_cert
$ssl_key = $rabbitmq::ssl_key
$ssl_management_port = $rabbitmq::ssl_management_port
$ssl_stomp_port = $rabbitmq::ssl_stomp_port
+ $ssl_verify = $rabbitmq::ssl_verify
+ $ssl_fail_if_no_peer_cert = $rabbitmq::ssl_fail_if_no_peer_cert
$stomp_port = $rabbitmq::stomp_port
$wipe_db_on_cookie_change = $rabbitmq::wipe_db_on_cookie_change
$config_variables = $rabbitmq::config_variables
@@ -115,3 +118,4 @@ class rabbitmq::config {
}
+
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/manifests/init.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/manifests/init.pp
index 6c14f0097d6..c96128a792e 100644
--- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/manifests/init.pp
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/manifests/init.pp
@@ -6,6 +6,7 @@ class rabbitmq(
$cluster_nodes = $rabbitmq::params::cluster_nodes,
$config = $rabbitmq::params::config,
$config_cluster = $rabbitmq::params::config_cluster,
+ $config_mirrored_queues = $rabbitmq::params::config_mirrored_queues,
$config_path = $rabbitmq::params::config_path,
$config_stomp = $rabbitmq::params::config_stomp,
$default_user = $rabbitmq::params::default_user,
@@ -29,6 +30,7 @@ class rabbitmq(
$service_manage = $rabbitmq::params::service_manage,
$service_name = $rabbitmq::params::service_name,
$ssl = $rabbitmq::params::ssl,
+ $ssl_only = $rabbitmq::params::ssl_only,
$ssl_cacert = $rabbitmq::params::ssl_cacert,
$ssl_cert = $rabbitmq::params::ssl_cert,
$ssl_key = $rabbitmq::params::ssl_key,
@@ -59,7 +61,6 @@ class rabbitmq(
validate_string($package_gpg_key)
validate_string($package_name)
validate_string($package_provider)
- validate_string($package_source)
validate_bool($manage_repos)
validate_re($version, '^\d+\.\d+\.\d+(-\d+)*$') # Allow 3 digits and optional -n postfix.
# Validate config parameters.
@@ -69,6 +70,7 @@ class rabbitmq(
validate_string($config)
validate_absolute_path($config_path)
validate_bool($config_cluster)
+ validate_bool($config_mirrored_queues)
validate_bool($config_stomp)
validate_string($default_user)
validate_string($default_pass)
@@ -87,6 +89,7 @@ class rabbitmq(
validate_bool($service_manage)
validate_string($service_name)
validate_bool($ssl)
+ validate_bool($ssl_only)
validate_string($ssl_cacert)
validate_string($ssl_cert)
validate_string($ssl_key)
@@ -105,6 +108,10 @@ class rabbitmq(
validate_hash($config_variables)
validate_hash($config_kernel_variables)
+ if $ssl_only and ! $ssl {
+ fail('$ssl_only => true requires that $ssl => true')
+ }
+
include '::rabbitmq::install'
include '::rabbitmq::config'
include '::rabbitmq::service'
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/manifests/management.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/manifests/management.pp
index 481a7b4f931..078e9a95f00 100644
--- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/manifests/management.pp
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/manifests/management.pp
@@ -10,4 +10,10 @@ class rabbitmq::management {
}
}
+ if $rabbitmq::config_mirrored_queues {
+ rabbitmq::policy { 'ha-all':
+ pattern => '.*',
+ definition => '{"ha-mode":"all","ha-sync-mode":"automatic"}'
+ }
+ }
}
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/manifests/params.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/manifests/params.pp
index 9018bb7b244..63e2e491ee1 100644
--- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/manifests/params.pp
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/manifests/params.pp
@@ -61,6 +61,7 @@ class rabbitmq::params {
$cluster_nodes = []
$config = 'rabbitmq/rabbitmq.config.erb'
$config_cluster = false
+ $config_mirrored_queues = false
$config_path = '/etc/rabbitmq/rabbitmq.config'
$config_stomp = false
$default_user = 'guest'
@@ -73,6 +74,7 @@ class rabbitmq::params {
$plugin_dir = "/usr/lib/rabbitmq/lib/rabbitmq_server-${version}/plugins"
$port = '5672'
$ssl = false
+ $ssl_only = false
$ssl_cacert = 'UNSET'
$ssl_cert = 'UNSET'
$ssl_key = 'UNSET'
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/manifests/policy.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/manifests/policy.pp
new file mode 100644
index 00000000000..204fb36a9cf
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/manifests/policy.pp
@@ -0,0 +1,15 @@
+define rabbitmq::policy (
+ $pattern,
+ $definition,
+ $vhost = '/',
+ $priority = 0,
+) {
+
+ exec { "rabbitmq policy: ${title}":
+ command => "rabbitmqctl set_policy -p ${vhost} '${name}' '${pattern}' '${definition}' ${priority}",
+ unless => "rabbitmqctl list_policies | grep -qE '^${vhost}\\s+${name}\\s+${pattern}\\s+${definition}\\s+${priority}$'",
+ path => ['/bin','/sbin','/usr/bin','/usr/sbin'],
+ require => Class['rabbitmq::service'],
+ before => Anchor['rabbitmq::end']
+ }
+}
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/manifests/server.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/manifests/server.pp
index 495ea2f2dfc..8ad26cb5bb6 100644
--- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/manifests/server.pp
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/manifests/server.pp
@@ -66,7 +66,7 @@ class rabbitmq::server(
}
if $config_mirrored_queues != undef {
- warning('The $config_mirrored_queues parameter is deprecated; it does not affect anything')
+ warning('The $config_mirrored_queues parameter is deprecated in this class, use the rabbitmq class')
}
anchor {'before::rabbimq::class':
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/spec/classes/rabbitmq_spec.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/spec/classes/rabbitmq_spec.rb
index 3e577843e8a..ff93fd4e3fc 100644
--- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/spec/classes/rabbitmq_spec.rb
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/spec/classes/rabbitmq_spec.rb
@@ -20,7 +20,7 @@ describe 'rabbitmq' do
let(:facts) {{ :osfamily => 'Debian' }}
it 'should add a repo with defaults values' do
contain_file('/etc/apt/sources.list.d/rabbitmq.list')\
- .with_content(/deb http\:\/\/www\.rabbitmq.com\/debian\/ testing main/)
+ .with_content(%r|deb http\://www\.rabbitmq.com/debian/ testing main|)
end
end
@@ -32,7 +32,7 @@ describe 'rabbitmq' do
}}
it 'should add a repo with custom new values' do
contain_file('/etc/apt/sources.list.d/rabbitmq.list')\
- .with_content(/deb http\:\/\/www\.foorepo.com\/debian\/ unstable main/)
+ .with_content(%r|deb http\://www\.foorepo.com/debian/ unstable main|)
end
end
end
@@ -275,6 +275,30 @@ describe 'rabbitmq' do
end
end
+ describe 'configuring ldap authentication' do
+ let :params do
+ { :config_stomp => false,
+ :ldap_auth => true,
+ :ldap_server => 'ldap.example.com',
+ :ldap_user_dn_pattern => 'ou=users,dc=example,dc=com',
+ :ldap_use_ssl => false,
+ :ldap_port => '389',
+ :ldap_log => true
+ }
+ end
+
+ it { should contain_rabbitmq_plugin('rabbitmq_auth_backend_ldap') }
+
+ it 'should contain ldap parameters' do
+ verify_contents(subject, 'rabbitmq.config',
+ ['[', ' {rabbit, [', ' {auth_backends, [rabbit_auth_backend_internal, rabbit_auth_backend_ldap]},', ' ]}',
+ ' {rabbitmq_auth_backend_ldap, [', ' {other_bind, anon},',
+ ' {servers, ["ldap.example.com"]},',
+ ' {user_dn_pattern, "ou=users,dc=example,dc=com"},', ' {use_ssl, false},',
+ ' {port, 389},', ' {log, true}'])
+ end
+ end
+
describe 'default_user and default_pass set' do
let(:params) {{ :default_user => 'foo', :default_pass => 'bar' }}
it 'should set default_user and default_pass to specified values' do
@@ -295,10 +319,31 @@ describe 'rabbitmq' do
it 'should set ssl options to specified values' do
contain_file('rabbitmq.config').with({
- 'content' => /ssl_listeners, \[3141\].*
- ssl_options, \[{cacertfile,"\/path\/to\/cacert".*
- certfile="\/path\/to\/cert".*
- keyfile,"\/path\/to\/key/,
+ 'content' => %r|ssl_listeners, \[3141\].*
+ ssl_options, \[{cacertfile,"/path/to/cacert".*
+ certfile="/path/to/cert".*
+ keyfile,"/path/to/key|,
+ })
+ end
+ end
+
+ describe 'ssl options with ssl_only' do
+ let(:params) {
+ { :ssl => true,
+ :ssl_only => true,
+ :ssl_management_port => 3141,
+ :ssl_cacert => '/path/to/cacert',
+ :ssl_cert => '/path/to/cert',
+ :ssl_key => '/path/to/key'
+ } }
+
+ it 'should set ssl options to specified values' do
+ contain_file('rabbitmq.config').with({
+ 'content' => %r|tcp_listeners, \[\].*
+ ssl_listeners, \[3141\].*
+ ssl_options, \[{cacertfile,"/path/to/cacert".*
+ certfile="/path/to/cert".*
+ keyfile,"/path/to/key|,
})
end
end
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/spec/unit/puppet/provider/rabbitmq_user/rabbitmqctl_spec.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/spec/unit/puppet/provider/rabbitmq_user/rabbitmqctl_spec.rb
index ea4233cba13..2c13b886a8c 100644
--- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/spec/unit/puppet/provider/rabbitmq_user/rabbitmqctl_spec.rb
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/spec/unit/puppet/provider/rabbitmq_user/rabbitmqctl_spec.rb
@@ -147,4 +147,90 @@ EOT
@provider.expects(:rabbitmqctl).with('set_user_tags', 'foo', ['bar','baz'].sort)
@provider.admin=:false
end
+
+ it 'should clear all tags on existing user' do
+ @provider.expects(:rabbitmqctl).with('list_users').returns <<-EOT
+Listing users ...
+one [administrator]
+foo [tag1,tag2]
+icinga [monitoring]
+kitchen []
+kitchen2 [abc, def, ghi]
+...done.
+EOT
+ @provider.expects(:rabbitmqctl).with('set_user_tags', 'foo', [])
+ @provider.tags=[]
+ end
+
+ it 'should set multiple tags' do
+ @provider.expects(:rabbitmqctl).with('list_users').returns <<-EOT
+Listing users ...
+one [administrator]
+foo []
+icinga [monitoring]
+kitchen []
+kitchen2 [abc, def, ghi]
+...done.
+EOT
+ @provider.expects(:rabbitmqctl).with('set_user_tags', 'foo', ['tag1','tag2'])
+ @provider.tags=['tag1','tag2']
+ end
+
+ it 'should clear tags while keep admin tag' do
+ @resource[:admin] = true
+ @provider.expects(:rabbitmqctl).with('list_users').returns <<-EOT
+Listing users ...
+one [administrator]
+foo [administrator, tag1, tag2]
+icinga [monitoring]
+kitchen []
+kitchen2 [abc, def, ghi]
+...done.
+EOT
+ @provider.expects(:rabbitmqctl).with('set_user_tags', 'foo', ["administrator"])
+ @provider.tags=[]
+ end
+
+ it 'should change tags while keep admin tag' do
+ @resource[:admin] = true
+ @provider.expects(:rabbitmqctl).with('list_users').returns <<-EOT
+Listing users ...
+one [administrator]
+foo [administrator, tag1, tag2]
+icinga [monitoring]
+kitchen []
+kitchen2 [abc, def, ghi]
+...done.
+EOT
+ @provider.expects(:rabbitmqctl).with('set_user_tags', 'foo', ["administrator","tag1","tag3","tag7"])
+ @provider.tags=['tag1','tag7','tag3']
+ end
+
+ it 'should create user with tags and without admin' do
+ @resource[:tags] = [ "tag1", "tag2" ]
+ @provider.expects(:rabbitmqctl).with('add_user', 'foo', 'bar')
+ @provider.expects(:rabbitmqctl).with('set_user_tags', 'foo', ["tag1","tag2"])
+ @provider.expects(:rabbitmqctl).with('list_users').returns <<-EOT
+Listing users ...
+foo []
+...done.
+EOT
+ @provider.create
+ end
+
+ it 'should create user with tags and with admin' do
+ @resource[:tags] = [ "tag1", "tag2" ]
+ @resource[:admin] = true
+ @provider.expects(:rabbitmqctl).with('add_user', 'foo', 'bar')
+ @provider.expects(:rabbitmqctl).with('list_users').twice.returns <<-EOT
+Listing users ...
+foo []
+...done.
+EOT
+ @provider.expects(:rabbitmqctl).with('set_user_tags', 'foo', ["administrator"])
+ @provider.expects(:rabbitmqctl).with('set_user_tags', 'foo', ["administrator","tag1","tag2"])
+ @provider.create
+ end
+
+
end
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/templates/rabbitmq.config.erb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/templates/rabbitmq.config.erb
index 766192dfdac..2d7f81bf21d 100644
--- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/templates/rabbitmq.config.erb
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/templates/rabbitmq.config.erb
@@ -9,7 +9,10 @@
{cluster_nodes, {[<%= @r_cluster_nodes.map { |n| "\'rabbit@#{n}\'" }.join(', ') %>], <%= @cluster_node_type %>}},
{cluster_partition_handling, <%= @cluster_partition_handling %>},
<% end -%>
-<%- if @ssl %>
+<%- if @ssl_only -%>
+ {tcp_listeners, []},
+<%- end -%>
+<%- if @ssl -%>
{ssl_listeners, [<%= @ssl_management_port %>]},
{ssl_options, [{cacertfile,"<%= @ssl_cacert %>"},
{certfile,"<%= @ssl_cert %>"},
@@ -37,6 +40,7 @@
{ssl_listeners, [<%= @ssl_stomp_port %>]}
<%- end -%>
]}
+<% end -%>
<%- if @ldap_auth -%>,
% Configure the LDAP authentication plugin
{rabbitmq_auth_backend_ldap, [
@@ -47,7 +51,6 @@
{port, <%= @ldap_port %>},
{log, <%= @ldap_log %>}
]}
-<% end -%>
<%- end -%>
].
% EOF
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/sqlite/Modulefile b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/sqlite/Modulefile
new file mode 100644
index 00000000000..19228ff3dbb
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/sqlite/Modulefile
@@ -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'
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/sqlite/README.md b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/sqlite/README.md
new file mode 100644
index 00000000000..1eb43afa55e
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/sqlite/README.md
@@ -0,0 +1,32 @@
+sqlite
+======
+
+Author: Carl Caum
+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
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/sqlite/manifests/db.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/sqlite/manifests/db.pp
new file mode 100644
index 00000000000..8b780462e9e
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/sqlite/manifests/db.pp
@@ -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,
+ }
+}
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/sqlite/manifests/init.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/sqlite/manifests/init.pp
new file mode 100644
index 00000000000..46b25062812
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/sqlite/manifests/init.pp
@@ -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,
+ }
+}
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/sqlite/metadata.json b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/sqlite/metadata.json
new file mode 100644
index 00000000000..8ce7797ff33
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/sqlite/metadata.json
@@ -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. |
+| |
++-----------------------------------------------------------------------+
+*/
+
+{}
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/sqlite/spec/spec.opts b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/sqlite/spec/spec.opts
new file mode 100644
index 00000000000..91cd6427ed6
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/sqlite/spec/spec.opts
@@ -0,0 +1,6 @@
+--format
+s
+--colour
+--loadby
+mtime
+--backtrace
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/sqlite/spec/spec_helper.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/sqlite/spec/spec_helper.rb
new file mode 100644
index 00000000000..a4aeeae232f
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/sqlite/spec/spec_helper.rb
@@ -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
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/sqlite/tests/init.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/sqlite/tests/init.pp
new file mode 100644
index 00000000000..520d095142b
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/sqlite/tests/init.pp
@@ -0,0 +1 @@
+include sqlite
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/colorbox/border.png b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/colorbox/border.png
index df13bb6daf7..bc04508aae3 100644
Binary files a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/colorbox/border.png and b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/colorbox/border.png differ
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/colorbox/controls.png b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/colorbox/controls.png
index 65cfd1dc95c..57fe953b7e5 100644
Binary files a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/colorbox/controls.png and b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/colorbox/controls.png differ
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/colorbox/loading_background.png b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/colorbox/loading_background.png
index 9de11f46719..2d8598bf8cb 100644
Binary files a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/colorbox/loading_background.png and b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/colorbox/loading_background.png differ
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/favicon_green.png b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/favicon_green.png
index 74db330cd05..7cf67ed1993 100644
Binary files a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/favicon_green.png and b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/favicon_green.png differ
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/favicon_red.png b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/favicon_red.png
index fbe093a5511..1460b78d120 100644
Binary files a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/favicon_red.png and b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/favicon_red.png differ
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/favicon_yellow.png b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/favicon_yellow.png
index e53847ea09a..e7d18257f11 100644
Binary files a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/favicon_yellow.png and b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/favicon_yellow.png differ
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/magnify.png b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/magnify.png
index 6073b9530ed..2a5079f4c4c 100644
Binary files a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/magnify.png and b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/magnify.png differ
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png
index 5b5dab2ab7b..68aa3f48d06 100644
Binary files a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png and b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png differ
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/smoothness/images/ui-bg_flat_75_ffffff_40x100.png b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/smoothness/images/ui-bg_flat_75_ffffff_40x100.png
index ac8b229af95..2b49a7ae745 100644
Binary files a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/smoothness/images/ui-bg_flat_75_ffffff_40x100.png and b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/smoothness/images/ui-bg_flat_75_ffffff_40x100.png differ
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png
index ad3d6346e00..4b38ff2d7f6 100644
Binary files a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png and b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png differ
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/smoothness/images/ui-bg_glass_65_ffffff_1x400.png b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/smoothness/images/ui-bg_glass_65_ffffff_1x400.png
index 42ccba269b6..5c0c93f1e9f 100644
Binary files a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/smoothness/images/ui-bg_glass_65_ffffff_1x400.png and b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/smoothness/images/ui-bg_glass_65_ffffff_1x400.png differ
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/smoothness/images/ui-bg_glass_75_dadada_1x400.png b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/smoothness/images/ui-bg_glass_75_dadada_1x400.png
index 5a46b47cb16..43d3253fc7e 100644
Binary files a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/smoothness/images/ui-bg_glass_75_dadada_1x400.png and b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/smoothness/images/ui-bg_glass_75_dadada_1x400.png differ
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png
index 86c2baa655e..8265061241d 100644
Binary files a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png and b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png differ
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png
index 4443fdc1a15..c6270881b87 100644
Binary files a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png and b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png differ
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png
index 7c9fa6c6edc..67e0eb9b4d1 100644
Binary files a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png and b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png differ
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/smoothness/images/ui-icons_222222_256x240.png b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/smoothness/images/ui-icons_222222_256x240.png
index b273ff111d2..192e2b85257 100644
Binary files a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/smoothness/images/ui-icons_222222_256x240.png and b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/smoothness/images/ui-icons_222222_256x240.png differ
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/smoothness/images/ui-icons_2e83ff_256x240.png b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/smoothness/images/ui-icons_2e83ff_256x240.png
index 09d1cdc856c..88442a01937 100644
Binary files a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/smoothness/images/ui-icons_2e83ff_256x240.png and b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/smoothness/images/ui-icons_2e83ff_256x240.png differ
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/smoothness/images/ui-icons_454545_256x240.png b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/smoothness/images/ui-icons_454545_256x240.png
index 59bd45b907c..327cc6d4614 100644
Binary files a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/smoothness/images/ui-icons_454545_256x240.png and b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/smoothness/images/ui-icons_454545_256x240.png differ
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/smoothness/images/ui-icons_888888_256x240.png b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/smoothness/images/ui-icons_888888_256x240.png
index 6d02426c114..c71c1446075 100644
Binary files a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/smoothness/images/ui-icons_888888_256x240.png and b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/smoothness/images/ui-icons_888888_256x240.png differ
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/smoothness/images/ui-icons_cd0a0a_256x240.png b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/smoothness/images/ui-icons_cd0a0a_256x240.png
index 2ab019b73ec..30c8c0d35b8 100644
Binary files a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/smoothness/images/ui-icons_cd0a0a_256x240.png and b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/smoothness/images/ui-icons_cd0a0a_256x240.png differ
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/.fixtures.yml b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/.fixtures.yml
index 15f96922e01..3f18ef2fca2 100644
--- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/.fixtures.yml
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/.fixtures.yml
@@ -1,6 +1,10 @@
fixtures:
repositories:
- stdlib: "git://github.com/puppetlabs/puppetlabs-stdlib"
- concat: "git://github.com/puppetlabs/puppetlabs-concat"
+ 'stdlib':
+ repo: 'git://github.com/puppetlabs/puppetlabs-stdlib'
+ ref: '4.1.0'
+ 'concat':
+ repo: 'git://github.com/puppetlabs/puppetlabs-concat'
+ ref: '1.0.1'
symlinks:
supervisord: "#{source_dir}"
\ No newline at end of file
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/.travis.yml b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/.travis.yml
index 6e544518c19..bc96a165e59 100644
--- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/.travis.yml
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/.travis.yml
@@ -1,21 +1,28 @@
language: ruby
bundler_args: --without development
-script: "bundle exec rake spec lint"
+script: "bundle exec rake test"
rvm:
- 1.8.7
- 1.9.3
- 2.0.0
env:
- matrix:
- - PUPPET_GEM_VERSION="~> 2.7.0"
- - PUPPET_GEM_VERSION="~> 3.3.0"
- - PUPPET_GEM_VERSION="~> 3.4.0"
+ - PUPPET_VERSION="~> 2.7.0"
+ - PUPPET_VERSION="~> 3.1.0"
+ - PUPPET_VERSION="~> 3.2.0"
+ - PUPPET_VERSION="~> 3.3.0"
+ - PUPPET_VERSION="~> 3.4.0"
+ - PUPPET_VERSION="~> 3.5.0"
+ - PUPPET_VERSION="~> 3.6.0"
matrix:
exclude:
- - rvm: 1.9.3
- env: PUPPET_GEM_VERSION="~> 2.7.0"
- rvm: 2.0.0
- env: PUPPET_GEM_VERSION="~> 2.7.0"
+ env: PUPPET_VERSION="~> 2.7.0"
+ - rvm: 1.9.3
+ env: PUPPET_VERSION="~> 2.7.0"
+ - rvm: 2.0.0
+ env: PUPPET_VERSION="~> 3.1.0"
+ - rvm: 1.8.7
+ env: PUPPET_VERSION="~> 3.2.0"
notifications:
email: false
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/Changelog b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/Changelog
index ab4faa445ff..ea933f5dbcb 100644
--- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/Changelog
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/Changelog
@@ -1,3 +1,72 @@
+2014-07-02 - v0.4.1
+
+Fixes:
+
+- Fixed status code error on supervisord::supervisorctl commands, thanks to @jtreminio for the PR.
+
+2014-06-20 - v0.4.0
+
+Fixes:
+
+- Removed root as group and replaced with uid 0 to enhance system
+compatibility
+
+Enhancements:
+
+- Made package provider a user definable param see supervisord::package_provider and README for details of how to change this.
+- All define types can now be automatically pulled in from hiera see example https://github.com/ajcrowe/puppet-supervisord#configure-a-program
+- You can now override the default include path of $config_include/*.conf with your own array using $config_dirs. Bear in mind this would need to include whatever you set $config_include to be, with *.conf on the end.
+
+Many thanks for the PRs from @jasperla, @mvantellingen for the bug report on the service name and @hasc for the enhancement ideas.
+
+2014-06-06 - v0.3.3
+
+Fixes:
+
+- Fixed typo in stopwaitsec param, should have been stopwaitsecs, thanks to @rchrd2
+
+2014-05-03 - v0.3.2
+
+Changes:
+
+- Added supervisord::executable_ctl variable for supervisorctl binary path, thanks to @bpgoldsb
+
+2014-04-22 - v0.3.1
+
+Fixes:
+
+- Fixed typo in unix_socket_group param, thanks to @dig412
+
+2014-03-11 - v0.3.0
+
+Fixes:
+
+- Fixed typo in fcgi config
+- Fixed typo in supervisord config with minfds and minprocs, thanks to @peefourtee
+- Typo in README fixed thanks to @hopkinsth
+- Removed refreshonly from pip_install exec resource
+- Number of syntax fixes thanks to `puppet lint`
+
+Important Changes:
+
+- Lots of input validation has been added **PLEASE** check your config works before upgrading!
+- Changed init_extras naming to defaults and cleaned things up.
+- Starting and stopping apps is now done with supervisorctl commands to avoid service restarts
+
+Other Changes:
+
+- CSV functions now order things consistently
+- Included description for classes and functions
+- Expanded spec testing built with Travis CI
+- Added beaker acceptance tests
+- Added greater validation of various parameters
+- Added coverage reporting for resources
+
+To-Do:
+
+- Add support for additional OS families such as Solaris.
+
+
2013-10-31 - v0.2.3
Fixes:
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/Gemfile b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/Gemfile
index 8612255f5b8..ba9a19d533a 100644
--- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/Gemfile
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/Gemfile
@@ -1,14 +1,26 @@
source 'https://rubygems.org'
-group :development, :test do
+group :test do
gem 'rake'
- gem 'puppetlabs_spec_helper', :require => false
- gem 'rspec-system-puppet', '~> 2.0'
- gem 'puppet-lint', '~> 0.3.2'
+ gem 'puppet-lint'
+ gem 'puppet-syntax'
+ gem 'puppetlabs_spec_helper'
+ gem 'rspec-puppet', :git => 'https://github.com/rodjek/rspec-puppet.git' , :ref => 'c44381a240ec420d4ffda7bffc55ee4d9c08d682'
+ gem 'rspec', '2.14.1'
end
-if puppetversion = ENV['PUPPET_GEM_VERSION']
- gem 'puppet', puppetversion, :require => false
-else
- gem 'puppet', :require => false
+group :development do
+ gem 'travis'
+ gem 'travis-lint'
+ gem 'beaker'
+ gem 'beaker-rspec'
+ gem 'pry'
+ gem 'guard-rake'
+end
+
+
+if puppetversion = ENV['PUPPET_VERSION']
+ gem 'puppet', puppetversion
+else
+ gem 'puppet', '~> 3.4.0'
end
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/Modulefile b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/Modulefile
index 4a0552115da..80d47f22679 100644
--- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/Modulefile
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/Modulefile
@@ -1,5 +1,5 @@
name 'ajcrowe-supervisord'
-version '0.2.3'
+version '0.4.1'
source 'git@github.com/ajcrowe/puppet-supervisord.git'
author 'Alex Crowe'
license 'Apache License, Version 2.0'
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/README.md b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/README.md
index a8419a09082..b454cd9307a 100644
--- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/README.md
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/README.md
@@ -4,7 +4,7 @@
Puppet module to manage the [supervisord](http://supervisord.org/) process control system.
-Functions available to configure
+Functions available to configure
* [programs](http://supervisord.org/configuration.html#program-x-section-settings)
* [groups](http://supervisord.org/configuration.html#group-x-section-settings)
@@ -31,10 +31,16 @@ class supervisord {
}
```
-This will download [setuptool](https://bitbucket.org/pypa/setuptools) and install pip with easy_install.
+This will download [setuptool](https://bitbucket.org/pypa/setuptools) and install pip with easy_install.
You can pass a specific url with `$setuptools_url = 'url'`
+### Install without pip
+
+If you want to use your system package manager you can specify that with `supervisord::package_provider`.
+
+You'll also likely need to adjust the `supervisord::service_name` to match that installed by the system package. If you're using Debian or Redhat OS families you'll also want to disable the init scripts with `supervisord::install_init = false`.
+
Note: Only Debian and RedHat families have an init script currently.
### Configure a program
@@ -61,23 +67,61 @@ supervisord::program { 'myprogram':
}
```
+Or you can fully define your programs in hiera:
+
+```yaml
+supervisord::programs:
+ 'myprogram':
+ command: 'command --args'
+ autostart: yes
+ autorestart: 'true'
+ environment:
+ HOME: '/home/myuser'
+ PATH: '/bin:/sbin:/usr/bin:/usr/sbin'
+ SECRET: 'mysecret'
+```
+
### Configure a group
```ruby
supervisord::group { 'mygroup':
priority => 100,
- program => ['program1', 'program2', 'program3']
+ programs => ['program1', 'program2', 'program3']
}
```
+### Configure an eventlistener
+
+```ruby
+supervisord::eventlistener { 'mylistener':
+ command => 'command --args',
+ events => ['PROCESS_STATE', 'PROCESS_STATE_START']
+ priority => '100',
+ env_var => 'my_common_envs'
+}
+```
+
+### Run supervisorctl Commands
+
+Should you need to run a sequence of command with `supervisorctl` you can use the define type `supervisord::supervisorctl`
+
+```ruby
+supervisord::supervisorctl { 'restart_myapp':
+ command => 'restart',
+ process => 'myapp'
+}
+```
+
+You can also issue a command without specifying a process.
+
### Development
If you have suggestions or improvements please file an issue or pull request, i'll try and sort them as quickly as possble.
-If you submit a pull please try and include tests for the new functionality. The module is tested with [Travis-CI](https://travis-ci.org/ajcrowe/puppet-supervisord).
+If you submit a pull please try and include tests for the new functionality/fix. The module is tested with [Travis-CI](https://travis-ci.org/ajcrowe/puppet-supervisord).
### Credits
* Debian init script sourced from the system package.
-* RedHat/Centos init script sourced from https://github.com/Supervisor/initscripts
+* RedHat/Centos init script sourced from https://github.com/Supervisor/initscripts
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/Rakefile b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/Rakefile
index e00f7d11877..cd592af48f4 100644
--- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/Rakefile
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/Rakefile
@@ -1,7 +1,28 @@
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-lint/tasks/puppet-lint'
-require 'rspec-system/rake_task'
+require 'puppet-syntax/tasks/puppet-syntax'
PuppetLint.configuration.send('disable_80chars')
PuppetLint.configuration.send('disable_class_inherits_from_params_class')
-PuppetLint.configuration.send('disable_documentation')
+PuppetLint.configuration.send('disable_quoted_booleans')
+PuppetLint.configuration.send('disable_autoloader_layout')
+
+exclude_paths = [
+ "pkg/**/*",
+ "vendor/**/*",
+ "spec/**/*",
+]
+PuppetLint.configuration.ignore_paths = exclude_paths
+PuppetSyntax.exclude_paths = exclude_paths
+
+desc "Acceptance Tests"
+RSpec::Core::RakeTask.new(:acceptance) do |t|
+ t.pattern = 'spec/acceptance'
+end
+
+desc "Test Suite"
+task :test => [
+ :lint,
+ :syntax,
+ :spec
+]
\ No newline at end of file
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/lib/puppet/parser/functions/array2csv.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/lib/puppet/parser/functions/array2csv.rb
index cfa52b2bbf2..6d34d5d5474 100644
--- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/lib/puppet/parser/functions/array2csv.rb
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/lib/puppet/parser/functions/array2csv.rb
@@ -1,14 +1,12 @@
#
# Converts the array to a csv string
#
-#
# $array = [ 'string1', 'string2', 'string3' ]
#
# becomes:
#
# $string = "string1,string2,string3"
#
-
module Puppet::Parser::Functions
newfunction(:array2csv, :type => :rvalue, :doc => <<-'EOS'
Returns a sorted csv formatted string from an array in the form
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/lib/puppet/parser/functions/hash2csv.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/lib/puppet/parser/functions/hash2csv.rb
index 6098b67367d..5371328f2ff 100644
--- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/lib/puppet/parser/functions/hash2csv.rb
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/lib/puppet/parser/functions/hash2csv.rb
@@ -1,7 +1,6 @@
#
# Converts the hash to a csv string
#
-#
# $hash = {
# HOME => '/home/user',
# ENV1 => 'env1',
@@ -12,7 +11,6 @@
#
# $string = "HOME='/home/user',ENV1='env1',SECRET='secret'"
#
-
module Puppet::Parser::Functions
newfunction(:hash2csv, :type => :rvalue, :doc => <<-'EOS'
Returns a csv formatted string from an hash in the form
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/config.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/config.pp
index cc8b1ee49d0..93713729e8b 100644
--- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/config.pp
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/config.pp
@@ -1,6 +1,16 @@
+# Class: supervisord::config
+#
+# Configuration class for supervisor init and conf directories
+#
class supervisord::config inherits supervisord {
- file { [ "${supervisord::config_include}", "${supervisord::log_path}"]:
+ file { $supervisord::config_include:
+ ensure => directory,
+ owner => 'root',
+ mode => '0755'
+ }
+
+ file { $supervisord::log_path:
ensure => directory,
owner => 'root',
mode => '0755'
@@ -15,30 +25,26 @@ class supervisord::config inherits supervisord {
}
if $supervisord::install_init {
-
- $osname = downcase($::osfamily)
-
file { '/etc/init.d/supervisord':
ensure => present,
owner => 'root',
mode => '0755',
- content => template("supervisord/init/${osname}_init.erb")
+ content => template("supervisord/init/${::osfamily}/init.erb")
}
- if $supervisord::init_extras {
- file { $supervisord::init_extras:
+ if $supervisord::init_defaults {
+ file { $supervisord::init_defaults:
ensure => present,
owner => 'root',
mode => '0755',
- content => template("supervisord/init/${osname}_extra.erb")
+ content => template("supervisord/init/${::osfamily}/defaults.erb")
}
}
-
}
concat { $supervisord::config_file:
owner => 'root',
- group => 'root',
+ group => '0',
mode => '0755'
}
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/eventlistener.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/eventlistener.pp
index 41b7cf6c730..fd52d6e4da4 100644
--- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/eventlistener.pp
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/eventlistener.pp
@@ -1,8 +1,16 @@
+# Define: supervisord::eventlistener
+#
+# This define creates an eventlistener configuration file
+#
+# Documentation on parameters available at:
+# http://supervisord.org/configuration.html#eventlistener-x-section-settings
+#
define supervisord::eventlistener(
$command,
$ensure = present,
+ $ensure_process = 'running',
+ $buffer_size = 10,
$events = undef,
- $buffer_size = undef,
$result_handler = undef,
$env_var = undef,
$process_name = undef,
@@ -15,16 +23,16 @@ define supervisord::eventlistener(
$startretries = undef,
$exitcodes = undef,
$stopsignal = undef,
- $stopwaitsec = undef,
+ $stopwaitsecs = undef,
$stopasgroup = undef,
$killasgroup = undef,
$user = undef,
$redirect_stderr = undef,
- $stdout_logfile = "${supervisord::log_path}/eventlistener_${name}.log",
+ $stdout_logfile = "eventlistener_${name}.log",
$stdout_logfile_maxbytes = undef,
$stdout_logfile_backups = undef,
$stdout_events_enabled = undef,
- $stderr_logfile = "${supervisord::log_path}/eventlistener_${name}.error",
+ $stderr_logfile = "eventlistener_${name}.error",
$stderr_logfile_maxbytes = undef,
$stderr_logfile_backups = undef,
$stderr_events_enabled = undef,
@@ -36,11 +44,45 @@ define supervisord::eventlistener(
include supervisord
+ # parameter validation
+ validate_string($command)
+ validate_re($ensure_process, ['running', 'stopped', 'removed'])
+ validate_re($buffer_size, '^\d+')
+ if $events { validate_array($events) }
+ if $result_handler { validate_string($result_handler) }
+ if $numprocs { validate_re($numprocs, '^\d+')}
+ if $numprocs_start { validate_re($numprocs_start, '^\d+')}
+ if $priority { validate_re($priority, '^\d+') }
+ if $autostart { validate_bool($autostart) }
+ if $autorestart { validate_re($autorestart, ['true', 'false', 'unexpected']) }
+ if $startsecs { validate_re($startsecs, '^\d+')}
+ if $startretries { validate_re($startretries, '^\d+')}
+ if $exitcodes { validate_string($exitcodes)}
+ if $stopsignal { validate_re($stopsignal, ['TERM', 'HUP', 'INT', 'QUIT', 'KILL', 'USR1', 'USR2']) }
+ if $stopwaitsecs { validate_re($stopwaitsecs, '^\d+')}
+ if $stopasgroup { validate_bool($stopasgroup) }
+ if $killasgroup { validate_bool($killasgroup) }
+ if $user { validate_string($user) }
+ if $redirect_stderr { validate_bool($redirect_stderr) }
+ validate_string($stdout_logfile)
+ if $stdout_logfile_maxbytes { validate_string($stdout_logfile_maxbytes) }
+ if $stdout_logfile_backups { validate_re($stdout_logfile_backups, '^\d+')}
+ if $stdout_events_enabled { validate_bool($stdout_events_enabled) }
+ validate_string($stderr_logfile)
+ if $stderr_logfile_maxbytes { validate_string($stderr_logfile_maxbytes) }
+ if $stderr_logfile_backups { validate_re($stderr_logfile_backups, '^\d+')}
+ if $stderr_events_enabled { validate_bool($stderr_events_enabled) }
+ if $directory { validate_absolute_path($directory) }
+ if $umask { validate_re($umask, '^[0-7][0-7][0-7]$') }
+
+ # convert environment data into a csv
if $env_var {
- $env_hash = hiera($env_var)
+ $env_hash = hiera_hash($env_var)
+ validate_hash($env_hash)
$env_string = hash2csv($env_hash)
}
elsif $environment {
+ validate_hash($environment)
$env_string = hash2csv($environment)
}
@@ -55,6 +97,22 @@ define supervisord::eventlistener(
owner => 'root',
mode => '0755',
content => template('supervisord/conf/eventlistener.erb'),
- notify => Class['supervisord::service']
+ notify => Class['supervisord::reload']
+ }
+
+ case $ensure_process {
+ 'stopped': {
+ supervisord::supervisorctl { "stop_${name}":
+ command => 'stop',
+ process => $name
+ }
+ }
+ 'removed': {
+ supervisord::supervisorctl { "remove_${name}":
+ command => 'remove',
+ process => $name
+ }
+ }
+ default: { }
}
}
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/fcgi_program.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/fcgi_program.pp
index 923b1798bff..633b024917e 100644
--- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/fcgi_program.pp
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/fcgi_program.pp
@@ -1,7 +1,15 @@
+# Define: supervisord::fcgi_program
+#
+# This define creates an eventlistener configuration file
+#
+# Documentation on parameters available at:
+# http://supervisord.org/configuration.html#fcgi-program-x-section-settings
+#
define supervisord::fcgi_program(
$command,
$socket,
$ensure = present,
+ $ensure_process = 'running',
$socket_owner = undef,
$socket_mode = undef,
$env_var = undef,
@@ -15,17 +23,17 @@ define supervisord::fcgi_program(
$startretries = undef,
$exitcodes = undef,
$stopsignal = undef,
- $stopwaitsec = undef,
+ $stopwaitsecs = undef,
$stopasgroup = undef,
$killasgroup = undef,
$user = undef,
$redirect_stderr = undef,
- $stdout_logfile = "${supervisord::log_path}/fcgi-program_${name}.log",
+ $stdout_logfile = "fcgi-program_${name}.log",
$stdout_logfile_maxbytes = undef,
$stdout_logfile_backups = undef,
$stdout_capture_maxbytes = undef,
$stdout_events_enabled = undef,
- $stderr_logfile = "${supervisord::log_path}/fcgi-program_${name}.error",
+ $stderr_logfile = "fcgi-program_${name}.error",
$stderr_logfile_maxbytes = undef,
$stderr_logfile_backups = undef,
$stderr_capture_maxbytes = undef,
@@ -38,11 +46,46 @@ define supervisord::fcgi_program(
include supervisord
+ # parameter validation
+ validate_string($command)
+ validate_re($ensure_process, ['running', 'stopped', 'removed'])
+ validate_re($socket, ['^tcp:\/\/.*:\d+$', '^unix:\/\/\/'])
+ if $process_name { validate_string($process_name) }
+ if $numprocs { validate_re($numprocs, '^\d+')}
+ if $numprocs_start { validate_re($numprocs_start, '^\d+')}
+ if $priority { validate_re($priority, '^\d+') }
+ if $autostart { validate_bool($autostart) }
+ if $autorestart { validate_re($autorestart, ['true', 'false', 'unexpected']) }
+ if $startsecs { validate_re($startsecs, '^\d+')}
+ if $startretries { validate_re($startretries, '^\d+')}
+ if $exitcodes { validate_string($exitcodes)}
+ if $stopsignal { validate_re($stopsignal, ['TERM', 'HUP', 'INT', 'QUIT', 'KILL', 'USR1', 'USR2']) }
+ if $stopwaitsecs { validate_re($stopwaitsecs, '^\d+')}
+ if $stopasgroup { validate_bool($stopasgroup) }
+ if $killasgroup { validate_bool($killasgroup) }
+ if $user { validate_string($user) }
+ if $redirect_stderr { validate_bool($redirect_stderr) }
+ validate_string($stdout_logfile)
+ if $stdout_logfile_maxbytes { validate_string($stdout_logfile_maxbytes) }
+ if $stdout_logfile_backups { validate_re($stdout_logfile_backups, '^\d+')}
+ if $stdout_capture_maxbytes { validate_string($stdout_capture_maxbytes) }
+ if $stdout_events_enabled { validate_bool($stdout_events_enabled) }
+ validate_string($stderr_logfile)
+ if $stderr_logfile_maxbytes { validate_string($stderr_logfile_maxbytes) }
+ if $stderr_logfile_backups { validate_re($stderr_logfile_backups, '^\d+')}
+ if $stderr_capture_maxbytes { validate_string($stderr_capture_maxbytes) }
+ if $stderr_events_enabled { validate_bool($stderr_events_enabled) }
+ if $directory { validate_absolute_path($directory) }
+ if $umask { validate_re($umask, '^[0-7][0-7][0-7]$') }
+
+ # convert environment data into a csv
if $env_var {
- $env_hash = hiera($env_var)
+ $env_hash = hiera_hash($env_var)
+ validate_hash($env_hash)
$env_string = hash2csv($env_hash)
}
elsif $environment {
+ validate_hash($environment)
$env_string = hash2csv($environment)
}
@@ -53,6 +96,22 @@ define supervisord::fcgi_program(
owner => 'root',
mode => '0755',
content => template('supervisord/conf/fcgi_program.erb'),
- notify => Class['supervisord::service']
+ notify => Class['supervisord::reload']
+ }
+
+ case $ensure_process {
+ 'stopped': {
+ supervisord::supervisorctl { "stop_${name}":
+ command => 'stop',
+ process => $name
+ }
+ }
+ 'removed': {
+ supervisord::supervisorctl { "remove_${name}":
+ command => 'remove',
+ process => $name
+ }
+ }
+ default: { }
}
}
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/group.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/group.pp
index 0f6b1ca2adc..45cb29cf290 100644
--- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/group.pp
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/group.pp
@@ -1,3 +1,10 @@
+# Define: supervisord::group
+#
+# This define creates an group configuration file
+#
+# Documentation on parameters available at:
+# http://supervisord.org/configuration.html#group-x-section-settings
+#
define supervisord::group (
$programs,
$ensure = present,
@@ -6,6 +13,10 @@ define supervisord::group (
include supervisord
+ # parameter validation
+ validate_array($programs)
+ if $priority { validate_re($priority, '^\d+', "invalid priority value of: ${priority}") }
+
$progstring = array2csv($programs)
$conf = "${supervisord::config_include}/group_${name}.conf"
@@ -13,6 +24,7 @@ define supervisord::group (
ensure => $ensure,
owner => 'root',
mode => '0755',
- content => template('supervisord/conf/group.erb')
+ content => template('supervisord/conf/group.erb'),
+ notify => Class['supervisord::reload']
}
}
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/init.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/init.pp
index 801c46b3b36..fa396da578d 100644
--- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/init.pp
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/init.pp
@@ -1,12 +1,20 @@
-# This class installs supervisord and configured it to run on boot
+# Class: supervisord
+#
+# This class installs supervisord via pip
+#
class supervisord(
$package_ensure = $supervisord::params::package_ensure,
+ $package_name = $supervisord::params::package_name,
+ $package_provider = $supervisord::params::package_provider,
$service_ensure = $supervisord::params::service_ensure,
+ $service_name = $supervisord::params::service_name,
$install_init = $supervisord::params::install_init,
$install_pip = false,
- $init_extras = $supervisord::params::init_extras,
+ $init_defaults = $supervisord::params::init_defaults,
$setuptools_url = $supervisord::params::setuptools_url,
+ $executable_path = $supervisord::params::executable_path,
$executable = $supervisord::params::executable,
+ $executable_ctl = $supervisord::params::executable_ctl,
$log_path = $supervisord::params::log_path,
$log_file = $supervisord::params::log_file,
@@ -19,20 +27,20 @@ class supervisord(
$nodaemon = $supervisord::params::nodaemon,
$minfds = $supervisord::params::minfds,
$minprocs = $supervisord::params::minprocs,
- $config_path = $supervisord::params::config_path,
$config_include = $supervisord::params::config_include,
$config_file = $supervisord::params::config_file,
+ $config_dirs = undef,
$umask = $supervisord::params::umask,
$unix_socket = $supervisord::params::unix_socket,
$unix_socket_file = $supervisord::params::unix_socket_file,
$unix_socket_mode = $supervisord::params::unix_socket_mode,
$unix_socket_owner = $supervisord::params::unix_socket_owner,
- $unix_scoket_group = $supervisord::params::unix_socket_group,
+ $unix_socket_group = $supervisord::params::unix_socket_group,
$inet_server = $supervisord::params::inet_server,
- $inet_server_hostname = $supervisord::params::inet_hostname,
- $inet_server_port = $supervisord::params::inet_port,
+ $inet_server_hostname = $supervisord::params::inet_server_hostname,
+ $inet_server_port = $supervisord::params::inet_server_port,
$unix_auth = false,
$unix_username = undef,
@@ -47,26 +55,76 @@ class supervisord(
$childlogdir = undef,
$environment = undef,
$env_var = undef,
+ $directory = undef,
$strip_ansi = false,
- $nocleanup = false
+ $nocleanup = false,
+
+ $eventlisteners = {},
+ $fcgi_programs = {},
+ $groups = {},
+ $programs = {}
) inherits supervisord::params {
+ validate_bool($install_pip)
+ validate_bool($install_init)
+ validate_bool($nodaemon)
+ validate_bool($unix_auth)
+ validate_bool($inet_auth)
+ validate_bool($strip_ansi)
+ validate_bool($nocleanup)
+
+ validate_hash($eventlisteners)
+ validate_hash($fcgi_programs)
+ validate_hash($groups)
+ validate_hash($programs)
+
+ validate_absolute_path($config_include)
+ validate_absolute_path($log_path)
+ validate_absolute_path($run_path)
+ if $childlogdir { validate_absolute_path($childlogdir) }
+ if $directory { validate_absolute_path($directory) }
+
+ $log_levels = ['^critical$', '^error$', '^warn$', '^info$', '^debug$', '^trace$', '^blather$']
+ validate_re($log_level, $log_levels, "invalid log_level: ${log_level}")
+ validate_re($umask, '^0[0-7][0-7]$', "invalid umask: ${umask}.")
+ validate_re($unix_socket_mode, '^[0-7][0-7][0-7][0-7]$', "invalid unix_socket_mode: ${unix_socket_mode}")
+
+ if ! is_integer($logfile_backups) { fail("invalid logfile_backups: ${logfile_backups}.")}
+ if ! is_integer($minfds) { fail("invalid minfds: ${minfds}.")}
+ if ! is_integer($minprocs) { fail("invalid minprocs: ${minprocs}.")}
+ if ! is_integer($inet_server_port) { fail("invalid inet_server_port: ${inet_server_port}.")}
+
if $env_var {
+ validate_hash($env_var)
$env_hash = hiera($env_var)
$env_string = hash2csv($env_hash)
}
elsif $environment {
+ validate_hash($environment)
$env_string = hash2csv($environment)
}
+ if $config_dirs {
+ validate_array($config_dirs)
+ $config_include_string = join($config_dirs, " ")
+ }
+ else {
+ $config_include_string = "${config_include}/*.conf"
+ }
+
+ create_resources('supervisord::eventlistener', $eventlisteners)
+ create_resources('supervisord::fcgi_program', $fcgi_programs)
+ create_resources('supervisord::group', $groups)
+ create_resources('supervisord::program', $programs)
+
if $install_pip {
include supervisord::pip
Class['supervisord::pip'] -> Class['supervisord::install']
}
- include supervisord::install, supervisord::config, supervisord::service
+ include supervisord::install, supervisord::config, supervisord::service, supervisord::reload
Class['supervisord::install'] -> Class['supervisord::config'] ~> Class['supervisord::service']
-
+ Class['supervisord::reload'] -> Supervisord::Supervisorctl <| |>
}
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/install.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/install.pp
index 1d36ec68334..387c77f5cba 100644
--- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/install.pp
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/install.pp
@@ -1,6 +1,10 @@
+# Class supervisord::install
+#
+# Installs supervisor package (defaults to using pip)
+#
class supervisord::install inherits supervisord {
- package { 'supervisor':
+ package { $supervisord::package_name:
ensure => $supervisord::package_ensure,
- provider => 'pip'
+ provider => $supervisord::package_provider
}
}
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/params.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/params.pp
index 87d17d16179..47a21852e01 100644
--- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/params.pp
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/params.pp
@@ -1,13 +1,42 @@
+# Class: supervisord::params
+#
+# Default parameters for supervisord
+#
class supervisord::params {
+ case $::osfamily {
+ 'RedHat': {
+ $init_defaults = '/etc/sysconfig/supervisord'
+ $unix_socket_group = 'nobody'
+ $install_init = true
+ $executable_path = '/usr/bin'
+ }
+ 'Debian': {
+ $init_defaults = '/etc/default/supervisor'
+ $unix_socket_group = 'nogroup'
+ $install_init = true
+ $executable_path = '/usr/local/bin'
+ }
+ default: {
+ $init_defaults = false
+ $unix_socket_group = 'nogroup'
+ $install_init = false
+ $executable_path = '/usr/local/bin'
+ }
+ }
+
+ # default supervisord params
$package_ensure = 'installed'
+ $package_provider = 'pip'
$service_ensure = 'running'
+ $service_name = 'supervisord'
$package_name = 'supervisor'
- $executable = '/usr/local/bin/supervisord'
+ $executable = "${$executable_path}/supervisord"
+ $executable_ctl = "${executable_path}/supervisorctl"
$run_path = '/var/run'
- $pid_file = "${run_path}/supervisord.pid"
+ $pid_file = 'supervisord.pid'
$log_path = '/var/log/supervisor'
- $log_file = "${log_path}/supervisord.log"
+ $log_file = 'supervisord.log'
$logfile_maxbytes = '50MB'
$logfile_backups = '10'
$log_level = 'info'
@@ -20,7 +49,7 @@ class supervisord::params {
$setuptools_url = 'https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py'
$unix_socket = true
- $unix_socket_file = "${run_path}/supervisor.sock"
+ $unix_socket_file = 'supervisor.sock'
$unix_socket_mode = '0700'
$unix_socket_owner = 'nobody'
@@ -28,22 +57,4 @@ class supervisord::params {
$inet_server_hostname = '127.0.0.1'
$inet_server_port = '9001'
$inet_auth = false
-
- case $::osfamily {
- 'RedHat': {
- $init_extras = '/etc/sysconfig/supervisord'
- $unix_socket_group = 'nobody'
- $install_init = true
- }
- 'Debian': {
- $init_extras = '/etc/default/supervisor'
- $unix_socket_group = 'nogroup'
- $install_init = true
- }
- default: {
- $init_extras = false
- $unix_socket_group = 'nogroup'
- $install_init = false
- }
- }
}
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/pip.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/pip.pp
index c05f2d7f64b..dcf57223498 100644
--- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/pip.pp
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/pip.pp
@@ -1,3 +1,7 @@
+# Class: supervisord::pip
+#
+# Optional class to install setuptool and pip
+#
class supervisord::pip inherits supervisord {
Exec {
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/program.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/program.pp
index 8a00d41c77c..617a68ab208 100644
--- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/program.pp
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/program.pp
@@ -1,6 +1,14 @@
+# Define: supervisord::program
+#
+# This define creates an program configuration file
+#
+# Documentation on parameters available at:
+# http://supervisord.org/configuration.html#program-x-section-settings
+#
define supervisord::program(
$command,
$ensure = present,
+ $ensure_process = 'running',
$env_var = undef,
$process_name = undef,
$numprocs = undef,
@@ -12,17 +20,17 @@ define supervisord::program(
$startretries = undef,
$exitcodes = undef,
$stopsignal = undef,
- $stopwaitsec = undef,
+ $stopwaitsecs = undef,
$stopasgroup = undef,
$killasgroup = undef,
$user = undef,
$redirect_stderr = undef,
- $stdout_logfile = "${supervisord::log_path}/program_${name}.log",
+ $stdout_logfile = "program_${name}.log",
$stdout_logfile_maxbytes = undef,
$stdout_logfile_backups = undef,
$stdout_capture_maxbytes = undef,
$stdout_events_enabled = undef,
- $stderr_logfile = "${supervisord::log_path}/program_${name}.error",
+ $stderr_logfile = "program_${name}.error",
$stderr_logfile_maxbytes = undef,
$stderr_logfile_backups = undef,
$stderr_capture_maxbytes = undef,
@@ -35,11 +43,45 @@ define supervisord::program(
include supervisord
+ # parameter validation
+ validate_string($command)
+ validate_re($ensure_process, ['running', 'stopped', 'removed'])
+ if $process_name { validate_string($process_name) }
+ if $numprocs { validate_re($numprocs, '^\d+')}
+ if $numprocs_start { validate_re($numprocs_start, '^\d+')}
+ if $priority { validate_re($priority, '^\d+') }
+ if $autostart { validate_bool($autostart) }
+ if $autorestart { validate_re($autorestart, ['true', 'false', 'unexpected']) }
+ if $startsecs { validate_re($startsecs, '^\d+')}
+ if $startretries { validate_re($startretries, '^\d+')}
+ if $exitcodes { validate_string($exitcodes)}
+ if $stopsignal { validate_re($stopsignal, ['TERM', 'HUP', 'INT', 'QUIT', 'KILL', 'USR1', 'USR2']) }
+ if $stopwaitsecs { validate_re($stopwaitsecs, '^\d+')}
+ if $stopasgroup { validate_bool($stopasgroup) }
+ if $killasgroup { validate_bool($killasgroup) }
+ if $user { validate_string($user) }
+ if $redirect_stderr { validate_bool($redirect_stderr) }
+ validate_string($stdout_logfile)
+ if $stdout_logfile_maxbytes { validate_string($stdout_logfile_maxbytes) }
+ if $stdout_logfile_backups { validate_re($stdout_logfile_backups, '^\d+')}
+ if $stdout_capture_maxbytes { validate_string($stdout_capture_maxbytes) }
+ if $stdout_events_enabled { validate_bool($stdout_events_enabled) }
+ validate_string($stderr_logfile)
+ if $stderr_logfile_maxbytes { validate_string($stderr_logfile_maxbytes) }
+ if $stderr_logfile_backups { validate_re($stderr_logfile_backups, '^\d+')}
+ if $stderr_capture_maxbytes { validate_string($stderr_capture_maxbytes) }
+ if $stderr_events_enabled { validate_bool($stderr_events_enabled) }
+ if $directory { validate_absolute_path($directory) }
+ if $umask { validate_re($umask, '^[0-7][0-7][0-7]$') }
+
+ # convert environment data into a csv
if $env_var {
- $env_hash = hiera($env_var)
+ $env_hash = hiera_hash($env_var)
+ validate_hash($env_hash)
$env_string = hash2csv($env_hash)
}
elsif $environment {
+ validate_hash($environment)
$env_string = hash2csv($environment)
}
@@ -50,6 +92,22 @@ define supervisord::program(
owner => 'root',
mode => '0755',
content => template('supervisord/conf/program.erb'),
- notify => Class['supervisord::service']
+ notify => Class['supervisord::reload']
+ }
+
+ case $ensure_process {
+ 'stopped': {
+ supervisord::supervisorctl { "stop_${name}":
+ command => 'stop',
+ process => $name
+ }
+ }
+ 'removed': {
+ supervisord::supervisorctl { "remove_${name}":
+ command => 'remove',
+ process => $name
+ }
+ }
+ default: { }
}
}
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/reload.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/reload.pp
new file mode 100644
index 00000000000..79eca3d7e0f
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/reload.pp
@@ -0,0 +1,19 @@
+# Class: supervisord::reload
+#
+# Class to reread and update supervisord with supervisorctl
+#
+class supervisord::reload inherits supervisord {
+
+ $supervisorctl = $::supervisord::executable_ctl
+
+ exec { 'supervisorctl_reread':
+ command => "${supervisorctl} reread",
+ refreshonly => true,
+ require => Service[$supervisord::service_name],
+ }
+ exec { 'supervisorctl_update':
+ command => "${supervisorctl} update",
+ refreshonly => true,
+ require => Service[$supervisord::service_name],
+ }
+}
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/service.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/service.pp
index 6e17976165d..f02a0d0a081 100644
--- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/service.pp
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/service.pp
@@ -1,5 +1,9 @@
+# Class: supervisord::service
+#
+# Class for the supervisord service
+#
class supervisord::service inherits supervisord {
- service { 'supervisord':
+ service { $supervisord::service_name:
ensure => $supervisord::service_ensure,
enable => true,
hasrestart => true,
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/supervisorctl.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/supervisorctl.pp
new file mode 100644
index 00000000000..473d301185b
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/supervisorctl.pp
@@ -0,0 +1,27 @@
+# Define: supervisord:supervisorctl
+#
+# This define executes command with the supervisorctl tool
+#
+define supervisord::supervisorctl(
+ $command,
+ $process = undef,
+ $refreshonly = false
+) {
+
+ validate_string($command)
+ validate_string($process)
+
+ $supervisorctl = $::supervisord::executable_ctl
+
+ if $process {
+ $cmd = join([$supervisorctl, $command, $process], ' ')
+ }
+ else {
+ $cmd = join([$supervisorctl, $command])
+ }
+
+ exec { "supervisorctl_command_${name}":
+ command => $cmd,
+ refreshonly => $refreshonly
+ }
+}
\ No newline at end of file
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/acceptance/nodesets/centos-65-i386.yml b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/acceptance/nodesets/centos-65-i386.yml
new file mode 100644
index 00000000000..f8d4013a31b
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/acceptance/nodesets/centos-65-i386.yml
@@ -0,0 +1,10 @@
+HOSTS:
+ centos-65-i386:
+ roles:
+ - master
+ platform: el-6-i386
+ box : centos-65-i386-virtualbox-nocm
+ box_url : http://puppet-vagrant-boxes.puppetlabs.com/centos-65-i386-virtualbox-nocm.box
+ hypervisor : vagrant
+CONFIG:
+ type: foss
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/acceptance/nodesets/centos-65-x64.yml b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/acceptance/nodesets/centos-65-x64.yml
new file mode 100644
index 00000000000..7535c104afb
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/acceptance/nodesets/centos-65-x64.yml
@@ -0,0 +1,10 @@
+HOSTS:
+ centos-65-x64:
+ roles:
+ - master
+ platform: el-6-x86_64
+ box : centos-65-x64-virtualbox-nocm
+ box_url : http://puppet-vagrant-boxes.puppetlabs.com/centos-65-x64-virtualbox-nocm.box
+ hypervisor : vagrant
+CONFIG:
+ type: foss
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/acceptance/nodesets/debian-73-i386.yml b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/acceptance/nodesets/debian-73-i386.yml
new file mode 100644
index 00000000000..d1233aa83d1
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/acceptance/nodesets/debian-73-i386.yml
@@ -0,0 +1,10 @@
+HOSTS:
+ debian-73-i386:
+ roles:
+ - master
+ platform: debian-7-i386
+ box : debian-73-i386-virtualbox-nocm
+ box_url : http://puppet-vagrant-boxes.puppetlabs.com/debian-73-i386-virtualbox-nocm.box
+ hypervisor : vagrant
+CONFIG:
+ type: foss
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/acceptance/nodesets/debian-73-x64.yml b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/acceptance/nodesets/debian-73-x64.yml
new file mode 100644
index 00000000000..5b87870a909
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/acceptance/nodesets/debian-73-x64.yml
@@ -0,0 +1,10 @@
+HOSTS:
+ debian-73-x64:
+ roles:
+ - master
+ platform: debian-7-amd64
+ box : debian-73-x64-virtualbox-nocm
+ box_url : http://puppet-vagrant-boxes.puppetlabs.com/debian-73-x64-virtualbox-nocm.box
+ hypervisor : vagrant
+CONFIG:
+ type: foss
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/acceptance/nodesets/default.yml b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/acceptance/nodesets/default.yml
new file mode 100644
index 00000000000..5b87870a909
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/acceptance/nodesets/default.yml
@@ -0,0 +1,10 @@
+HOSTS:
+ debian-73-x64:
+ roles:
+ - master
+ platform: debian-7-amd64
+ box : debian-73-x64-virtualbox-nocm
+ box_url : http://puppet-vagrant-boxes.puppetlabs.com/debian-73-x64-virtualbox-nocm.box
+ hypervisor : vagrant
+CONFIG:
+ type: foss
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/acceptance/supervisord_spec.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/acceptance/supervisord_spec.rb
new file mode 100644
index 00000000000..47d052a4eec
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/acceptance/supervisord_spec.rb
@@ -0,0 +1,114 @@
+require 'spec_helper_acceptance'
+
+describe 'supervisord install' do
+
+ context 'default parameters with pip and init install' do
+ it 'should work with no errors' do
+ pp = <<-EOS
+ class { 'supervisord': install_pip => true, install_init => true}
+ EOS
+
+ expect(apply_manifest(pp).exit_code).to_not eq(1)
+ expect(apply_manifest(pp).exit_code).to eq(0)
+ end
+
+ describe service('supervisord') do
+ it { should be_enabled }
+ it { should be_running }
+ it 'should restart successfully' do
+ cmd="service supervisord restart"
+ expect(shell(cmd).exit_code).to_not eq(1)
+ end
+ end
+ end
+end
+
+describe 'supervisord::program' do
+ context 'create a program config' do
+ it 'should install a program file' do
+
+ pp = <<-EOS
+ include supervisord
+ supervisord::program { 'test':
+ command => 'echo',
+ priority => '100',
+ environment => {
+ 'HOME' => '/root',
+ 'PATH' => '/bin',
+ }
+ }
+ EOS
+
+ expect(apply_manifest(pp).exit_code).to_not eq(1)
+ expect(apply_manifest(pp).exit_code).to eq(0)
+ end
+
+ it 'should contain the correct values' do
+ cmd='grep command=echo /etc/supervisor.d/program_test.conf'
+ expect(shell(cmd).exit_code).to eq(0)
+ cmd='grep priority=100 /etc/supervisor.d/program_test.conf'
+ expect(shell(cmd).exit_code).to eq(0)
+ cmd='grep "environment=" /etc/supervisor.d/program_test.conf'
+ expect(shell(cmd).exit_code).to eq(0)
+ end
+ end
+end
+
+describe 'supervisord::fcgi-program' do
+ context 'create fcgi-program config' do
+ it 'should install a fcgi-program file' do
+
+ pp = <<-EOS
+ include supervisord
+ supervisord::fcgi_program { 'test':
+ socket => 'tcp://localhost:1000',
+ command => 'echo',
+ priority => '100',
+ environment => {
+ 'HOME' => '/root',
+ 'PATH' => '/bin',
+ }
+ }
+ EOS
+
+ expect(apply_manifest(pp).exit_code).to_not eq(1)
+ expect(apply_manifest(pp).exit_code).to eq(0)
+ end
+
+ it 'should contain the correct values' do
+ cmd='grep socket=tcp://localhost:1000 /etc/supervisor.d/fcgi-program_test.conf'
+ expect(shell(cmd).exit_code).to eq(0)
+ cmd="grep command=echo /etc/supervisor.d/fcgi-program_test.conf"
+ expect(shell(cmd).exit_code).to eq(0)
+ cmd="grep priority=100 /etc/supervisor.d/fcgi-program_test.conf"
+ expect(shell(cmd).exit_code).to eq(0)
+ cmd='grep "environment=" /etc/supervisor.d/fcgi-program_test.conf'
+ expect(shell(cmd).exit_code).to eq(0)
+ end
+ end
+end
+
+describe 'supervisord::group' do
+ context 'create group config' do
+ it 'should install a group config' do
+
+ pp = <<-EOS
+ include supervisord
+ supervisord::group { 'test':
+ programs => ['test'],
+ priority => '100',
+ }
+ EOS
+
+ expect(apply_manifest(pp).exit_code).to_not eq(1)
+ expect(apply_manifest(pp).exit_code).to eq(0)
+ end
+
+ it 'should contain the correct values' do
+ cmd='grep "programs=test" /etc/supervisor.d/group_test.conf'
+ expect(shell(cmd).exit_code).to eq(0)
+ cmd="grep priority=100 /etc/supervisor.d/group_test.conf"
+ expect(shell(cmd).exit_code).to eq(0)
+ end
+ end
+end
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/classes/supervisord_spec.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/classes/supervisord_spec.rb
index 238876c7dcd..b845920f6fe 100644
--- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/classes/supervisord_spec.rb
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/classes/supervisord_spec.rb
@@ -3,14 +3,26 @@ require 'spec_helper'
describe 'supervisord' do
concatdir = '/var/lib/puppet/concat'
- configfile = '/etc/supervisord.conf'
let(:facts) {{ :concat_basedir => concatdir }}
it { should contain_class('supervisord') }
it { should contain_class('supervisord::install') }
it { should contain_class('supervisord::config') }
it { should contain_class('supervisord::service') }
- it { should contain_concat__fragment('supervisord_main').with_content(/logfile/) }
+ it { should contain_class('supervisord::params') }
+ it { should contain_class('supervisord::reload') }
+ it { should contain_package('supervisor') }
+
+ describe '#service_name' do
+ context 'default' do
+ it { should contain_service('supervisord') }
+ end
+
+ context 'specified' do
+ let(:params) {{ :service_name => 'myservicename' }}
+ it { should contain_service('myservicename') }
+ end
+ end
describe '#install_pip' do
context 'default' do
@@ -18,8 +30,16 @@ describe 'supervisord' do
end
context 'true' do
- let (:params) {{ :install_pip => true }}
+ let(:params) {{ :install_pip => true }}
it { should contain_class('supervisord::pip') }
+ it { should contain_exec('install_setuptools') }
+ it { should contain_exec('install_pip') }
+ end
+
+ context 'true and RedHat' do
+ let(:params) {{ :install_pip => true }}
+ let(:facts) {{ :osfamily => 'RedHat', :concat_basedir => concatdir }}
+ it { should contain_exec('pip_provider_name_fix') }
end
end
@@ -28,11 +48,6 @@ describe 'supervisord' do
it { should contain_class('supervisord').without_env_hash }
it { should contain_class('supervisord').without_env_string }
end
- #context 'is specified' do
- # let(:params) {{ :env_var => 'foovars' }}
- # let(:hiera_data) {{ :foovars => { 'key1' => 'value1', 'key2' => 'value2' } }}
- # it { should contain_concat__fragment('supervisord_main').with_content(/environment=key1='value1',key2='value2'/) }
- #end
end
describe '#environment' do
@@ -41,7 +56,8 @@ describe 'supervisord' do
end
context 'is specified' do
let(:params) {{ :environment => { 'key1' => 'value1', 'key2' => 'value2' } }}
- it { should contain_concat__fragment('supervisord_main').with_content(/environment=key1='value1',key2='value2'/) }
+ it { should contain_concat__fragment('supervisord_main')\
+ .with_content(/environment=key1='value1',key2='value2'/) }
end
end
@@ -54,17 +70,20 @@ describe 'supervisord' do
it { should_not contain_file('/etc/init.d/supervisord') }
end
- describe 'on supported OS'
+ describe 'on supported OS' do
context 'with Debian' do
let(:facts) {{ :osfamily => 'Debian', :concat_basedir => concatdir }}
it { should contain_file('/etc/init.d/supervisord') }
+ it { should contain_file('/etc/default/supervisor') }
end
context 'with RedHat' do
let(:facts) {{ :osfamily => 'RedHat', :concat_basedir => concatdir }}
it { should contain_file('/etc/init.d/supervisord') }
+ it { should contain_file('/etc/sysconfig/supervisord') }
end
end
+ end
describe '#unix_socket' do
context 'default' do
@@ -89,10 +108,192 @@ describe 'supervisord' do
describe '#run_path' do
context 'default' do
it { should_not contain_file('/var/run') }
+ it { should contain_concat__fragment('supervisord_main') \
+ .with_content(/pidfile=\/var\/run\/supervisord.pid$/) }
end
- context 'custom setting' do
- let(:params) {{ :run_path => '/var/run/supervisord'}}
- it { should contain_file('/var/run/supervisord') }
+ context 'is specified' do
+ let(:params) {{ :run_path => '/opt/supervisord/run' }}
+ it { should contain_file('/opt/supervisord/run') }
+ it { should contain_concat__fragment('supervisord_main') \
+ .with_content(/pidfile=\/opt\/supervisord\/run\/supervisord.pid$/) }
+ end
+ end
+
+ describe '#log_path' do
+ context 'default' do
+ it { should contain_file('/var/log/supervisor') }
+ it { should contain_concat__fragment('supervisord_main') \
+ .with_content(/logfile=\/var\/log\/supervisor\/supervisord.log$/) }
+ end
+ context 'is specified' do
+ let(:params) {{ :log_path => '/opt/supervisord/logs' }}
+ it { should contain_file('/opt/supervisord/logs')}
+ it { should contain_concat__fragment('supervisord_main') \
+ .with_content(/logfile=\/opt\/supervisord\/logs\/supervisord.log$/) }
+ end
+ end
+
+ describe '#config_include' do
+ context 'default' do
+ it { should contain_file('/etc/supervisor.d') }
+ it { should contain_concat__fragment('supervisord_main') \
+ .with_content(/files=\/etc\/supervisor.d\/\*.conf$/) }
+ end
+ context 'is specified' do
+ let(:params) {{ :config_include => '/opt/supervisord/conf.d' }}
+ it { should contain_file('/opt/supervisord/conf.d') }
+ it { should contain_concat__fragment('supervisord_main') \
+ .with_content(/files=\/opt\/supervisord\/conf.d\/\*.conf$/) }
+ end
+ end
+
+ describe '#config_dirs' do
+ context 'is specified' do
+ let(:params) {{ :config_dirs => ['/etc/supervisor.d/*.conf', '/opt/supervisor.d/*', '/usr/share/supervisor.d/*.config'] }}
+ it { should contain_concat__fragment('supervisord_main') \
+ .with_content(/files=\/etc\/supervisor.d\/\*.conf \/opt\/supervisor.d\/\* \/usr\/share\/supervisor.d\/\*.config$/) }
+ end
+ end
+
+ describe '#config_file' do
+ context 'default' do
+ it { should contain_file('/etc/supervisord.conf') }
+ end
+ context 'is specified' do
+ let(:params) {{ :config_file => '/opt/supervisord/supervisor.conf' }}
+ it { should contain_file('/opt/supervisord/supervisor.conf') }
+ end
+ end
+
+ describe '#nodaemon' do
+ context 'default' do
+ it { should contain_concat__fragment('supervisord_main') \
+ .with_content(/nodaemon=false$/) }
+ end
+ context 'true' do
+ let(:params) {{ :nodaemon => true }}
+ it { should contain_concat__fragment('supervisord_main') \
+ .with_content(/nodaemon=true$/) }
+ end
+ context 'invalid' do
+ let(:params) {{ :nodaemon => 'invalid' }}
+ it { expect { raise_error(Puppet::Error, /is not a boolean/) }}
+ end
+ end
+
+ describe '#minfds' do
+ context 'default' do
+ it { should contain_concat__fragment('supervisord_main') \
+ .with_content(/minfds=1024$/) }
+ end
+ context 'specified' do
+ let(:params) {{ :minfds => 2048 }}
+ it { should contain_concat__fragment('supervisord_main') \
+ .with_content(/minfds=2048$/) }
+ end
+ context 'invalid' do
+ let(:params) {{ :minfds => 'string' }}
+ it { expect { raise_error(Puppet::Error, /invalid minfds/) }}
+ end
+ end
+
+ describe '#minprocs' do
+ context 'default' do
+ it { should contain_concat__fragment('supervisord_main') \
+ .with_content(/minprocs=200$/) }
+ end
+ context 'specified' do
+ let(:params) {{ :minprocs => 300 }}
+ it { should contain_concat__fragment('supervisord_main') \
+ .with_content(/minprocs=300$/) }
+ end
+ context 'invalid' do
+ let(:params) {{ :minfds => 'string' }}
+ it { expect { raise_error(Puppet::Error, /invalid minprocs/) }}
+ end
+ end
+
+ describe '#strip_ansi' do
+ context 'default' do
+ it { should_not contain_concat__fragment('supervisord_main') \
+ .with_content(/strip_ansi$/) }
+ end
+ context 'true' do
+ let(:params) {{ :strip_ansi => true }}
+ it { should contain_concat__fragment('supervisord_main') \
+ .with_content(/strip_ansi=true$/) }
+ end
+ context 'invalid' do
+ let(:params) {{ :strip_ansi => 'string' }}
+ it { expect { raise_error(Puppet::Error, /is not a boolean/) }}
+ end
+ end
+
+ describe '#user' do
+ context 'default' do
+ it { should_not contain_concat__fragment('supervisord_main') \
+ .with_content(/user$/) }
+ end
+ context 'specified' do
+ let(:params) {{ :user => 'myuser' }}
+ it { should contain_concat__fragment('supervisord_main') \
+ .with_content(/user=myuser$/) }
+ end
+ end
+
+ describe '#identifier' do
+ context 'default' do
+ it { should_not contain_concat__fragment('supervisord_main') \
+ .with_content(/identifier$/) }
+ end
+ context 'specified' do
+ let(:params) {{ :identifier => 'myidentifier' }}
+ it { should contain_concat__fragment('supervisord_main') \
+ .with_content(/identifier=myidentifier$/) }
+ end
+ end
+
+ describe '#directory' do
+ context 'default' do
+ it { should_not contain_concat__fragment('supervisord_main') \
+ .with_content(/directory$/) }
+ end
+ context 'specified' do
+ let(:params) {{ :directory => '/opt/supervisord' }}
+ it { should contain_concat__fragment('supervisord_main') \
+ .with_content(/directory=\/opt\/supervisord$/) }
+ end
+ end
+
+ describe '#nocleanup' do
+ context 'default' do
+ it { should_not contain_concat__fragment('supervisord_main') \
+ .with_content(/nocleanup$/) }
+ end
+ context 'true' do
+ let(:params) {{ :nocleanup => true }}
+ it { should contain_concat__fragment('supervisord_main') \
+ .with_content(/nocleanup=true$/) }
+ end
+ context 'invalid' do
+ let(:params) {{ :nocleanup => 'string' }}
+ it { expect { raise_error(Puppet::Error, /is not a boolean/) }}
+ end
+ end
+
+ describe '#childlogdir' do
+ context 'default' do
+ it { should_not contain_concat__fragment('supervisord_main') \
+ .with_content(/childlogdir$/) }
+ end
+ context 'specified' do
+ let(:params) {{ :childlogdir => '/opt/supervisord/logdir' }}
+ it { should contain_concat__fragment('supervisord_main') \
+ .with_content(/childlogdir=\/opt\/supervisord\/logdir$/) }
+ end
+ context 'invalid' do
+ let(:params) {{ :childlogdir => 'not_a_path' }}
+ it { expect { raise_error(Puppet::Error, /is not an absolute path/) }}
end
end
end
\ No newline at end of file
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/defines/eventlistener_spec.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/defines/eventlistener_spec.rb
index 6e04f44f97b..1083b8a3230 100644
--- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/defines/eventlistener_spec.rb
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/defines/eventlistener_spec.rb
@@ -2,14 +2,85 @@ require 'spec_helper'
describe 'supervisord::eventlistener', :type => :define do
let(:title) {'foo'}
- let(:default_params) {{ :command => 'bar',
- :stdout_logfile => '/var/log/supervisor/eventlistener_foo.log',
- :stderr_logfile => '/var/log/supervisor/eventlistener_foo.error',
- }}
- let(:params) { default_params }
let(:facts) {{ :concat_basedir => '/var/lib/puppet/concat' }}
+ let(:default_params) do
+ {
+ :command => 'bar',
+ :process_name => '%(process_num)s',
+ :events => ['PROCESS_STATE', 'PROCESS_STATE_STARTING'],
+ :buffer_size => 10,
+ :numprocs => '1',
+ :numprocs_start => '0',
+ :priority => '999',
+ :autostart => true,
+ :autorestart => 'unexpected',
+ :startsecs => '1',
+ :startretries => '3',
+ :exitcodes => '0,2',
+ :stopsignal => 'TERM',
+ :stopwaitsecs => '10',
+ :stopasgroup => true,
+ :killasgroup => true,
+ :user => 'baz',
+ :redirect_stderr => true,
+ :stdout_logfile => 'eventlistener_foo.log',
+ :stdout_logfile_maxbytes => '50MB',
+ :stdout_logfile_backups => '10',
+ :stdout_events_enabled => true,
+ :stderr_logfile => 'eventlistener_foo.error',
+ :stderr_logfile_maxbytes => '50MB',
+ :stderr_logfile_backups => '10',
+ :stderr_events_enabled => true,
+ :environment => { 'env1' => 'value1', 'env2' => 'value2' },
+ :directory => '/opt/supervisord/chroot',
+ :umask => '022',
+ :serverurl => 'AUTO'
+ }
+ end
- it { should contain_supervisord__eventlistener('foo') }
- it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/command=bar/) }
+ context 'default' do
+ let(:params) { default_params }
+ it { should contain_supervisord__eventlistener('foo') }
+ it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/\[eventlistener:foo\]/) }
+ it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/command=bar/) }
+ it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/process_name=\%\(process_num\)s/) }
+ it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/events=PROCESS_STATE,PROCESS_STATE_STARTING/) }
+ it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/buffer_size=10/) }
+ it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/numprocs=1/) }
+ it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/numprocs_start=0/) }
+ it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/priority=999/) }
+ it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/autostart=true/) }
+ it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/startsecs=1/) }
+ it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/startretries=3/) }
+ it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/exitcodes=0,2/) }
+ it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/stopsignal=TERM/) }
+ it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/stopwaitsecs=10/) }
+ it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/stopasgroup=true/) }
+ it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/killasgroup=true/) }
+ it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/user=baz/) }
+ it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/redirect_stderr=true/) }
+ it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/stdout_logfile=\/var\/log\/supervisor\/eventlistener_foo.log/) }
+ it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/stdout_logfile_maxbytes=50MB/) }
+ it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/stdout_logfile_backups=10/) }
+ it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/stdout_events_enabled=true/) }
+ it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/stderr_logfile=\/var\/log\/supervisor\/eventlistener_foo.error/) }
+ it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/stderr_logfile_maxbytes=50MB/) }
+ it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/stderr_logfile_backups=10/) }
+ it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/stderr_events_enabled=true/) }
+ it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/environment=env1='value1',env2='value2'/) }
+ it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/directory=\/opt\/supervisord\/chroot/) }
+ it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/umask=022/) }
+ it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/serverurl=AUTO/) }
+ end
+
+ context 'ensure_process_stopped' do
+ let(:params) { default_params.merge({ :ensure_process => 'stopped' }) }
+ it { should contain_supervisord__supervisorctl('stop_foo') }
+ end
+
+ context 'ensure_process_removed' do
+ let(:params) { default_params.merge({ :ensure_process => 'removed' }) }
+ it { should contain_supervisord__supervisorctl('remove_foo') }
+ end
end
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/defines/fcgi_program_spec.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/defines/fcgi_program_spec.rb
index 7fd8ab07b86..e01311be70d 100644
--- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/defines/fcgi_program_spec.rb
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/defines/fcgi_program_spec.rb
@@ -2,21 +2,87 @@ require 'spec_helper'
describe 'supervisord::fcgi_program', :type => :define do
let(:title) {'foo'}
- let(:default_params) {{ :command => 'bar',
- :socket => 'tcp://localhost:1000',
- :stdout_logfile => '/var/log/supervisor/fcgi-program_foo.log',
- :stderr_logfile => '/var/log/supervisor/fcgi-program_foo.error',
- :user => 'baz'
- }}
- let(:params) { default_params }
let(:facts) {{ :concat_basedir => '/var/lib/puppet/concat' }}
+ let(:default_params) do
+ {
+ :command => 'bar',
+ :socket => 'tcp://localhost:1000',
+ :process_name => '%(process_num)s',
+ :numprocs => '1',
+ :numprocs_start => '0',
+ :priority => '999',
+ :autostart => true,
+ :autorestart => 'unexpected',
+ :startsecs => '1',
+ :startretries => '3',
+ :exitcodes => '0,2',
+ :stopsignal => 'TERM',
+ :stopwaitsecs => '10',
+ :stopasgroup => true,
+ :killasgroup => true,
+ :user => 'baz',
+ :redirect_stderr => true,
+ :stdout_logfile => 'fcgi-program_foo.log',
+ :stdout_logfile_maxbytes => '50MB',
+ :stdout_logfile_backups => '10',
+ :stdout_capture_maxbytes => '0',
+ :stdout_events_enabled => true,
+ :stderr_logfile => 'fcgi-program_foo.error',
+ :stderr_logfile_maxbytes => '50MB',
+ :stderr_logfile_backups => '10',
+ :stderr_capture_maxbytes => '0',
+ :stderr_events_enabled => true,
+ :environment => { 'env1' => 'value1', 'env2' => 'value2' },
+ :directory => '/opt/supervisord/chroot',
+ :umask => '022',
+ :serverurl => 'AUTO'
+ }
+ end
- it { should contain_supervisord__fcgi_program('foo') }
- it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/\[fcgi-program:foo\]/) }
- it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/socket=tcp:\/\/localhost:1000/) }
- it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/command=bar/) }
- it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/user=baz/) }
- it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/stdout_logfile=\/var\/log\/supervisor\/fcgi-program_foo.log/) }
- it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/stderr_logfile=\/var\/log\/supervisor\/fcgi-program_foo.error/) }
+ context 'default' do
+ let(:params) { default_params }
+ it { should contain_supervisord__fcgi_program('foo') }
+ it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/\[fcgi-program:foo\]/) }
+ it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/socket=tcp:\/\/localhost:1000/) }
+ it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/command=bar/) }
+ it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/process_name=\%\(process_num\)s/) }
+ it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/numprocs=1/) }
+ it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/numprocs_start=0/) }
+ it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/priority=999/) }
+ it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/autostart=true/) }
+ it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/startsecs=1/) }
+ it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/startretries=3/) }
+ it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/exitcodes=0,2/) }
+ it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/stopsignal=TERM/) }
+ it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/stopwaitsecs=10/) }
+ it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/stopasgroup=true/) }
+ it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/killasgroup=true/) }
+ it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/user=baz/) }
+ it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/redirect_stderr=true/) }
+ it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/stdout_logfile=\/var\/log\/supervisor\/fcgi-program_foo.log/) }
+ it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/stdout_logfile_maxbytes=50MB/) }
+ it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/stdout_logfile_backups=10/) }
+ it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/stdout_capture_maxbytes=0/) }
+ it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/stdout_events_enabled=true/) }
+ it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/stderr_logfile=\/var\/log\/supervisor\/fcgi-program_foo.error/) }
+ it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/stderr_logfile_maxbytes=50MB/) }
+ it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/stderr_logfile_backups=10/) }
+ it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/stderr_capture_maxbytes=0/) }
+ it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/stderr_events_enabled=true/) }
+ it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/environment=env1='value1',env2='value2'/) }
+ it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/directory=\/opt\/supervisord\/chroot/) }
+ it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/umask=022/) }
+ it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/serverurl=AUTO/) }
+ end
+
+ context 'ensure_process_stopped' do
+ let(:params) { default_params.merge({ :ensure_process => 'stopped' }) }
+ it { should contain_supervisord__supervisorctl('stop_foo') }
+ end
+
+ context 'ensure_process_removed' do
+ let(:params) { default_params.merge({ :ensure_process => 'removed' }) }
+ it { should contain_supervisord__supervisorctl('remove_foo') }
+ end
end
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/defines/program_spec.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/defines/program_spec.rb
index 077828bdfcf..e32c24ab2d5 100644
--- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/defines/program_spec.rb
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/defines/program_spec.rb
@@ -2,19 +2,85 @@ require 'spec_helper'
describe 'supervisord::program', :type => :define do
let(:title) {'foo'}
- let(:default_params) {{ :command => 'bar',
- :stdout_logfile => '/var/log/supervisor/program_foo.log',
- :stderr_logfile => '/var/log/supervisor/program_foo.error',
- :user => 'baz'
- }}
- let(:params) { default_params }
let(:facts) {{ :concat_basedir => '/var/lib/puppet/concat' }}
+ let(:default_params) do
+ {
+ :command => 'bar',
+ :process_name => '%(process_num)s',
+ :numprocs => '1',
+ :numprocs_start => '0',
+ :priority => '999',
+ :autostart => true,
+ :autorestart => 'unexpected',
+ :startsecs => '1',
+ :startretries => '3',
+ :exitcodes => '0,2',
+ :stopsignal => 'TERM',
+ :stopwaitsecs => '10',
+ :stopasgroup => true,
+ :killasgroup => true,
+ :user => 'baz',
+ :redirect_stderr => true,
+ :stdout_logfile => 'program_foo.log',
+ :stdout_logfile_maxbytes => '50MB',
+ :stdout_logfile_backups => '10',
+ :stdout_capture_maxbytes => '0',
+ :stdout_events_enabled => true,
+ :stderr_logfile => 'program_foo.error',
+ :stderr_logfile_maxbytes => '50MB',
+ :stderr_logfile_backups => '10',
+ :stderr_capture_maxbytes => '0',
+ :stderr_events_enabled => true,
+ :environment => { 'env1' => 'value1', 'env2' => 'value2' },
+ :directory => '/opt/supervisord/chroot',
+ :umask => '022',
+ :serverurl => 'AUTO'
+ }
+ end
- it { should contain_supervisord__program('foo') }
- it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/\[program:foo\]/) }
- it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/command=bar/) }
- it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/user=baz/) }
- it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/stdout_logfile=\/var\/log\/supervisor\/program_foo.log/) }
- it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/stderr_logfile=\/var\/log\/supervisor\/program_foo.error/) }
+ context 'default' do
+ let(:params) { default_params }
+ it { should contain_supervisord__program('foo') }
+ it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/\[program:foo\]/) }
+ it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/command=bar/) }
+ it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/process_name=\%\(process_num\)s/) }
+ it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/numprocs=1/) }
+ it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/numprocs_start=0/) }
+ it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/priority=999/) }
+ it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/autostart=true/) }
+ it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/startsecs=1/) }
+ it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/startretries=3/) }
+ it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/exitcodes=0,2/) }
+ it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/stopsignal=TERM/) }
+ it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/stopwaitsecs=10/) }
+ it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/stopasgroup=true/) }
+ it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/killasgroup=true/) }
+ it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/user=baz/) }
+ it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/redirect_stderr=true/) }
+ it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/stdout_logfile=\/var\/log\/supervisor\/program_foo.log/) }
+ it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/stdout_logfile_maxbytes=50MB/) }
+ it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/stdout_logfile_backups=10/) }
+ it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/stdout_capture_maxbytes=0/) }
+ it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/stdout_events_enabled=true/) }
+ it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/stderr_logfile=\/var\/log\/supervisor\/program_foo.error/) }
+ it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/stderr_logfile_maxbytes=50MB/) }
+ it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/stderr_logfile_backups=10/) }
+ it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/stderr_capture_maxbytes=0/) }
+ it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/stderr_events_enabled=true/) }
+ it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/environment=env1='value1',env2='value2'/) }
+ it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/directory=\/opt\/supervisord\/chroot/) }
+ it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/umask=022/) }
+ it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/serverurl=AUTO/) }
+ end
+
+ context 'ensure_process_stopped' do
+ let(:params) { default_params.merge({ :ensure_process => 'stopped' }) }
+ it { should contain_supervisord__supervisorctl('stop_foo') }
+ end
+
+ context 'ensure_process_removed' do
+ let(:params) { default_params.merge({ :ensure_process => 'removed' }) }
+ it { should contain_supervisord__supervisorctl('remove_foo') }
+ end
end
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/defines/supervisorctl.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/defines/supervisorctl.rb
new file mode 100644
index 00000000000..33cfd75efe9
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/defines/supervisorctl.rb
@@ -0,0 +1,13 @@
+require 'spec_helper'
+
+describe 'supervisord::supervisorctl', :type => :define do
+ let(:title) {'command_foo'}
+ let(:default_params) {{
+ :command => 'command',
+ :process => 'foo'
+ }}
+ let(:params) { default_params }
+ let(:facts) {{ :concat_basedir => '/var/lib/puppet/concat' }}
+
+ it { should contain_supervisord__supervisorctl('command_foo') }
+end
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/spec_helper.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/spec_helper.rb
index 644f7c33ac0..745ad4a5493 100644
--- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/spec_helper.rb
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/spec_helper.rb
@@ -7,3 +7,4 @@ RSpec.configure do |c|
c.manifest_dir = File.join(fixture_path, 'manifests')
end
+at_exit { RSpec::Puppet::Coverage.report! }
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/spec_helper_acceptance.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/spec_helper_acceptance.rb
new file mode 100644
index 00000000000..dcae2850d27
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/spec_helper_acceptance.rb
@@ -0,0 +1,24 @@
+require 'beaker-rspec'
+
+hosts.each do |host|
+ # Install Puppet
+ install_puppet
+end
+
+RSpec.configure do |c|
+ # Project root
+ proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
+
+ # Readable test descriptions
+ c.formatter = :documentation
+
+ # Configure all nodes in nodeset
+ c.before :suite do
+ # Install module
+ puppet_module_install(:source => proj_root, :module_name => 'supervisord')
+ hosts.each do |host|
+ on host, puppet('module','install','puppetlabs-stdlib'), { :acceptable_exit_codes => [0,1] }
+ on host, puppet('module','install','puppetlabs-concat'), { :acceptable_exit_codes => [0,1] }
+ end
+ end
+end
\ No newline at end of file
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/system/basic_spec.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/system/basic_spec.rb
deleted file mode 100644
index 62cf7dd8c2e..00000000000
--- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/system/basic_spec.rb
+++ /dev/null
@@ -1,120 +0,0 @@
-require 'spec_helper_system'
-
-describe 'basic install' do
-
- it 'class should work with no errors' do
- pp = <<-EOS
- class { 'supervisord': install_pip => true, install_init => true}
- EOS
-
- puppet_apply(pp) do |r|
- r.exit_code.should_not == 1
- r.refresh
- r.exit_code.should be_zero
- end
-
- shell("pgrep supervisord") do |r|
- r.exit_code.should be_zero
- end
-
- end
-end
-
-describe 'add a program config' do
-
- it 'supervisord::program should install a program config' do
-
- pp = <<-EOS
- include supervisord
- supervisord::program { 'test':
- command => 'echo',
- priority => '100',
- environment => {
- 'HOME' => '/root',
- 'PATH' => '/bin',
- }
- }
- EOS
-
- puppet_apply(pp) do |r|
- r.exit_code.should_not == 1
- r.refresh
- r.exit_code.should be_zero
- end
-
- shell("grep command=echo /etc/supervisor.d/program_test.conf") do |r|
- r.exit_code.should be_zero
- end
- shell("grep priority=100 /etc/supervisor.d/program_test.conf") do |r|
- r.exit_code.should be_zero
- end
- shell('grep "environment=" /etc/supervisor.d/program_test.conf') do |r|
- r.exit_code.should be_zero
- end
- end
-end
-
-describe 'add a fcgi-program config' do
-
- it 'supervisord::fcgi_program should install a program config' do
-
- pp = <<-EOS
- include supervisord
- supervisord::fcgi_program { 'test':
- socket => 'tcp://localhost:1000',
- command => 'echo',
- priority => '100',
- environment => {
- 'HOME' => '/root',
- 'PATH' => '/bin',
- }
- }
- EOS
-
- puppet_apply(pp) do |r|
- r.exit_code.should_not == 1
- r.refresh
- r.exit_code.should be_zero
- end
-
- shell("grep socket=tcp://localhost:1000 /etc/supervisor.d/fcgi-program_test.conf") do |r|
- r.exit_code.should be_zero
- end
- shell("grep command=echo /etc/supervisor.d/fcgi-program_test.conf") do |r|
- r.exit_code.should be_zero
- end
- shell("grep priority=100 /etc/supervisor.d/fcgi-program_test.conf") do |r|
- r.exit_code.should be_zero
- end
- shell('grep "environment=" /etc/supervisor.d/fcgi-program_test.conf') do |r|
- r.exit_code.should be_zero
- end
- end
-end
-
-describe 'add a group config' do
-
- it 'supervisord::group should install a program config' do
-
- pp = <<-EOS
- include supervisord
- supervisord::group { 'test':
- programs => ['program1', 'program2'],
- priority => '100',
- }
- EOS
-
- puppet_apply(pp) do |r|
- r.exit_code.should_not == 1
- r.refresh
- r.exit_code.should be_zero
- end
-
- shell('grep "programs=program1,program2" /etc/supervisor.d/group_test.conf') do |r|
- r.exit_code.should be_zero
- end
- shell("grep priority=100 /etc/supervisor.d/fcgi-program_test.conf") do |r|
- r.exit_code.should be_zero
- end
- end
-end
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/conf/eventlistener.erb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/conf/eventlistener.erb
index 4ee2b893419..9875c8ef5b2 100644
--- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/conf/eventlistener.erb
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/conf/eventlistener.erb
@@ -39,8 +39,8 @@ exitcodes=<%= @exitcodes %>
<% if @stopsignal -%>
stopsignal=<%= @stopsignal %>
<% end -%>
-<% if @stopwaitsec -%>
-stopwaitsec=<%= @stopwaitsec %>
+<% if @stopwaitsecs -%>
+stopwaitsecs=<%= @stopwaitsecs %>
<% end -%>
<% if @stopasgroup -%>
stopasgroup=<%= @stopasgroup %>
@@ -54,7 +54,7 @@ user=<%= @user %>
<% if @redirect_stderr -%>
redirect_stderr=<%= @redirect_stderr %>
<% end -%>
-stdout_logfile=<%= @stdout_logfile %>
+stdout_logfile=<%= scope.lookupvar('supervisord::log_path') %>/<%= @stdout_logfile %>
<% if @stdout_logfile_maxbytes -%>
stdout_logfile_maxbytes=<%= @stdout_logfile_maxbytes %>
<% end -%>
@@ -64,7 +64,7 @@ stdout_logfile_backups=<%= @stdout_logfile_backups %>
<% if @stdout_events_enabled -%>
stdout_events_enabled=<%= @stdout_events_enabled %>
<% end -%>
-stderr_logfile=<%= @stderr_logfile %>
+stderr_logfile=<%= scope.lookupvar('supervisord::log_path') %>/<%= @stderr_logfile %>
<% if @stderr_logfile_maxbytes -%>
stderr_logfile_maxbytes=<%= @stderr_logfile_maxbytes %>
<% end -%>
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/conf/fcgi_program.erb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/conf/fcgi_program.erb
index a1478bce536..98a7fb1cb32 100644
--- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/conf/fcgi_program.erb
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/conf/fcgi_program.erb
@@ -37,8 +37,8 @@ exitcodes=<%= @exitcodes %>
<% if @stopsignal -%>
stopsignal=<%= @stopsignal %>
<% end -%>
-<% if @stopwaitsec -%>
-stopwaitsec=<%= @stopwaitsec %>
+<% if @stopwaitsecs -%>
+stopwaitsecs=<%= @stopwaitsecs %>
<% end -%>
<% if @stopasgroup -%>
stopasgroup=<%= @stopasgroup %>
@@ -53,7 +53,7 @@ user=<%= @user %>
redirect_stderr=<%= @redirect_stderr %>
<% end -%>
<% if @stdout_logfile -%>
-stdout_logfile=<%= @stdout_logfile %>
+stdout_logfile=<%= scope.lookupvar('supervisord::log_path') %>/<%= @stdout_logfile %>
<% end -%>
<% if @stdout_logfile_maxbytes -%>
stdout_logfile_maxbytes=<%= @stdout_logfile_maxbytes %>
@@ -68,7 +68,7 @@ stdout_capture_maxbytes=<%= @stdout_capture_maxbytes %>
stdout_events_enabled=<%= @stdout_events_enabled %>
<% end -%>
<% if @stderr_logfile -%>
-stderr_logfile=<%= @stderr_logfile %>
+stderr_logfile=<%= scope.lookupvar('supervisord::log_path') %>/<%= @stderr_logfile %>
<% end -%>
<% if @stderr_logfile_maxbytes -%>
stderr_logfile_maxbytes=<%= @stderr_logfile_maxbytes %>
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/conf/program.erb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/conf/program.erb
index ca96d34d6ad..78002c87ca6 100644
--- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/conf/program.erb
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/conf/program.erb
@@ -30,8 +30,8 @@ exitcodes=<%= @exitcodes %>
<% if @stopsignal -%>
stopsignal=<%= @stopsignal %>
<% end -%>
-<% if @stopwaitsec -%>
-stopwaitsec=<%= @stopwaitsec %>
+<% if @stopwaitsecs -%>
+stopwaitsecs=<%= @stopwaitsecs %>
<% end -%>
<% if @stopasgroup -%>
stopasgroup=<%= @stopasgroup %>
@@ -46,7 +46,7 @@ user=<%= @user %>
redirect_stderr=<%= @redirect_stderr %>
<% end -%>
<% if @stdout_logfile -%>
-stdout_logfile=<%= @stdout_logfile %>
+stdout_logfile=<%= scope.lookupvar('supervisord::log_path') %>/<%= @stdout_logfile %>
<% end -%>
<% if @stdout_logfile_maxbytes -%>
stdout_logfile_maxbytes=<%= @stdout_logfile_maxbytes %>
@@ -61,7 +61,7 @@ stdout_capture_maxbytes=<%= @stdout_capture_maxbytes %>
stdout_events_enabled=<%= @stdout_events_enabled %>
<% end -%>
<% if @stderr_logfile -%>
-stderr_logfile=<%= @stderr_logfile %>
+stderr_logfile=<%= scope.lookupvar('supervisord::log_path') %>/<%= @stderr_logfile %>
<% end -%>
<% if @stderr_logfile_maxbytes -%>
stderr_logfile_maxbytes=<%= @stderr_logfile_maxbytes %>
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/init/debian_extra.erb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/init/Debian/defaults.erb
similarity index 100%
rename from dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/init/debian_extra.erb
rename to dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/init/Debian/defaults.erb
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/init/debian_init.erb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/init/Debian/init.erb
similarity index 93%
rename from dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/init/debian_init.erb
rename to dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/init/Debian/init.erb
index b94f9337f59..f8bdb5ff854 100644
--- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/init/debian_init.erb
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/init/Debian/init.erb
@@ -16,18 +16,22 @@ DAEMON=<%= @executable %>
NAME=supervisord
DESC=supervisor
-test -x $DAEMON || exit 0
+# Tests if executable exists
+if [ ! -x $DAEMON ] ; then
+ echo "Executable not found ${DAEMON}"
+ exit 1
+fi
LOGDIR=<%= @log_path %>
-PIDFILE=<%= @pid_file %>
+PIDFILE=<%= @run_path %>/<%= @pid_file %>
DODTIME=5 # Time to wait for the server to die, in seconds
# If this value is set too low you might not
# let some servers to die gracefully and
# 'restart' will not work
# Include supervisor defaults if available
-if [ -f /etc/default/supervisor ] ; then
- . /etc/default/supervisor
+if [ -f <%= @init_defaults %> ] ; then
+ . <%= @init_defaults %>
fi
set -e
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/init/redhat_extra.erb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/init/RedHat/defaults.erb
similarity index 81%
rename from dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/init/redhat_extra.erb
rename to dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/init/RedHat/defaults.erb
index b892c2d6203..0d7862d0233 100644
--- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/init/redhat_extra.erb
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/init/RedHat/defaults.erb
@@ -5,4 +5,4 @@ set -a
# should probably put both of these options as runtime arguments
OPTIONS="-c <%= @config_file %>"
-PIDFILE=<%= @pid_file %>
+PIDFILE=<%= @run_path %><%= @pid_file %>
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/init/redhat_init.erb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/init/RedHat/init.erb
similarity index 87%
rename from dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/init/redhat_init.erb
rename to dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/init/RedHat/init.erb
index 1dc2da2aff1..617f3eed93b 100644
--- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/init/redhat_init.erb
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/init/RedHat/init.erb
@@ -13,18 +13,26 @@
# xmlrpc interface as well as a few other nifty features.
# processname: supervisord
# config: <%= @config_file %>
-# pidfile: <%= @pid_file %>
+# pidfile: <%= @run_path %>/<%= @pid_file %>
#
# source function library
. /etc/rc.d/init.d/functions
# source system settings
-[ -e <%= @init_extras %> ] && . <%= @init_extras %>
+[ -e <%= @init_defaults %> ] && . <%= @init_defaults %>
RETVAL=0
-DAEMON=/usr/bin/supervisord
+DAEMON=<%= @executable %>
+CTL=<%= @executable_ctl %>
DESC=supervisord
+PIDFILE=<%= @run_path %>/<%= @pid_file %>
+
+# Tests if executable exists
+if [ ! -x $DAEMON ] ; then
+ echo "Executable not found ${DAEMON}"
+ exit 1
+fi
running_pid()
{
@@ -88,7 +96,7 @@ case "$1" in
restart
;;
reload)
- /usr/bin/supervisorctl $OPTIONS reload
+ $CTL $OPTIONS reload
RETVAL=$?
;;
condrestart)
@@ -109,4 +117,4 @@ case "$1" in
exit 1
esac
-exit $RETVAL
\ No newline at end of file
+exit $RETVAL
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/supervisord_main.erb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/supervisord_main.erb
index 1baf5607a2f..8ab8fee51df 100644
--- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/supervisord_main.erb
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/supervisord_main.erb
@@ -1,9 +1,9 @@
[supervisord]
-logfile=<%= @log_file %>
-pidfile=<%= @pid_file %>
+logfile=<%= @log_path %>/<%= @log_file %>
+pidfile=<%= @run_path %>/<%= @pid_file %>
nodaemon=<%= @nodaemon %>
minfds=<%= @minfds %>
-minfds=<%= @minprocs %>
+minprocs=<%= @minprocs %>
umask=<%= @umask %>
<% if @strip_ansi -%>
strip_ansi=<%= @strip_ansi %>
@@ -12,7 +12,7 @@ strip_ansi=<%= @strip_ansi %>
user=<%= @user %>
<% end -%>
<% if @identifier -%>
-indentifier=<%= @identifier %>
+identifier=<%= @identifier %>
<% end -%>
<% if @directory -%>
directory=<%= @directory %>
@@ -31,4 +31,4 @@ environment=<%= @env_string %>
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
[include]
-files=<%= @config_include %>/*.conf
+files=<%= @config_include_string %>
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/supervisord_unix.erb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/supervisord_unix.erb
index 414e75198ba..39e85199916 100644
--- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/supervisord_unix.erb
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/supervisord_unix.erb
@@ -1,5 +1,5 @@
[unix_http_server]
-file=<%= @unix_socket_file %>
+file=<%= @run_path %>/<%= @unix_socket_file %>
chmod=<%= @unix_socket_mode %>
chown=<%= @unix_socket_owner %>:<%= @unix_socket_group %>
<% if @unix_auth -%>
@@ -8,7 +8,7 @@ password=<%= @unix_socket_password %>
<% end -%>
[supervisorctl]
-serverurl=unix://<%= @unix_socket_file %>
+serverurl=unix://<%= @run_path %>/<%= @unix_socket_file %>
<% if @unix_auth -%>
username=<%= @unix_username %>
password=<%= @unix_password %>
diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/tests/program.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/tests/program.pp
index 6c789c96dc1..0d45ebe1b3d 100644
--- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/tests/program.pp
+++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/tests/program.pp
@@ -1,9 +1,35 @@
supervisord::program { 'myprogram':
- command => 'command --args',
- priority => '100',
- environment => {
+ command => 'command --args',
+ process_name => '%(process_num)s',
+ numprocs => '1',
+ numprocs_start => '0',
+ priority => '999',
+ autostart => true,
+ autorestart => 'unexpected',
+ startsecs => '1',
+ startretries => '3',
+ exitcodes => '0,2',
+ stopsignal => 'TERM',
+ stopwaitsecs => '10',
+ stopasgroup => false,
+ killasgroup => false,
+ redirect_stderr => false,
+ stdout_logfile => 'program_foo.log',
+ stdout_logfile_maxbytes => '50MB',
+ stdout_logfile_backups => '10',
+ stdout_capture_maxbytes => '0',
+ stdout_events_enabled => false,
+ stderr_logfile => 'program_foo.error',
+ stderr_logfile_maxbytes => '50MB',
+ stderr_logfile_backups => '10',
+ stderr_capture_maxbytes => '0',
+ stderr_events_enabled => false,
+ environment => {
'HOME' => '/home/myuser',
'PATH' => '/bin:/sbin:/usr/bin:/usr/sbin',
'SECRET' => 'mysecret'
- }
+ },
+ directory => undef,
+ umask => '022',
+ serverurl => 'AUTO'
}
\ No newline at end of file
diff --git a/dev/vagrant/dolibarrdev/puphpet/shell/execute-files.sh b/dev/vagrant/dolibarrdev/puphpet/shell/execute-files.sh
index 06713c2ee99..198d7e2dfb7 100644
--- a/dev/vagrant/dolibarrdev/puphpet/shell/execute-files.sh
+++ b/dev/vagrant/dolibarrdev/puphpet/shell/execute-files.sh
@@ -4,17 +4,27 @@ export DEBIAN_FRONTEND=noninteractive
VAGRANT_CORE_FOLDER=$(cat '/.puphpet-stuff/vagrant-core-folder.txt')
-shopt -s nullglob
-files=("${VAGRANT_CORE_FOLDER}"/files/exec-once/*)
+EXEC_ONCE_DIR="$1"
+EXEC_ALWAYS_DIR="$2"
-if [[ ! -f '/.puphpet-stuff/exec-once-ran' && (${#files[@]} -gt 0) ]]; then
- echo 'Running files in files/exec-once'
- find "${VAGRANT_CORE_FOLDER}/files/exec-once" -maxdepth 1 -not -path '*/\.*' -type f \( ! -iname "empty" \) -exec chmod +x '{}' \; -exec {} \;
- echo 'Finished running files in files/exec-once'
- echo 'To run again, delete file /.puphpet-stuff/exec-once-ran'
- touch /.puphpet-stuff/exec-once-ran
+shopt -s nullglob
+files=("${VAGRANT_CORE_FOLDER}"/files/"${EXEC_ONCE_DIR}"/*)
+
+if [[ (${#files[@]} -gt 0) ]]; then
+ echo "Running files in files/${EXEC_ONCE_DIR}"
+
+ if [ ! -d "/.puphpet-stuff/${EXEC_ONCE_DIR}-ran" ]; then
+ mkdir "/.puphpet-stuff/${EXEC_ONCE_DIR}-ran"
+ echo "Created directory /.puphpet-stuff/${EXEC_ONCE_DIR}-ran"
+ fi
+
+ find "${VAGRANT_CORE_FOLDER}/files/${EXEC_ONCE_DIR}" -maxdepth 1 -not -path '/.*' -type f \( ! -iname "empty" \) -exec cp -n '{}' "/.puphpet-stuff/${EXEC_ONCE_DIR}-ran" \;
+ find "/.puphpet-stuff/${EXEC_ONCE_DIR}-ran" -maxdepth 1 -type f -exec chmod +x '{}' \; -exec ls {} \; | sort | xargs -r0 sh -c
+ echo "Finished running files in files/${EXEC_ONCE_DIR}"
+ echo "To run again, delete file(s) you want rerun in /.puphpet-stuff/${EXEC_ONCE_DIR}-ran or the whole folder to rerun all"
fi
-echo 'Running files in files/exec-always'
-find "${VAGRANT_CORE_FOLDER}/files/exec-always" -maxdepth 1 -not -path '*/\.*' -type f \( ! -iname "empty" \) -exec chmod +x '{}' \; -exec {} \;
-echo 'Finished running files in files/exec-always'
+echo "Running files in files/${EXEC_ALWAYS_DIR}"
+find "${VAGRANT_CORE_FOLDER}/files/${EXEC_ALWAYS_DIR}" -maxdepth 1 -not -path '/.*' -type f \( ! -iname "empty" \) -exec chmod +x '{}' \; -exec ls {} \; | sort | xargs -r0 sh -c
+echo "Finished running files in files/${EXEC_ALWAYS_DIR}"
+
diff --git a/dev/vagrant/dolibarrdev/puphpet/shell/hostsupdater-notice.txt b/dev/vagrant/dolibarrdev/puphpet/shell/hostsupdater-notice.txt
new file mode 100644
index 00000000000..ce3331b3ced
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/shell/hostsupdater-notice.txt
@@ -0,0 +1,4 @@
+===============================================================================
+You have the Vagrant::Hostsupdater plugin installed. You may be required to
+enter your host's root/privileged password below to continue!
+===============================================================================
diff --git a/dev/vagrant/dolibarrdev/puphpet/shell/important-notices.sh b/dev/vagrant/dolibarrdev/puphpet/shell/important-notices.sh
index bd1bb95cabe..21486cd3b93 100644
--- a/dev/vagrant/dolibarrdev/puphpet/shell/important-notices.sh
+++ b/dev/vagrant/dolibarrdev/puphpet/shell/important-notices.sh
@@ -2,8 +2,10 @@
VAGRANT_CORE_FOLDER=$(cat '/.puphpet-stuff/vagrant-core-folder.txt')
-if [[ ! -f '/.puphpet-stuff/displayed-important-notices' ]]; then
- cat "${VAGRANT_CORE_FOLDER}/shell/important-notices.txt"
-
- touch '/.puphpet-stuff/displayed-important-notices'
+if [[ -f '/.puphpet-stuff/displayed-important-notices' ]]; then
+ exit 0
fi
+
+cat "${VAGRANT_CORE_FOLDER}/shell/important-notices.txt"
+
+touch '/.puphpet-stuff/displayed-important-notices'
diff --git a/dev/vagrant/dolibarrdev/puphpet/shell/initial-setup.sh b/dev/vagrant/dolibarrdev/puphpet/shell/initial-setup.sh
index 8fbfe3a2014..e653f8991c1 100644
--- a/dev/vagrant/dolibarrdev/puphpet/shell/initial-setup.sh
+++ b/dev/vagrant/dolibarrdev/puphpet/shell/initial-setup.sh
@@ -8,6 +8,8 @@ OS=$(/bin/bash "${VAGRANT_CORE_FOLDER}/shell/os-detect.sh" ID)
CODENAME=$(/bin/bash "${VAGRANT_CORE_FOLDER}/shell/os-detect.sh" CODENAME)
cat "${VAGRANT_CORE_FOLDER}/shell/self-promotion.txt"
+printf "\n"
+echo ""
if [[ ! -d '/.puphpet-stuff' ]]; then
mkdir '/.puphpet-stuff'
@@ -17,91 +19,49 @@ fi
touch '/.puphpet-stuff/vagrant-core-folder.txt'
echo "${VAGRANT_CORE_FOLDER}" > '/.puphpet-stuff/vagrant-core-folder.txt'
-if [[ ! -f '/.puphpet-stuff/initial-setup-base-packages' ]]; then
- if [ "${OS}" == 'debian' ] || [ "${OS}" == 'ubuntu' ]; then
- echo 'Running initial-setup apt-get update'
- apt-get update >/dev/null
- echo 'Finished running initial-setup apt-get update'
-
- echo 'Installing git'
- apt-get -q -y install git-core >/dev/null
- echo 'Finished installing git'
-
- if [[ "${CODENAME}" == 'lucid' || "${CODENAME}" == 'precise' ]]; then
- echo 'Installing basic curl packages (Ubuntu only)'
- apt-get install -y libcurl3 libcurl4-gnutls-dev curl >/dev/null
- echo 'Finished installing basic curl packages (Ubuntu only)'
- fi
-
- echo 'Installing rubygems'
- apt-get install -y rubygems >/dev/null
- echo 'Finished installing rubygems'
-
- echo 'Installing base packages for r10k'
- apt-get install -y build-essential ruby-dev >/dev/null
- gem install json >/dev/null
- echo 'Finished installing base packages for r10k'
-
- if [ "${OS}" == 'ubuntu' ]; then
- echo 'Updating libgemplugin-ruby (Ubuntu only)'
- apt-get install -y libgemplugin-ruby >/dev/null
- echo 'Finished updating libgemplugin-ruby (Ubuntu only)'
- fi
-
- if [ "${CODENAME}" == 'lucid' ]; then
- echo 'Updating rubygems (Ubuntu Lucid only)'
- gem install rubygems-update >/dev/null 2>&1
- /var/lib/gems/1.8/bin/update_rubygems >/dev/null 2>&1
- echo 'Finished updating rubygems (Ubuntu Lucid only)'
- fi
-
- echo 'Installing r10k'
- gem install r10k >/dev/null 2>&1
- echo 'Finished installing r10k'
-
- touch '/.puphpet-stuff/initial-setup-base-packages'
- elif [[ "${OS}" == 'centos' ]]; then
- echo 'Running initial-setup yum update'
- perl -p -i -e 's@enabled=1@enabled=0@gi' /etc/yum/pluginconf.d/fastestmirror.conf
- perl -p -i -e 's@#baseurl=http://mirror.centos.org/centos/\$releasever/os/\$basearch/@baseurl=http://mirror.rackspace.com/CentOS//\$releasever/os/\$basearch/\nenabled=1@gi' /etc/yum.repos.d/CentOS-Base.repo
- perl -p -i -e 's@#baseurl=http://mirror.centos.org/centos/\$releasever/updates/\$basearch/@baseurl=http://mirror.rackspace.com/CentOS//\$releasever/updates/\$basearch/\nenabled=1@gi' /etc/yum.repos.d/CentOS-Base.repo
- perl -p -i -e 's@#baseurl=http://mirror.centos.org/centos/\$releasever/extras/\$basearch/@baseurl=http://mirror.rackspace.com/CentOS//\$releasever/extras/\$basearch/\nenabled=1@gi' /etc/yum.repos.d/CentOS-Base.repo
-
- yum -y --nogpgcheck install 'http://www.elrepo.org/elrepo-release-6-6.el6.elrepo.noarch.rpm' >/dev/null
- yum -y --nogpgcheck install 'https://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm' >/dev/null
- yum -y install centos-release-SCL >/dev/null
- yum clean all >/dev/null
- yum -y check-update >/dev/null
- echo 'Finished running initial-setup yum update'
-
- echo 'Installing git'
- yum -y install git >/dev/null
- echo 'Finished installing git'
-
- echo 'Updating to Ruby 1.9.3'
- yum -y install centos-release-SCL >/dev/null 2>&1
- yum remove ruby >/dev/null 2>&1
- yum -y install ruby193 ruby193-ruby-irb ruby193-ruby-doc ruby193-libyaml rubygems >/dev/null 2>&1
- yum -y --nogpgcheck install 'https://yum.puppetlabs.com/el/6/dependencies/x86_64/ruby-rgen-0.6.5-2.el6.noarch.rpm' >/dev/null 2>&1
- gem update --system >/dev/null 2>&1
- gem install haml >/dev/null 2>&1
-
- yum -y --nogpgcheck install 'https://yum.puppetlabs.com/el/6/products/x86_64/hiera-1.3.2-1.el6.noarch.rpm' >/dev/null
- yum -y --nogpgcheck install 'https://yum.puppetlabs.com/el/6/products/x86_64/facter-1.7.5-1.el6.x86_64.rpm' >/dev/null
- yum -y --nogpgcheck install 'https://yum.puppetlabs.com/el/6/dependencies/x86_64/rubygem-json-1.5.5-1.el6.x86_64.rpm' >/dev/null
- yum -y --nogpgcheck install 'https://yum.puppetlabs.com/el/6/dependencies/x86_64/ruby-json-1.5.5-1.el6.x86_64.rpm' >/dev/null
- yum -y --nogpgcheck install 'https://yum.puppetlabs.com/el/6/dependencies/x86_64/ruby-shadow-2.2.0-2.el6.x86_64.rpm' >/dev/null
- yum -y --nogpgcheck install 'https://yum.puppetlabs.com/el/6/dependencies/x86_64/ruby-augeas-0.4.1-3.el6.x86_64.rpm' >/dev/null
- echo 'Finished updating to Ruby 1.9.3'
-
- echo 'Installing basic development tools (CentOS)'
- yum -y groupinstall 'Development Tools' >/dev/null
- echo 'Finished installing basic development tools (CentOS)'
-
- echo 'Installing r10k'
- gem install r10k >/dev/null 2>&1
- echo 'Finished installing r10k'
-
- touch '/.puphpet-stuff/initial-setup-base-packages'
- fi
+if [[ -f '/.puphpet-stuff/initial-setup-base-packages' ]]; then
+ exit 0
fi
+
+if [ "${OS}" == 'debian' ] || [ "${OS}" == 'ubuntu' ]; then
+ echo 'Running initial-setup apt-get update'
+ apt-get update >/dev/null
+ echo 'Finished running initial-setup apt-get update'
+
+ echo 'Installing git'
+ apt-get -y install git-core >/dev/null
+ echo 'Finished installing git'
+
+ if [[ "${CODENAME}" == 'lucid' || "${CODENAME}" == 'precise' ]]; then
+ echo 'Installing basic curl packages'
+ apt-get -y install libcurl3 libcurl4-gnutls-dev curl >/dev/null
+ echo 'Finished installing basic curl packages'
+ fi
+
+ echo 'Installing build-essential package'
+ apt-get -y install build-essential >/dev/null
+ echo 'Finished installing build-essential packages'
+elif [[ "${OS}" == 'centos' ]]; then
+ echo 'Adding repos: elrep, epel, scl'
+ perl -p -i -e 's@enabled=1@enabled=0@gi' /etc/yum/pluginconf.d/fastestmirror.conf
+ perl -p -i -e 's@#baseurl=http://mirror.centos.org/centos/\$releasever/os/\$basearch/@baseurl=http://mirror.rackspace.com/CentOS//\$releasever/os/\$basearch/\nenabled=1@gi' /etc/yum.repos.d/CentOS-Base.repo
+ perl -p -i -e 's@#baseurl=http://mirror.centos.org/centos/\$releasever/updates/\$basearch/@baseurl=http://mirror.rackspace.com/CentOS//\$releasever/updates/\$basearch/\nenabled=1@gi' /etc/yum.repos.d/CentOS-Base.repo
+ perl -p -i -e 's@#baseurl=http://mirror.centos.org/centos/\$releasever/extras/\$basearch/@baseurl=http://mirror.rackspace.com/CentOS//\$releasever/extras/\$basearch/\nenabled=1@gi' /etc/yum.repos.d/CentOS-Base.repo
+
+ yum -y --nogpgcheck install 'http://www.elrepo.org/elrepo-release-6-6.el6.elrepo.noarch.rpm' >/dev/null
+ yum -y --nogpgcheck install 'https://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm' >/dev/null
+ yum -y install centos-release-SCL >/dev/null
+ yum clean all >/dev/null
+ yum -y check-update >/dev/null
+ echo 'Finished adding repos: elrep, epel, scl'
+
+ echo 'Installing git'
+ yum -y install git >/dev/null
+ echo 'Finished installing git'
+
+ echo 'Installing Development Tools'
+ yum -y groupinstall 'Development Tools' >/dev/null
+ echo 'Finished installing Development Tools'
+fi
+
+touch '/.puphpet-stuff/initial-setup-base-packages'
diff --git a/dev/vagrant/dolibarrdev/puphpet/shell/install-puppet.sh b/dev/vagrant/dolibarrdev/puphpet/shell/install-puppet.sh
new file mode 100644
index 00000000000..93f1c32c6c7
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/shell/install-puppet.sh
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+export DEBIAN_FRONTEND=noninteractive
+
+VAGRANT_CORE_FOLDER=$(cat '/.puphpet-stuff/vagrant-core-folder.txt')
+
+OS=$(/bin/bash "${VAGRANT_CORE_FOLDER}/shell/os-detect.sh" ID)
+RELEASE=$(/bin/bash "${VAGRANT_CORE_FOLDER}/shell/os-detect.sh" RELEASE)
+CODENAME=$(/bin/bash "${VAGRANT_CORE_FOLDER}/shell/os-detect.sh" CODENAME)
+
+if [[ -f '/.puphpet-stuff/install-puppet' ]]; then
+ exit 0
+fi
+
+if [ "${OS}" == 'debian' ] || [ "${OS}" == 'ubuntu' ]; then
+ apt-get -y install augeas-tools libaugeas-dev
+elif [[ "${OS}" == 'centos' ]]; then
+ yum -y install augeas-devel
+fi
+
+echo 'Installing Puppet requirements'
+/usr/bin/gem install haml hiera facter json ruby-augeas
+echo 'Finished installing Puppet requirements'
+
+echo 'Installing Puppet 3.4.3'
+/usr/bin/gem install puppet --version 3.4.3
+
+if [[ -f '/usr/bin/puppet' ]]; then
+ mv /usr/bin/puppet /usr/bin/puppet-old
+fi
+
+ln -s /usr/local/rvm/wrappers/default/puppet /usr/bin/puppet
+echo 'Finished installing Puppet 3.4.3'
+
+touch '/.puphpet-stuff/install-puppet'
diff --git a/dev/vagrant/dolibarrdev/puphpet/shell/install-ruby.sh b/dev/vagrant/dolibarrdev/puphpet/shell/install-ruby.sh
new file mode 100644
index 00000000000..d1b94e37f7d
--- /dev/null
+++ b/dev/vagrant/dolibarrdev/puphpet/shell/install-ruby.sh
@@ -0,0 +1,43 @@
+#!/bin/bash
+
+export DEBIAN_FRONTEND=noninteractive
+
+VAGRANT_CORE_FOLDER=$(cat '/.puphpet-stuff/vagrant-core-folder.txt')
+
+OS=$(/bin/bash "${VAGRANT_CORE_FOLDER}/shell/os-detect.sh" ID)
+RELEASE=$(/bin/bash "${VAGRANT_CORE_FOLDER}/shell/os-detect.sh" RELEASE)
+CODENAME=$(/bin/bash "${VAGRANT_CORE_FOLDER}/shell/os-detect.sh" CODENAME)
+
+if [[ -f '/.puphpet-stuff/install-ruby' ]]; then
+ exit 0
+fi
+
+if [[ -f '/usr/local/rvm/wrappers/default/ruby' ]]; then
+ RUBY_VERSION=$(/usr/local/rvm/wrappers/default/ruby --version);
+ if [ "grep '1.9.3' ${RUBY_VERSION}" ]; then
+ touch '/.puphpet-stuff/install-ruby'
+ exit 0
+ fi
+fi
+
+echo 'Installing Ruby 1.9.3 using RVM'
+
+curl -sSL https://get.rvm.io | bash -s stable --ruby=1.9.3
+source /usr/local/rvm/scripts/rvm
+
+if [[ -f '/usr/bin/ruby' ]]; then
+ mv /usr/bin/ruby /usr/bin/ruby-old
+fi
+
+if [[ -f '/usr/bin/gem' ]]; then
+ mv /usr/bin/gem /usr/bin/gem-old
+fi
+
+ln -s /usr/local/rvm/wrappers/default/ruby /usr/bin/ruby
+ln -s /usr/local/rvm/wrappers/default/gem /usr/bin/gem
+
+gem update --system >/dev/null
+
+touch '/.puphpet-stuff/install-ruby'
+
+echo 'Finished install Ruby 1.9.3 using RVM'
diff --git a/dev/vagrant/dolibarrdev/puphpet/shell/os-detect.sh b/dev/vagrant/dolibarrdev/puphpet/shell/os-detect.sh
index 3f679008fe8..5a73825dd59 100644
--- a/dev/vagrant/dolibarrdev/puphpet/shell/os-detect.sh
+++ b/dev/vagrant/dolibarrdev/puphpet/shell/os-detect.sh
@@ -1,36 +1,32 @@
#!/bin/bash
-# Try and get debian operating system
-# id, codename, and release
-
TYPE=$(echo "$1" | tr '[A-Z]' '[a-z]')
OS=$(uname)
ID='unknown'
CODENAME='unknown'
RELEASE='unknown'
+ARCH='unknown'
-if [ "${OS}" == 'Linux' ]; then
- # detect centos
- grep 'centos' /etc/issue -i -q
- if [ $? = '0' ]; then
- ID='centos'
- RELEASE=$(cat /etc/redhat-release | grep -o 'release [0-9]' | cut -d " " -f2)
- # could be debian or ubuntu
- elif [ $(which lsb_release) ]; then
- ID=$(lsb_release -i | cut -f2)
- CODENAME=$(lsb_release -c | cut -f2)
- RELEASE=$(lsb_release -r | cut -f2)
- elif [ -f '/etc/lsb-release' ]; then
- ID=$(cat /etc/lsb-release | grep DISTRIB_ID | cut -d "=" -f2)
- CODENAME=$(cat /etc/lsb-release | grep DISTRIB_CODENAME | cut -d "=" -f2)
- RELEASE=$(cat /etc/lsb-release | grep DISTRIB_RELEASE | cut -d "=" -f2)
- elif [ -f '/etc/issue' ]; then
- ID=$(head -1 /etc/issue | cut -d " " -f1)
- if [ -f '/etc/debian_version' ]; then
- RELEASE=$(/dev/null
-echo 'Finished running update r10k'
diff --git a/dev/vagrant/dolibarrdev/puphpet/shell/ssh-keygen.sh b/dev/vagrant/dolibarrdev/puphpet/shell/ssh-keygen.sh
index 6bb7614f9c6..ef00495b2b6 100644
--- a/dev/vagrant/dolibarrdev/puphpet/shell/ssh-keygen.sh
+++ b/dev/vagrant/dolibarrdev/puphpet/shell/ssh-keygen.sh
@@ -5,37 +5,76 @@ VAGRANT_CORE_FOLDER=$(cat '/.puphpet-stuff/vagrant-core-folder.txt')
OS=$(/bin/bash "${VAGRANT_CORE_FOLDER}/shell/os-detect.sh" ID)
VAGRANT_SSH_USERNAME=$(echo "$1")
-if [[ ! -f "${VAGRANT_CORE_FOLDER}/files/dot/ssh/id_rsa" ]]; then
- ssh-keygen -f "${VAGRANT_CORE_FOLDER}/files/dot/ssh/id_rsa" -P ""
+function create_key()
+{
+ BASE_KEY_NAME=$(echo "$1")
- if [[ ! -f "${VAGRANT_CORE_FOLDER}/files/dot/ssh/id_rsa.ppk" ]]; then
- if [ "${OS}" == 'debian' ] || [ "${OS}" == 'ubuntu' ]; then
- apt-get install -y putty-tools >/dev/null
- elif [ "${OS}" == 'centos' ]; then
- yum -y install putty >/dev/null
+ if [[ ! -f "${VAGRANT_CORE_FOLDER}/files/dot/ssh/${BASE_KEY_NAME}" ]]; then
+ ssh-keygen -f "${VAGRANT_CORE_FOLDER}/files/dot/ssh/${BASE_KEY_NAME}" -P ""
+
+ if [[ ! -f "${VAGRANT_CORE_FOLDER}/files/dot/ssh/${BASE_KEY_NAME}.ppk" ]]; then
+ if [ "${OS}" == 'debian' ] || [ "${OS}" == 'ubuntu' ]; then
+ apt-get install -y putty-tools >/dev/null
+ elif [ "${OS}" == 'centos' ]; then
+ yum -y install putty >/dev/null
+ fi
+
+ puttygen "${VAGRANT_CORE_FOLDER}/files/dot/ssh/${BASE_KEY_NAME}" -O private -o "${VAGRANT_CORE_FOLDER}/files/dot/ssh/${BASE_KEY_NAME}.ppk"
fi
- puttygen "${VAGRANT_CORE_FOLDER}/files/dot/ssh/id_rsa" -O private -o "${VAGRANT_CORE_FOLDER}/files/dot/ssh/id_rsa.ppk"
+ echo "Your private key for SSH-based authentication has been saved to 'puphpet/files/dot/ssh/${BASE_KEY_NAME}'!"
+ else
+ echo "Pre-existing private key found at 'puphpet/files/dot/ssh/${BASE_KEY_NAME}'"
fi
+}
- echo 'Your private key for SSH-based authentication have been saved to "puphpet/files/dot/ssh/"!'
-else
- echo 'Using pre-existing private key at "puphpet/files/dot/ssh/id_rsa"'
+create_key 'root_id_rsa'
+create_key 'id_rsa'
+
+PUBLIC_SSH_KEY=$(cat "${VAGRANT_CORE_FOLDER}/files/dot/ssh/id_rsa.pub")
+
+echo 'Adding generated key to /root/.ssh/id_rsa'
+echo 'Adding generated key to /root/.ssh/id_rsa.pub'
+echo 'Adding generated key to /root/.ssh/authorized_keys'
+
+mkdir -p /root/.ssh
+
+cp "${VAGRANT_CORE_FOLDER}/files/dot/ssh/id_rsa" '/root/.ssh/'
+cp "${VAGRANT_CORE_FOLDER}/files/dot/ssh/id_rsa.pub" '/root/.ssh/'
+
+if [[ ! -f '/root/.ssh/authorized_keys' ]] || ! grep -q "${PUBLIC_SSH_KEY}" '/root/.ssh/authorized_keys'; then
+ cat "${VAGRANT_CORE_FOLDER}/files/dot/ssh/id_rsa.pub" >> '/root/.ssh/authorized_keys'
fi
-echo 'Adding generated key to /root/.ssh/authorized_keys'
-mkdir -p /root/.ssh
-cat "${VAGRANT_CORE_FOLDER}/files/dot/ssh/id_rsa.pub" > '/root/.ssh/authorized_keys'
+chown -R root '/root/.ssh'
+chgrp -R root '/root/.ssh'
+chmod 700 '/root/.ssh'
+chmod 644 '/root/.ssh/id_rsa.pub'
+chmod 600 '/root/.ssh/id_rsa'
chmod 600 '/root/.ssh/authorized_keys'
if [ "${VAGRANT_SSH_USERNAME}" != 'root' ]; then
VAGRANT_SSH_FOLDER="/home/${VAGRANT_SSH_USERNAME}/.ssh";
- echo "Adding generated key to ${VAGRANT_SSH_FOLDER}/authorized_keys"
- cat "${VAGRANT_CORE_FOLDER}/files/dot/ssh/id_rsa.pub" > "${VAGRANT_SSH_FOLDER}/authorized_keys"
- chown "${VAGRANT_SSH_USERNAME}" "${VAGRANT_SSH_FOLDER}/authorized_keys"
- chgrp "${VAGRANT_SSH_USERNAME}" "${VAGRANT_SSH_FOLDER}/authorized_keys"
- chmod 600 "${VAGRANT_SSH_FOLDER}/authorized_keys"
-fi
+ mkdir -p "${VAGRANT_SSH_FOLDER}"
-passwd -d vagrant >/dev/null
+ echo "Adding generated key to ${VAGRANT_SSH_FOLDER}/id_rsa"
+ echo "Adding generated key to ${VAGRANT_SSH_FOLDER}/id_rsa.pub"
+ echo "Adding generated key to ${VAGRANT_SSH_FOLDER}/authorized_keys"
+
+ cp "${VAGRANT_CORE_FOLDER}/files/dot/ssh/id_rsa" "${VAGRANT_SSH_FOLDER}/id_rsa"
+ cp "${VAGRANT_CORE_FOLDER}/files/dot/ssh/id_rsa.pub" "${VAGRANT_SSH_FOLDER}/id_rsa.pub"
+
+ if [[ ! -f "${VAGRANT_SSH_FOLDER}/authorized_keys" ]] || ! grep -q "${PUBLIC_SSH_KEY}" "${VAGRANT_SSH_FOLDER}/authorized_keys"; then
+ cat "${VAGRANT_CORE_FOLDER}/files/dot/ssh/id_rsa.pub" >> "${VAGRANT_SSH_FOLDER}/authorized_keys"
+ fi
+
+ chown -R "${VAGRANT_SSH_USERNAME}" "${VAGRANT_SSH_FOLDER}"
+ chgrp -R "${VAGRANT_SSH_USERNAME}" "${VAGRANT_SSH_FOLDER}"
+ chmod 700 "${VAGRANT_SSH_FOLDER}"
+ chmod 644 "${VAGRANT_SSH_FOLDER}/id_rsa.pub"
+ chmod 600 "${VAGRANT_SSH_FOLDER}/id_rsa"
+ chmod 600 "${VAGRANT_SSH_FOLDER}/authorized_keys"
+
+ passwd -d "${VAGRANT_SSH_USERNAME}" >/dev/null
+fi
diff --git a/dev/vagrant/dolibarrdev/puphpet/shell/update-puppet.sh b/dev/vagrant/dolibarrdev/puphpet/shell/update-puppet.sh
deleted file mode 100644
index f8c1f5d2256..00000000000
--- a/dev/vagrant/dolibarrdev/puphpet/shell/update-puppet.sh
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/bin/bash
-
-export DEBIAN_FRONTEND=noninteractive
-
-VAGRANT_CORE_FOLDER=$(cat '/.puphpet-stuff/vagrant-core-folder.txt')
-
-OS=$(/bin/bash "${VAGRANT_CORE_FOLDER}/shell/os-detect.sh" ID)
-RELEASE=$(/bin/bash "${VAGRANT_CORE_FOLDER}/shell/os-detect.sh" RELEASE)
-CODENAME=$(/bin/bash "${VAGRANT_CORE_FOLDER}/shell/os-detect.sh" CODENAME)
-
-if [[ ! -f '/.puphpet-stuff/update-puppet' ]]; then
- if [ "${OS}" == 'debian' ] || [ "${OS}" == 'ubuntu' ]; then
- echo "Downloading http://apt.puppetlabs.com/puppetlabs-release-${CODENAME}.deb"
- wget --quiet --tries=5 --connect-timeout=10 -O "/.puphpet-stuff/puppetlabs-release-${CODENAME}.deb" "http://apt.puppetlabs.com/puppetlabs-release-${CODENAME}.deb"
- echo "Finished downloading http://apt.puppetlabs.com/puppetlabs-release-${CODENAME}.deb"
-
- dpkg -i "/.puphpet-stuff/puppetlabs-release-${CODENAME}.deb" >/dev/null
-
- echo 'Running update-puppet apt-get update'
- apt-get update >/dev/null
- echo 'Finished running update-puppet apt-get update'
-
- echo 'Updating Puppet to version 3.4.x'
- apt-get install -y puppet-common=3.4.* puppet=3.4.* >/dev/null
- apt-mark hold puppet puppet-common >/dev/null
- PUPPET_VERSION=$(puppet help | grep 'Puppet v')
- echo "Finished updating puppet to latest version: ${PUPPET_VERSION}"
-
- touch '/.puphpet-stuff/update-puppet'
- elif [ "${OS}" == 'centos' ]; then
- echo "Downloading http://yum.puppetlabs.com/el/${RELEASE}/products/x86_64/puppet-3.4.3-1.el6.noarch.rpm"
- yum -y --nogpgcheck install "http://yum.puppetlabs.com/el/${RELEASE}/products/x86_64/puppet-3.4.3-1.el6.noarch.rpm" >/dev/null
- echo "Finished downloading http://yum.puppetlabs.com/el/${RELEASE}/products/x86_64/puppet-3.4.3-1.el6.noarch.rpm"
-
- echo 'Installing/Updating Puppet to version 3.4.x'
- yum -y install yum-versionlock puppet >/dev/null
- yum versionlock puppet
- PUPPET_VERSION=$(puppet help | grep 'Puppet v')
- echo "Finished installing/updating puppet to version: ${PUPPET_VERSION}"
-
- touch '/.puphpet-stuff/update-puppet'
- fi
-fi
diff --git a/htdocs/.gitignore b/htdocs/.gitignore
index a4ebd2bb7c7..8ba0a69acb3 100644
--- a/htdocs/.gitignore
+++ b/htdocs/.gitignore
@@ -2,6 +2,7 @@
/custom*
/extensions*
/nltechno*
+/anco*
/bootstrap*
/google*
/multicompany*
diff --git a/htdocs/accountancy/class/index.html b/htdocs/accountancy/class/index.html
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/htdocs/accountancy/index.html b/htdocs/accountancy/index.html
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/htdocs/accountancy/index.php b/htdocs/accountancy/index.php
deleted file mode 100644
index 7db0dd9ebf9..00000000000
--- a/htdocs/accountancy/index.php
+++ /dev/null
@@ -1 +0,0 @@
-Url not available
\ No newline at end of file
diff --git a/htdocs/adherents/admin/adherent.php b/htdocs/adherents/admin/adherent.php
index 0a251536ff6..670260f1287 100644
--- a/htdocs/adherents/admin/adherent.php
+++ b/htdocs/adherents/admin/adherent.php
@@ -68,11 +68,11 @@ if ($action == 'update' || $action == 'add')
if (! $error)
{
- $mesg = ''.$langs->trans("SetupSaved").'
';
+ setEventMessage($langs->trans("SetupSaved"));
}
else
{
- $mesg = ''.$langs->trans("Error").'
';
+ setEventMessage($langs->trans("Error"), 'errors');
}
}
@@ -117,10 +117,6 @@ $head = member_admin_prepare_head();
dol_fiche_head($head, 'general', $langs->trans("Members"), 0, 'user');
-
-dol_htmloutput_mesg($mesg);
-
-
print_fiche_titre($langs->trans("MemberMainOptions"),'','');
print '';
print '';
diff --git a/htdocs/adherents/admin/adherent_extrafields.php b/htdocs/adherents/admin/adherent_extrafields.php
index 059e42d50f5..1c98c2c16ba 100644
--- a/htdocs/adherents/admin/adherent_extrafields.php
+++ b/htdocs/adherents/admin/adherent_extrafields.php
@@ -35,7 +35,7 @@ $extrafields = new ExtraFields($db);
$form = new Form($db);
// List of supported format
-$tmptype2label=getStaticMember(get_class($extrafields),'type2label');
+$tmptype2label=ExtraFields::$type2label;
$type2label=array('');
foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val);
diff --git a/htdocs/adherents/admin/adherent_type_extrafields.php b/htdocs/adherents/admin/adherent_type_extrafields.php
index dca8796b681..b2f839e3c3c 100644
--- a/htdocs/adherents/admin/adherent_type_extrafields.php
+++ b/htdocs/adherents/admin/adherent_type_extrafields.php
@@ -36,7 +36,7 @@ $extrafields = new ExtraFields($db);
$form = new Form($db);
// List of supported format
-$tmptype2label=getStaticMember(get_class($extrafields),'type2label');
+$tmptype2label=ExtraFields::$type2label;
$type2label=array('');
foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val);
diff --git a/htdocs/adherents/admin/public.php b/htdocs/adherents/admin/public.php
index 8a520a55c4e..740a5c97879 100644
--- a/htdocs/adherents/admin/public.php
+++ b/htdocs/adherents/admin/public.php
@@ -60,11 +60,11 @@ if ($action == 'update')
if (! $error)
{
- $mesg = "".$langs->trans("SetupSaved")." ";
+ setEventMessage($langs->trans("SetupSaved"));
}
else
{
- $mesg = "".$langs->trans("Error")." ";
+ setEventMessage($langs->trans("Error"), 'errors');
}
}
@@ -86,8 +86,6 @@ $head = member_admin_prepare_head();
dol_fiche_head($head, 'public', $langs->trans("Members"), 0, 'user');
-dol_htmloutput_mesg($mesg);
-
if ($conf->use_javascript_ajax)
{
print "\n".'
+
trans("Article"); ?>
@@ -103,7 +104,9 @@ $langs->load("cashdesk");
trans("VATRate"); ?>
-
+
+
+
@@ -112,7 +115,9 @@ $langs->load("cashdesk");
currency; ?>
-
+
+
+
currency; ?>
@@ -154,7 +159,9 @@ $langs->load("cashdesk");
-
+
+
+
diff --git a/htdocs/cashdesk/tpl/index.html b/htdocs/cashdesk/tpl/index.html
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/htdocs/cashdesk/tpl/index.php b/htdocs/cashdesk/tpl/index.php
deleted file mode 100644
index 7db0dd9ebf9..00000000000
--- a/htdocs/cashdesk/tpl/index.php
+++ /dev/null
@@ -1 +0,0 @@
-Url not available
\ No newline at end of file
diff --git a/htdocs/cashdesk/tpl/menu.tpl.php b/htdocs/cashdesk/tpl/menu.tpl.php
index 59800fb57c1..4ee52ce0da6 100644
--- a/htdocs/cashdesk/tpl/menu.tpl.php
+++ b/htdocs/cashdesk/tpl/menu.tpl.php
@@ -78,4 +78,3 @@ if (!empty($_SESSION["CASHDESK_ID_WAREHOUSE"]) && ! empty($conf->stock->enabled)
}
print '';
print '';
-?>
\ No newline at end of file
diff --git a/htdocs/cashdesk/tpl/ticket.tpl.php b/htdocs/cashdesk/tpl/ticket.tpl.php
index 54e82c3ded7..9ea8cb70943 100644
--- a/htdocs/cashdesk/tpl/ticket.tpl.php
+++ b/htdocs/cashdesk/tpl/ticket.tpl.php
@@ -153,4 +153,5 @@ echo ''.$langs->trans("TotalTTC").' trans("Close"); ?>
-