summaryrefslogtreecommitdiffstats
path: root/modules/conf/manifests/user.pp
blob: 51816cab56ae53857967b51b28d18faa2584ed45 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
define conf::user($user=$name) {
  $home = base::home($user)

  include conf

  exec { "git clone doy/conf for $user":
    command => "/usr/bin/git clone https://github.com/doy/conf",
    user => $user,
    cwd => $home,
    creates => "$home/conf",
    require => [
      User[$user],
      File[$home],
      Class['git'],
    ];
  }

  exec { "conf make install for $user":
    command => "/usr/bin/make install",
    user => $user,
    cwd => "$home/conf",
    environment => [
      "HOME=$home",
      "PWD=$home/conf",
    ],
    creates => "$home/.vimrc",
    require => [
      Class['c_toolchain'],
      User[$user],
      Exec["git clone doy/conf for $user"],
      Package["vim"],
      Package["fortune-mod"],
      Package["less"],
    ];
  }
}