Move CAcert repository setup to includeable profile
authorJan Dittberner <jandd@cacert.org>
Mon, 12 Aug 2019 19:27:56 +0000 (21:27 +0200)
committerJan Dittberner <jandd@cacert.org>
Mon, 12 Aug 2019 19:27:56 +0000 (21:27 +0200)
sitemodules/profiles/manifests/cacert_boardvoting.pp
sitemodules/profiles/manifests/cacert_debrepo.pp [new file with mode: 0644]

index e44e03a..e0de9b3 100644 (file)
@@ -67,19 +67,10 @@ class profiles::cacert_boardvoting (
   String $server_private_key,
   String $vote_notice_mail_address = 'cacert-board-votes@lists.cacert.org',
 ) {
-  include apt
-  apt::key { 'cacert':
-    id      => '4C4F8164EFE3DAFEC82F22FC82D61CAA4E904466',
-    source  => 'http://webstatic.infra.cacert.org/cacert-debian-archive-2019.gpg',
-    options => 'http-proxy=http://proxyout:3128',
-  }
-  apt::source { 'cacert':
-    location => 'http://webstatic.infra.cacert.org',
-    repos    => 'main',
-    release  => "${::lsbdistcodename}-cacert",
-  } ->
+  include profiles::cacert_debrepo
   package { 'cacert-boardvoting':
     ensure  => latest,
+    require => Apt::Source['cacert'],
   } ->
   file { '/srv/cacert-boardvoting/config.yaml':
     ensure  => file,
diff --git a/sitemodules/profiles/manifests/cacert_debrepo.pp b/sitemodules/profiles/manifests/cacert_debrepo.pp
new file mode 100644 (file)
index 0000000..33e6295
--- /dev/null
@@ -0,0 +1,35 @@
+# Class: profiles::cacert_debrepo
+# ===============================
+#
+# Setup for the CAcert internal debian repository.
+#
+# This manifest is meant to be included from other manifests.
+#
+# Examples
+# --------
+#
+# @example
+#   include profiles::cacert_debrepo
+#
+# Authors
+# -------
+#
+# Jan Dittberner <jandd@cacert.org>
+#
+# Copyright
+# ---------
+#
+# Copyright 2019 Jan Dittberner
+class profiles::icinga2_common () {
+  include apt
+  apt::key { 'cacert':
+    id      => '4C4F8164EFE3DAFEC82F22FC82D61CAA4E904466',
+    source  => 'http://webstatic.infra.cacert.org/cacert-debian-archive-2019.gpg',
+    options => 'http-proxy=http://proxyout:3128',
+  }
+  apt::source { 'cacert':
+    location => 'http://webstatic.infra.cacert.org',
+    repos    => 'main',
+    release  => "${::lsbdistcodename}-cacert",
+  }
+}