summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Dittberner <jandd@cacert.org>2018-02-22 13:00:00 +0100
committerJan Dittberner <jandd@cacert.org>2018-02-22 13:00:00 +0100
commitf9b4c787b451558ac01dea26632cfec119c1ca6b (patch)
treef9879a0cf543faca23dd388d3fe6616262b370fa
parent51edf7e5fb71eb7c1efa4136c280570df6764e44 (diff)
downloadcacert-puppet-f9b4c787b451558ac01dea26632cfec119c1ca6b.tar.gz
cacert-puppet-f9b4c787b451558ac01dea26632cfec119c1ca6b.tar.xz
cacert-puppet-f9b4c787b451558ac01dea26632cfec119c1ca6b.zip
Setup zsh new user template
-rw-r--r--hieradata/common.yaml2
-rw-r--r--sitemodules/profiles/files/base/newuser.zshrc.recommended37
-rw-r--r--sitemodules/profiles/manifests/base.pp9
3 files changed, 47 insertions, 1 deletions
diff --git a/hieradata/common.yaml b/hieradata/common.yaml
index da1b702..e7c4ba8 100644
--- a/hieradata/common.yaml
+++ b/hieradata/common.yaml
@@ -4,7 +4,7 @@ profiles::base::users:
username: jandd
fullname: Jan Dittberner
uid: 1000
- shell: /bin/bash
+ shell: /bin/zsh
password: ENC[PKCS7,MIIB2gYJKoZIhvcNAQcDoIIByzCCAccCAQAxggEhMIIBHQIBADAFMAACAQEwDQYJKoZIhvcNAQEBBQAEggEAYmmeAt8w5DMzcB2T84r/s2mikksh1kxVFEG5Nk0o/jOh0BSdtKnEZLYV1SRa2Gvgu6ACqLAqYD+4c9neAnYcQrYL5y9rXC+l61bid3L83wM2XkBJYt534ZlU8XqjEB7R7wyQu+uVXA6PAqy9YccAJmAkDiIHy07yVoG8biG71IoCX7f40Otw28iXLU/N7xoX5ngGrWZaVDkQulwGxFAjD9KDwho9/pPXFEfqdeuJSuL3t3O3PEumvuva+qiZHO8Mb4Ngg8wDgHNFHXLjxohBGQ4e2RgrrcGWwFa+nSFRSukOecFv+WNzBbnNon7hiZ3QiFZoH9ooWIbfghWfZiWAezCBnAYJKoZIhvcNAQcBMB0GCWCGSAFlAwQBKgQQSYlfah+RAoUKmvuQGB79E4BwJDg6EL2YyQ1GWFxz2EYj9cjaVD4AhLUJqsgex5YozliQZCPcflv3VoegHTp2jJ742HbrRDZmE7ZNlsj7BswpOVtE1SO4Xqh4OJTmvLy4V2G2sac/usorrB5LwS+n55Fp/PTBHe3VD0R0Ywv24K6bYg==]
ssh_keys:
-
diff --git a/sitemodules/profiles/files/base/newuser.zshrc.recommended b/sitemodules/profiles/files/base/newuser.zshrc.recommended
new file mode 100644
index 0000000..f463d06
--- /dev/null
+++ b/sitemodules/profiles/files/base/newuser.zshrc.recommended
@@ -0,0 +1,37 @@
+# Set up the prompt
+
+autoload -Uz promptinit
+promptinit
+prompt fire
+
+setopt histignorealldups sharehistory
+
+# Use emacs keybindings even if our EDITOR is set to vi
+bindkey -e
+
+# Keep 1000 lines of history within the shell and save it to ~/.zsh_history:
+HISTSIZE=1000
+SAVEHIST=1000
+HISTFILE=~/.zsh_history
+
+# Use modern completion system
+autoload -Uz compinit
+compinit
+
+zstyle ':completion:*' auto-description 'specify: %d'
+zstyle ':completion:*' completer _expand _complete _correct _approximate
+zstyle ':completion:*' format 'Completing %d'
+zstyle ':completion:*' group-name ''
+zstyle ':completion:*' menu select=2
+eval "$(dircolors -b)"
+zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
+zstyle ':completion:*' list-colors ''
+zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s
+zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=* l:|=*'
+zstyle ':completion:*' menu select=long
+zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s
+zstyle ':completion:*' use-compctl false
+zstyle ':completion:*' verbose true
+
+zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31'
+zstyle ':completion:*:kill:*' command 'ps -u $USER -o pid,%cpu,tty,cputime,cmd'
diff --git a/sitemodules/profiles/manifests/base.pp b/sitemodules/profiles/manifests/base.pp
index f5e1579..d33e8f7 100644
--- a/sitemodules/profiles/manifests/base.pp
+++ b/sitemodules/profiles/manifests/base.pp
@@ -99,6 +99,15 @@ class profiles::base (
ensure => purged,
}
+ file { '/etc/zsh/newuser.zshrc.recommended':
+ ensure => file,
+ owner => 'root',
+ group => 'root',
+ mode => '0644',
+ source => 'puppet:///modules/profiles/base/newuser.zshrc.recommended',
+ require => Package['zsh'],
+ }
+
file { '/etc/apt/sources.list':
ensure => file,
owner => 'root',