summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2018-11-18 17:15:21 -0500
committerJesse Luehrs <doy@tozt.net>2018-11-18 17:15:21 -0500
commit28993965cd5cfe1a7df6b41ca9dced4d5621d21f (patch)
treec3562ec1675e0a1da06d4cc05790fd022aa6c86f /modules
parent2a0b1d8dd5b26bbcbcd51b0218b80064df01ed8e (diff)
downloadpuppet-tozt-28993965cd5cfe1a7df6b41ca9dced4d5621d21f.tar.gz
puppet-tozt-28993965cd5cfe1a7df6b41ca9dced4d5621d21f.zip
install a duplicati client
Diffstat (limited to 'modules')
-rw-r--r--modules/duplicati/manifests/client.pp27
-rw-r--r--modules/duplicati/manifests/init.pp41
-rw-r--r--modules/duplicati/manifests/server.pp39
3 files changed, 68 insertions, 39 deletions
diff --git a/modules/duplicati/manifests/client.pp b/modules/duplicati/manifests/client.pp
new file mode 100644
index 0000000..f631d42
--- /dev/null
+++ b/modules/duplicati/manifests/client.pp
@@ -0,0 +1,27 @@
+class duplicati::client {
+ package { ['python-yaml', 'python-dateutil', 'python-requests']:
+ ensure => installed;
+ }
+
+ file {
+ '/usr/local/bin/duplicati-client':
+ ensure => link,
+ target => '/opt/duplicati-client/duplicati_client.py',
+ require => Exec['checkout duplicati-client'];
+ }
+
+ $duplicati_client_sha = '4f8b46a6f00dc719d84278e66b5a17939fb4a3d6'
+ exec { 'clone duplicati-client':
+ command => '/usr/bin/git clone git://github.com/Pectojin/duplicati-client',
+ cwd => '/opt',
+ creates => '/opt/duplicati-client/.git';
+ }
+
+ exec { 'checkout duplicati-client':
+ provider => shell,
+ command => "/usr/bin/git checkout $duplicati_client_sha",
+ unless => "test \"\$(git rev-parse @)\" = \"$duplicati_client_sha\""
+ cwd => '/opt/duplicati-client',
+ require => Exec['clone duplicati-client'];
+ }
+}
diff --git a/modules/duplicati/manifests/init.pp b/modules/duplicati/manifests/init.pp
index e62763f..2caf0e4 100644
--- a/modules/duplicati/manifests/init.pp
+++ b/modules/duplicati/manifests/init.pp
@@ -1,41 +1,4 @@
class duplicati {
- include systemd
-
- package {
- [
- "gtk-sharp-2",
- "mono",
- ]:
- ensure => installed,
- install_options => ["--asdeps"];
- }
-
- package::makepkg { 'duplicati-latest':
- ensure => installed,
- require => [
- Package['gtk-sharp-2'],
- Package['mono'],
- ]
- }
-
- file {
- '/etc/systemd/system/duplicati.service.d':
- ensure => directory;
- '/etc/systemd/system/duplicati.service.d/override.conf':
- source => 'puppet:///modules/duplicati/override.conf',
- notify => Exec['/usr/bin/systemctl daemon-reload'],
- require => File['/etc/systemd/system/duplicati.service.d'];
- }
-
- service { 'duplicati':
- ensure => running,
- enable => true,
- require => [
- Package::Makepkg['duplicati-latest'],
- File['/etc/systemd/system/duplicati.service.d/override.conf'],
- Exec['/usr/bin/systemctl daemon-reload'],
- ];
- }
-
- # XXX configure backups
+ contain duplicati::server
+ contain duplicati::client
}
diff --git a/modules/duplicati/manifests/server.pp b/modules/duplicati/manifests/server.pp
new file mode 100644
index 0000000..f057426
--- /dev/null
+++ b/modules/duplicati/manifests/server.pp
@@ -0,0 +1,39 @@
+class duplicati::server {
+ include systemd
+
+ package {
+ [
+ "gtk-sharp-2",
+ "mono",
+ ]:
+ ensure => installed,
+ install_options => ["--asdeps"];
+ }
+
+ package::makepkg { 'duplicati-latest':
+ ensure => installed,
+ require => [
+ Package['gtk-sharp-2'],
+ Package['mono'],
+ ]
+ }
+
+ file {
+ '/etc/systemd/system/duplicati.service.d':
+ ensure => directory;
+ '/etc/systemd/system/duplicati.service.d/override.conf':
+ source => 'puppet:///modules/duplicati/override.conf',
+ notify => Exec['/usr/bin/systemctl daemon-reload'],
+ require => File['/etc/systemd/system/duplicati.service.d'];
+ }
+
+ service { 'duplicati':
+ ensure => running,
+ enable => true,
+ require => [
+ Package::Makepkg['duplicati-latest'],
+ File['/etc/systemd/system/duplicati.service.d/override.conf'],
+ Exec['/usr/bin/systemctl daemon-reload'],
+ ];
+ }
+}