1. Etienne Perot
  2. pupfiles

Commits

Etienne Perot  committed fac322b

Add synergy module (to manage synergy+ clients and servers) and add info to blorb.pp manifest

  • Participants
  • Parent commits ea16192
  • Branches master

Comments (0)

Files changed (6)

File manifests/blorb.pp

View file
 class {'base::etienne':}
 
-network_interface {$ethernet_macaddress:
-	rename => 'wired0',
-	macspoof => false, # Desktop machine, not much risk
-	ipv6_privacy => true
-}
-
 class {'console':}
 
 class {'desktop':
 	games => true,
 	dpi => 102
 }
+
+network_interface {$ethernet_macaddress:
+	rename => 'wired0',
+	macspoof => false, # Desktop machine, not much risk
+	ipv6_privacy => true
+}
+
+class {'synergy::server':
+	config => template('private/synergy/blorb2.synergy.conf')
+}

File modules/synergy/files/server/.synergys.sh

View file
+#!/usr/bin/env bash
+
+exec synergys

File modules/synergy/manifests/client.pp

View file
+class synergy::client (
+	$node = $hostname,
+	$server
+) {
+	require synergy
+	enduser_file {'.synergyc.sh':
+		content => regsubst(regsubst(template('synergy/client/.synergyc.sh'), '%SYNERGY_SERVER%', $server), '%SYNERGY_NODE%', $node)
+	}
+	kde_autostart {'.synergyc.sh':
+		simplename => 'synergyc.sh'
+	}
+}

File modules/synergy/manifests/init.pp

View file
+class synergy {
+	package {'synergy':} # Includes both server and client
+}

File modules/synergy/manifests/server.pp

View file
+class synergy::server (
+	$node = $hostname,
+	$config
+) {
+	require synergy
+	enduser_file {'.synergy.conf':
+		content => $config
+	}
+	enduser_file {'.synergys.sh':
+		mode => 0700,
+		source => 'synergy/server'
+	}
+	kde_autostart {'.synergys.sh':
+		simplename => 'synergys.sh'
+	}
+}

File modules/synergy/templates/client/.synergyc.sh

View file
+#!/usr/bin/env bash
+
+SYNERGY_SERVER='%SYNERGY_SERVER%'
+SYNERGY_NODE='%SYNERGY_NODE%'
+
+exec synergyc --daemon --restart --no-tray --name "$SYNERGY_NODE" "$SYNERGY_SERVER"