rustup::global
: Manage global Rust installation withrustup
rustup
: Manage a user’s Rust installation withrustup
rustup::exec
: Run arustup
commandrustup::global::target
: Install a target for a toolchain for global installationrustup::global::toolchain
: Install a toolchain for global installationrustup::target
: Install a target for a toolchainrustup::toolchain
: Install a toolchain
rustup_internal
: Manage a user’s Rust installation withrustup
rustup::home
: Return the default home directory for a user on this OS
Rustup::OptionalStringOrArray
: Convenience type to make params easier to readRustup::Profile
: Profile for toolchain installation
Manage global Rust installation with rustup
include rustup::global
The following parameters are available in the rustup::global
class:
ensure
user
manage_user
purge_toolchains
purge_targets
dist_server
home
shell
env_scripts_append
env_scripts_create
installer_source
Data type: Enum[present, latest, absent]
present
- install rustup, but don’t update it.latest
- install rustup and update it on every puppet run.absent
- uninstall rustup and the tools it manages.
Default value: present
Data type: String[1]
The user to own and manage rustup. We recommend not using root or any other existing user.
Default value: 'rustup'
Data type: Boolean
Whether or not to manage $user
user.
Default value: true
Data type: Boolean
Whether or not to uninstall toolchains that aren’t managed by Puppet.
Default value: false
Data type: Boolean
Whether or not to uninstall targets that aren’t managed by Puppet.
Default value: false
Data type: Optional[Stdlib::HTTPUrl]
Override RUSTUP_DIST_SERVER
. Set to 'https://dev-static.rust-lang.org'
to install pre-release toolchains.
Default value: undef
Data type: Stdlib::Absolutepath
Where to install rustup and the rust toolchains. Will contain rustup and cargo directories.
Default value: '/opt/rust'
Data type: Stdlib::Absolutepath
Shell for the rustup user. This can be a nologin shell.
Default value: '/bin/bash'
Data type: Array[Stdlib::Absolutepath]
Scripts to append with line that sources the cargo environment script.
Default value: ['/etc/bashrc']
Data type: Array[Stdlib::Absolutepath]
Paths that will get links to the cargo environment script.
Default value:
$facts['os']['family'] ? {
'Darwin' => [],
default => ['/etc/profile.d/99-cargo.sh']
Data type: Stdlib::HTTPUrl
URL of the rustup installation script. Changing this will have no effect after the initial installation.
Default value: 'https://sh.rustup.rs'
The name should be the username.
rustup { 'daniel': }
The following parameters are available in the rustup
defined type:
ensure
user
default_toolchain
toolchains
purge_toolchains
targets
purge_targets
dist_server
home
rustup_home
cargo_home
modify_path
installer_source
Data type: Enum[present, latest, absent]
present
- install rustup, but don’t update it.latest
- install rustup and update it on every puppet run.absent
- uninstall rustup and the tools it manages.
Default value: present
Data type: String[1]
The user to own and manage rustup.
Default value: $name
Data type: Optional[String[1]]
Which toolchain should be the default.
Default value: undef
Data type: Array[String[1]]
The toolchains to install.
Default value: []
Data type: Boolean
Whether or not to uninstall toolchains that aren’t managed by Puppet.
Default value: false
Data type: Array[String[1]]
The targets to install. These can take two forms:
"$target $toolchain"
: Install$target
for$toolchain
."$target"
: Install$target
for the default toolchain.
You can use 'default'
to indicate the target for the current host.
Default value: []
Data type: Boolean
Whether or not to uninstall targets that aren’t managed by Puppet.
Default value: false
Data type: Optional[Stdlib::HTTPUrl]
Override RUSTUP_DIST_SERVER
. Set to 'https://dev-static.rust-lang.org'
to install pre-release toolchains.
Default value: undef
Data type: Stdlib::Absolutepath
The user’s home directory. This defaults to /home/$user
on Linux and
/Users/$user
on macOS.
Default value: rustup::home($user)
Data type: Stdlib::Absolutepath
Where toolchains are installed. Generally you shouldn’t change this.
Default value: "${home}/.rustup"
Data type: Stdlib::Absolutepath
Where cargo
installs executables. Generally you shouldn’t change this.
Default value: "${home}/.cargo"
Data type: Boolean
Whether or not to let rustup
modify the user’s PATH
in their shell init
scripts. This only affects the initial installation and removal.
Default value: true
Data type: Stdlib::HTTPUrl
URL of the rustup installation script. Changing this will have no effect after the initial installation.
Default value: 'https://sh.rustup.rs'
The name should start with the username followed by a colon and a space, then the command. For example:
rustup::exec { 'daniel: rustup default nightly': }
The following parameters are available in the rustup::exec
defined type:
Data type: String[1]
The user to run as. Automatically set if the $name
of the resource follows
the rules above.
Default value: $name.split(': ')[0]
Data type: String[1]
The command to run, e.g. 'rustup default stable'. Automatically set if the
$name
of the resource follows the rules above.
Default value: $name.split(': ')[1]
Data type: Optional[String[1]]
Only run when if this path does not exist. (See exec
documentation.)
Default value: undef
Data type: Array[String[1]]
Additional environment variables to set beyond RUSTUP_HOME
, CARGO_HOME
,
and PATH
.
Default value: []
Data type: Rustup::OptionalStringOrArray
Only run when $onlyif
returns success. (See exec
documentation.)
Default value: undef
Data type: Boolean
Only run this when it receives an event. (See exec
documentation.)
Default value: false
Data type: Rustup::OptionalStringOrArray
Only run when $unless
returns failure. (See exec
documentation.)
Default value: undef
Data type: Stdlib::Absolutepath
The user’s home directory. This defaults to /home/$user
on Linux and
/Users/$user
on macOS. This is only used to calculate defaults for the
$rustup_home
and $cargo_home
parameters.
Default value: rustup::home($user)
Data type: Stdlib::Absolutepath
Where toolchains are installed. Generally you shouldn’t change this.
Default value: "${home}/.rustup"
Data type: Stdlib::Absolutepath
Where cargo
installs executables. Generally you shouldn’t change this.
Default value: "${home}/.cargo"
Data type: Stdlib::Absolutepath
Where rustup
installs proxy executables. Generally you shouldn’t change
this.
Default value: "${cargo_home}/bin"
Data type: Hash[String[1], Any]
Other parameters to pass to exec. They may override any of the other parameters.
Default value: {}
You can name this two ways to automatically set the parameters:
"$target $toolchain"
: install$target
for$toolchain
in the global installation. For example,'x86_64-unknown-linux-gnu nightly'
."$target"
: install$target
for the default toolchain in the global installation. For example:'stable'
.
The following parameters are available in the rustup::global::target
defined type:
Data type: Enum[present, absent]
Whether the target should be present or absent.
Default value: present
Data type: String[1]
The name of the target to install, e.g. "sparcv9-sun-solaris". Automatically
set if the $name
of the resource follows the rules above.
Default value: $name.split(' ')[0]
Data type: Optional[String[1]]
The name of the toolchain in which to install the target, e.g. "stable".
undef
means the default toolchain. Automatically set if the $name
of the
resource follows the rules above.
Default value: $name.split(' ')[1]
The name should just be the toolchain. For example:
rustup::global::toolchain { 'stable': }
The following parameters are available in the rustup::global::toolchain
defined type:
Data type: Enum[present, latest, absent]
present
- install toolchain if it doesn’t exist, but don’t update it.latest
- install toolchain and update it on every puppet run.absent
- uninstall toolchain.
Default value: present
Data type: String[1]
The name of the toolchain to install, e.g. "stable".
Default value: $name
Data type: Rustup::Profile
Profile to use for installation. This determines which components will be installed initially.
Changing this for an existing installation will not have an effect even if
it causes an update, i.e. when ensure => latest
is set.
Default value: 'default'
You can name this two ways to automatically set the parameters:
"$rustup: $target $toolchain"
: install$target
for$toolchain
for therustup
resource named$rustup
(normally the username). For example,'daniel: x86_64-unknown-linux-gnu nightly'
."$rustup: $target"
: install$target
for the default toolchain for therustup
resource named$rustup
(normally the username). For example:'daniel: stable'
.
You may use the string 'default'
as the target to indicate the target that
corresponds to the current host.
The following parameters are available in the rustup::target
defined type:
Data type: Enum[present, absent]
Whether the target should be present or absent.
Default value: present
Data type: String[1]
The name of the rustup
installation (normally the username). Automatically
set if the $name
of the resource follows the rules above.
Default value: $name.split(': ')[0]
Data type: String[1]
The name of the target to install, e.g. "sparcv9-sun-solaris". Automatically
set if the $name
of the resource follows the rules above.
Default value: $name.split(': ')[1].split(' ')[0]
Data type: Optional[String[1]]
The name of the toolchain in which to install the target, e.g. "stable".
undef
means the default toolchain. Automatically set if the $name
of the
resource follows the rules above.
Default value: $name.split(': ')[1].split(' ')[1]
The name should start with the name of the rustup
resource (normally the
name of the user) followed by a colon and a space, then the toolchain. For
example:
rustup::toolchain { 'daniel: stable': }
The following parameters are available in the rustup::toolchain
defined type:
Data type: Enum[present, latest, absent]
present
- install toolchain if it doesn’t exist, but don’t update it.latest
- install toolchain and update it on every puppet run.absent
- uninstall toolchain.
Default value: present
Data type: String[1]
The name of the rustup
installation (normally the username). Automatically
set if the $name
of the resource follows the rules above.
Default value: $name.split(': ')[0]
Data type: String[1]
The name of the toolchain to install, e.g. "stable". Automatically set if
the $name
of the resource follows the rules above.
Default value: $name.split(': ')[1]
Data type: Rustup::Profile
Profile to use for installation. This determines which components will be installed initially.
Changing this for an existing installation will not have an effect even if
it causes an update, i.e. when ensure => latest
is set.
Default value: 'default'
Convenience type to make params easier to read
Alias of Variant[Undef, String[1], Array[String[1]]]
default
is a keyword in Puppet, so it must always be wrapped in quotes.
Alias of Enum[minimal, 'default', complete]