summaryrefslogtreecommitdiffstats
path: root/modules/rust/manifests/user.pp
blob: 6f84d20778fe45d25e1eebb893ac8eaf30c173fc (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
define rust::user($user=$name) {
  include rust

  exec { "install and configure stable toolchain for $user":
    provider => "shell",
    command => "rustup default stable",
    user => $user,
    unless => "rustup show active-toolchain | grep -q stable",
    timeout => 3600,
    require => [
      Package["rustup"],
      User[$user],
    ],
  }

  exec { "uninstall rust docs":
    provider => "shell",
    command => "rustup component remove rust-docs",
    user => $user,
    onlyif => "rustup component list | grep -q 'rust-docs.*installed'",
    require => [
      Package["rustup"],
      User[$user],
      Exec["install and configure stable toolchain for $user"],
    ],
  }
}