Skip to content

Commit

Permalink
Added a ton of stuff related to workstation::role
Browse files Browse the repository at this point in the history
  • Loading branch information
Spencer Krum committed May 7, 2012
1 parent ce5b068 commit 4d2153e
Show file tree
Hide file tree
Showing 9 changed files with 154 additions and 2 deletions.
1 change: 1 addition & 0 deletions data/workstation/common.yaml
@@ -0,0 +1 @@
---
1 change: 1 addition & 0 deletions data/workstation/development/common.yaml
@@ -0,0 +1 @@
---
1 change: 1 addition & 0 deletions data/workstation/itops/common.yaml
@@ -0,0 +1 @@
---
4 changes: 2 additions & 2 deletions manifests/nodes/interceptor.pp
Expand Up @@ -7,11 +7,11 @@
}

class {'workstation::role::development':
users => ['nibz'],
user => ['nibz'],
}

class {'workstation::role::itops':
users => ['nibz'],
user => ['nibz'],
}

}
133 changes: 133 additions & 0 deletions modules/users/manifests/nibz.pp
@@ -0,0 +1,133 @@
class users::nibz($user=true) {
$username = 'nibz'
$home = '/home/mythmon'

This comment has been minimized.

Copy link
@mythmon

mythmon May 7, 2012

I'm flattered, but I don't think there is room in my apartment for the both of us.

This comment has been minimized.

Copy link
@nibalizer

nibalizer May 8, 2012

Owner

Muahahaa.

$uid = 1861

if $system {
user { $username:
ensure => present,
home => $home,
uid => $uid,
gid => "users",
groups => ['users', 'wheel'],
managehome => true,
shell => '/bin/zsh',
require => Package['zsh'],
}
}

if ($::system) or ($::id == $username) {
file {
"${username}-tmp":
path => "${home}/tmp",
ensure => directory,
owner => $username,
group => "users";
"${username}-bin":
path => "${home}/bin",
ensure => directory,
owner => $username,
group => "users";
}

@file {
"${username}-serve":
tag => "zsh",
path => "${home}/.zshrc.d/aliases",
content => "alias serve='twistd -n web --path .\n'",
owner => $username,
group => "users";
}

os::user_config { $username: }
conky::user_config { $username: }
openbox::user_config { $username: }
ruby::dev::user_config { $username: }

vim::user_config { $username:
template => "users/nibz/vimrc.erb",
pathogen => true,
}
vim::solarized { $username: }
git::user_config { $username:
template => "users/nibalizer/gitconfig.erb",
}
zsh::user_config { $username:
template => "users/nibalizer/zshrc.erb"
}


@file {
"${username}_zshd":
path => "${home}/.zshrc.d",
tag => "zsh",
owner => $username,
group => "users",
ensure => directory;

"${username}-func":
path => "${home}/.zshrc.d/00_func",
content => template("users/mythmon/zsh/00_func.erb"),
tag => "zsh",
owner => $username,
group => "users",
ensure => present;
"${username}-01_hash_color":
path => "${home}/.zshrc.d/01_hash_color",
content => template("users/mythmon/zsh/01_hash_color.erb"),
tag => "zsh",
owner => $username,
group => "users",
ensure => present;

This comment has been minimized.

Copy link
@mythmon

mythmon May 7, 2012

Is it possible we could reduce the amount of repetition here? I tried when I wrote it originally, but I couldn't get it to work before :(

This comment has been minimized.

Copy link
@nibalizer

nibalizer May 8, 2012

Owner

I think we can. My first goal is to get a nibz user managed by puppet int he same way your mythmon user is managed, just because I don't want to go changing code that I don't understand because it never affected me. That zshrc.d block is begging for a defined type don't you think? takes in a source and a priority and a destination and installs a file resource there? Then you can put the source, priority, dest(probably implied) in hiera....

This comment has been minimized.

Copy link
@mythmon

mythmon May 8, 2012

That sounds nice. I was actually more interested in the way that you can provide defaults for resources, such as Package { ensure => latest }, but that didn't seem to work for virtuals when I tried it.

"${username}-02_signals":
path => "${home}/.zshrc.d/02_signals",
content => template("users/mythmon/zsh/02_signals.erb"),
tag => "zsh",
owner => $username,
group => "users",
ensure => present;
"${username}-10_autoterm":
path => "${home}/.zshrc.d/10_autoterm",
content => template("users/mythmon/zsh/10_autoterm.erb"),
tag => "zsh",
owner => $username,
group => "users",
ensure => present;
"${username}-20_auto_ls":
path => "${home}/.zshrc.d/20_auto_ls",
content => template("users/mythmon/zsh/20_auto_ls.erb"),
tag => "zsh",
owner => $username,
group => "users",
ensure => present;
"${username}-50_git":
path => "${home}/.zshrc.d/50_git",
content => template("users/mythmon/zsh/50_git.erb"),
tag => "zsh",
owner => $username,
group => "users",
ensure => present;
"${username}-51_misc":
path => "${home}/.zshrc.d/51_misc",
content => template("users/mythmon/zsh/51_misc.erb"),
tag => "zsh",
owner => $username,
group => "users",
ensure => present;
"${username}-52_ssh":
path => "${home}/.zshrc.d/52_ssh",
content => template("users/mythmon/zsh/52_ssh.erb"),
tag => "zsh",
owner => $username,
group => "users",
ensure => present;
"${username}-90_prompt":
path => "${home}/.zshrc.d/90_prompt",
content => template("users/mythmon/zsh/90_prompt.erb"),
tag => "zsh",
owner => $username,
group => "users",
ensure => present;
}
}
}
5 changes: 5 additions & 0 deletions modules/workstation/manifests/role/development.pp
@@ -0,0 +1,5 @@
class workstation::role::development(
user = [],
){
include "workstation::role::development::$user"

This comment has been minimized.

Copy link
@mythmon

mythmon May 7, 2012

Oh. I did not know you could do that. (The $user bit). Nice.

}
3 changes: 3 additions & 0 deletions modules/workstation/manifests/role/development/nibz.pp
@@ -0,0 +1,3 @@
class workstation::role::development::nibz{
include user::nibz
}
5 changes: 5 additions & 0 deletions modules/workstation/manifests/role/itops.pp
@@ -0,0 +1,5 @@
class workstation::role::itops(
user = [],
){
include "workstation::role::itops::$user"
}
3 changes: 3 additions & 0 deletions modules/workstation/manifests/role/itops/nibz.pp
@@ -0,0 +1,3 @@
class workstation::role::itops::nibz{
include user::nibz
}

0 comments on commit 4d2153e

Please sign in to comment.