summaryrefslogtreecommitdiffstats
path: root/modules/rust/manifests
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2018-10-08 03:08:44 -0400
committerJesse Luehrs <doy@tozt.net>2018-10-08 03:08:44 -0400
commit28a100fab7d434471b53c88cf1bf6118bb2b74a2 (patch)
treed354a4a4e872a37c171724db75b8a31db8a144e2 /modules/rust/manifests
parent6308eae87cad1e899d0531bc996a39e3be236f8e (diff)
downloadpuppet-tozt-28a100fab7d434471b53c88cf1bf6118bb2b74a2.tar.gz
puppet-tozt-28a100fab7d434471b53c88cf1bf6118bb2b74a2.zip
support installing packages with cargo
Diffstat (limited to 'modules/rust/manifests')
-rw-r--r--modules/rust/manifests/init.pp5
-rw-r--r--modules/rust/manifests/user.pp14
2 files changed, 19 insertions, 0 deletions
diff --git a/modules/rust/manifests/init.pp b/modules/rust/manifests/init.pp
new file mode 100644
index 0000000..37f74ac
--- /dev/null
+++ b/modules/rust/manifests/init.pp
@@ -0,0 +1,5 @@
+class rust {
+ package { "rustup":
+ ensure => installed,
+ }
+}
diff --git a/modules/rust/manifests/user.pp b/modules/rust/manifests/user.pp
new file mode 100644
index 0000000..e94a5fd
--- /dev/null
+++ b/modules/rust/manifests/user.pp
@@ -0,0 +1,14 @@
+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",
+ require => [
+ Package["rustup"],
+ User[$user],
+ ],
+ }
+}