community.general.cargo (8.5.0) — module

Manage Rust packages with cargo

| "added in version" 4.3.0 of community.general"

Authors: Radek Sprta (@radek-sprta)

Install collection

Install with ansible-galaxy collection install community.general:==8.5.0


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

Description

Manage Rust packages with cargo.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Install "ludusavi" Rust package
  community.general.cargo:
    name: ludusavi
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Install "ludusavi" Rust package with locked dependencies
  community.general.cargo:
    name: ludusavi
    locked: true
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Install "ludusavi" Rust package in version 0.10.0
  community.general.cargo:
    name: ludusavi
    version: '0.10.0'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Install "ludusavi" Rust package to global location
  community.general.cargo:
    name: ludusavi
    path: /usr/local
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove "ludusavi" Rust package
  community.general.cargo:
    name: ludusavi
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Update "ludusavi" Rust package its latest version
  community.general.cargo:
    name: ludusavi
    state: latest

Inputs

    
name:
    description:
    - The name of a Rust package to install.
    elements: str
    required: true
    type: list

path:
    description: -> The base path where to install the Rust packages. Cargo automatically
      appends V(/bin). In other words, V(/usr/local) will become V(/usr/local/bin).
    type: path

state:
    choices:
    - present
    - absent
    - latest
    default: present
    description:
    - The state of the Rust package.
    required: false
    type: str

locked:
    default: false
    description:
    - Install with locked dependencies.
    - This is only used when installing packages.
    required: false
    type: bool
    version_added: 7.5.0
    version_added_collection: community.general

version:
    description: -> The version to install. If O(name) contains multiple values, the module
      will try to install all of them in this version.
    required: false
    type: str

executable:
    description:
    - Path to the C(cargo) installed in the system.
    - If not specified, the module will look C(cargo) in E(PATH).
    type: path
    version_added: 7.5.0
    version_added_collection: community.general