community.general.cargo module – Manage Rust packages with cargo
Note
This module is part of the community.general collection (version 4.8.3).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install community.general
.
To use it in a playbook, specify: community.general.cargo
.
New in version 4.3.0: of community.general
Requirements
The below requirements are needed on the host that executes this module.
cargo installed in bin path (recommended /usr/local/bin)
Parameters
Parameter |
Comments |
---|---|
The name of a Rust package to install. |
|
-> The base path where to install the Rust packages. Cargo automatically appends |
|
The state of the Rust package. Choices:
|
|
-> The version to install. If name contains multiple values, the module will try to install all of them in this version. |
Examples
- name: Install "ludusavi" Rust package
community.general.cargo:
name: ludusavi
- name: Install "ludusavi" Rust package in version 0.10.0
community.general.cargo:
name: ludusavi
version: '0.10.0'
- name: Install "ludusavi" Rust package to global location
community.general.cargo:
name: ludusavi
path: /usr/local
- name: Remove "ludusavi" Rust package
community.general.cargo:
name: ludusavi
state: absent
- name: Update "ludusavi" Rust package its latest version
community.general.cargo:
name: ludusavi
state: latest
Authors
Radek Sprta (@radek-sprta)
Collection links
Issue Tracker Repository (Sources) Submit a bug report Request a feature Communication