vadimzud.pmxsible.ansible_collection (1.0.0) — module

manages ansible collections

| "added in version" 1.0.0 of vadimzud.pmxsible"

Authors: Vadim Zudin (@VadimZud) <zudinvadim@gmail.com>

Install collection

Install with ansible-galaxy collection install vadimzud.pmxsible:==1.0.0


Add to requirements.yml

  collections:
    - name: vadimzud.pmxsible
      version: 1.0.0

Description

Manages ansible collections.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Install community.postgresql collection
  vadimzud.pmxsible.ansible_collection:
    name: community.postgresql
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Install community.postgresql collection on version 2.4.1
  vadimzud.pmxsible.ansible_collection:
    name: community.postgresql:==2.4.1
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Install community.postgresql collection with version specifiers
  vadimzud.pmxsible.ansible_collection:
    name: community.postgresql:>2.2.1,<2.4.1,!=2.3.5
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Install multi collections
  vadimzud.pmxsible.ansible_collection:
    name:
      - community.postgresql
      - community.rabbitmq
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Install multi collections with version specifiers
  vadimzud.pmxsible.ansible_collection:
    name:
      - community.postgresql:>2.2.1,<2.4.1,!=2.3.5
      - community.rabbitmq:>1.1.0,<1.2.0,!=1.1.1
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Install a collection in a git repository using https
  vadimzud.pmxsible.ansible_collection:
    name: git+https://github.com/VadimZud/pmxsible.git
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
      
- name: Install a collection in a git repository using the latest commit on the branch 'main'
  vadimzud.pmxsible.ansible_collection:
    # Don`t use
    # name: git+https://github.com/VadimZud/pmxsible.git,main
    # or
    # name: 'git+https://github.com/VadimZud/pmxsible.git,main'
    # Internally ansible will split string to list with ',' delimiter
    #(['git+https://github.com/VadimZud/pmxsible.git', 'main']).
    # For version specifiers it isn`t problem because vesion specifier doesh`t
    # looks like collection name and module can fix it.
    # For branch name or commit identifier it isn`t true, so use list syntax
    # explicitly:
    name: 
      - git+https://github.com/VadimZud/pmxsible.git,main
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
    #or
    #name: ['git+https://github.com/VadimZud/pmxsible.git,main']

- name: Install a collection in a git repository using ssh
  vadimzud.pmxsible.ansible_collection:
    name: git@github.com:VadimZud/pmxsible.git
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Install a collection from a local git repository
  vadimzud.pmxsible.ansible_collection:
    name: git+file:///home/user/path/to/repo_name.git
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Install a collection from a tarball
  vadimzud.pmxsible.ansible_collection:
    name: /tmp/my_namespace-my_collection-1.0.0.tar.gz
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Install a collection from source directory
  vadimzud.pmxsible.ansible_collection:
    name: ./my_namespace/my_collection/
    chdir: /path/to/my_namespace/parent/
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Install a collection from a tarball  without contacting any distribution servers
  vadimzud.pmxsible.ansible_collection:
    name: /tmp/my_namespace-my_collection-1.0.0.tar.gz
    extra_args: --offline
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
      
- name: Install multiple collections with a requirements file
  vadimzud.pmxsible.ansible_collection:
    requirements: /my_app/requirements.yml
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Install community.postgresql, forcing reinstallation if it's already installed
  vadimzud.pmxsible.ansible_collection:
    name: community.postgresql
    state: forcereinstall

Inputs

    
name:
    description:
    - The name of a Ansible collection to install or the url of the remote package.
    - This can be a list and contain version specifiers.
    elements: str
    type: list

chdir:
    description:
    - cd into this directory before running the command.
    type: path

state:
    choices:
    - absent
    - forcereinstall
    - latest
    - present
    default: present
    description:
    - The state of module
    type: str

executable:
    default: ansible-galaxy
    description:
    - The executable or pathname for the ansible-galaxy executable.
    type: path

extra_args:
    description:
    - Extra arguments passed to ansible-galaxy collection.
    type: str

requirements:
    description:
    - The path to a ansible-galaxy requirements file, which should be local to the remote
      system.
    type: str

Outputs

cmd:
  description: ansible-galaxy command used by the module
  elements: str
  returned: always
  sample:
  - ansible-galaxy
  - collection
  - install
  - community.postgresql
  - community.rabbitmq
  type: list