tmux: Make config file optional and configurable

This commit is contained in:
Ossi Salmi 2014-01-20 00:54:02 +02:00
parent 2106fdb0ae
commit 4a071406d7
2 changed files with 22 additions and 21 deletions

View file

@ -1,9 +0,0 @@
set -g prefix C-a
set -g base-index 1
set -g status off
bind C-a send-prefix
bind C-l last-window
bind C-n next-window
bind C-p previous-window
bind C-@ next-window
bind Space next-window

View file

@ -1,23 +1,33 @@
# Install tmux # Install tmux.
# #
class tmux { # === Parameters
#
# $source:
# Configuration file source. None by default.
#
class tmux($source=undef) {
if $::operatingsystem != "OpenBSD" { if $::operatingsystem != "OpenBSD" {
package { "tmux": package { "tmux":
ensure => installed, ensure => installed,
before => File["/etc/tmux.conf"], before => $source ? {
undef => undef,
default => File["/etc/tmux.conf"],
},
} }
} }
file { "/etc/tmux.conf": if $source {
ensure => present, file { "/etc/tmux.conf":
mode => "0644", ensure => present,
owner => "root", mode => "0644",
group => $::operatingsystem ? { owner => "root",
"openbsd" => "wheel", group => $::operatingsystem ? {
default => "root", "openbsd" => "wheel",
}, default => "root",
source => "puppet:///modules/tmux/tmux.conf", },
source => $source,
}
} }
} }