diff modules/php/manifests/repo/debian.pp @ 386:3fce34f642f1

Add a PHP module to handle platform differences
author IBBoard <dev@ibboard.co.uk>
date Mon, 03 Jan 2022 17:09:39 +0000
parents
children adf6fe9bbc17
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/php/manifests/repo/debian.pp	Mon Jan 03 17:09:39 2022 +0000
@@ -0,0 +1,67 @@
+# Configure debian apt repo
+#
+# === Parameters
+#
+# [*location*]
+#   Location of the apt repository
+#
+# [*release*]
+#   Release of the apt repository
+#
+# [*repos*]
+#   Apt repository names
+#
+# [*include_src*]
+#   Add source source repository
+#
+# [*key*]
+#   Public key in apt::key format
+#
+# [*dotdeb*]
+#   Enable special dotdeb handling
+#
+# [*sury*]
+#   Enable special sury handling
+#
+class php::repo::debian (
+  String[1] $location     = 'https://packages.dotdeb.org',
+  String[1] $release      = 'wheezy-php56',
+  String[1] $repos        = 'all',
+  Boolean $include_src    = false,
+  Hash $key               = {
+    'id'     => '6572BBEF1B5FF28B28B706837E3F070089DF5277',
+    'source' => 'http://www.dotdeb.org/dotdeb.gpg',
+  },
+  Boolean $dotdeb         = true,
+  Boolean $sury           = true,
+) {
+  assert_private()
+
+  include 'apt'
+
+  apt::source { "source_php_${release}":
+    location => $location,
+    release  => $release,
+    repos    => $repos,
+    include  => {
+      'src' => $include_src,
+      'deb' => true,
+    },
+    key      => $key,
+  }
+
+  if ($sury and $php::globals::php_version in ['7.1','7.2']) {
+    apt::source { 'source_php_sury':
+      location => 'https://packages.sury.org/php/',
+      repos    => 'main',
+      include  => {
+        'src' => $include_src,
+        'deb' => true,
+      },
+      key      => {
+        id     => '15058500A0235D97F5D10063B188E2B695BD4743',
+        source => 'https://packages.sury.org/php/apt.gpg',
+      },
+    }
+  }
+}