community.general.cargo (6.6.8) — 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:==6.6.8


Add to requirements.yml

  collections:
    - name: community.general
      version: 6.6.8

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 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 C(/bin). In other words, C(/usr/local) will become C(/usr/local/bin).
    type: path

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

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