community / community.general / 3.8.10 / module / ansible_galaxy_install Install Ansible roles or collections using ansible-galaxy | "added in version" 3.5.0 of community.general" Authors: Alexei Znamensky (@russoz)community.general.ansible_galaxy_install (3.8.10) — module
Install with ansible-galaxy collection install community.general:==3.8.10
collections: - name: community.general version: 3.8.10
This module allows the installation of Ansible collections or roles using C(ansible-galaxy).
- name: Install collection community.network community.general.ansible_galaxy_install: type: collection name: community.network
- name: Install role at specific path community.general.ansible_galaxy_install: type: role name: ansistrano.deploy dest: /ansible/roles
- name: Install collections and roles together community.general.ansible_galaxy_install: type: both requirements_file: requirements.yml
- name: Force-install collection community.network at specific version community.general.ansible_galaxy_install: type: collection name: community.network:3.0.2 force: true
dest: description: - The path to the directory containing your collections or roles, according to the value of I(type). - 'Please notice that C(ansible-galaxy) will not install collections with I(type=both), when I(requirements_file) contains both roles and collections and I(dest) is specified. ' type: path name: description: - Name of the collection or role being installed. - 'Versions can be specified with C(ansible-galaxy) usual formats. For example, the collection C(community.docker:1.6.1) or the role C(ansistrano.deploy,3.8.0). ' - I(name) and I(requirements_file) are mutually exclusive. type: str type: choices: - collection - role - both description: - The type of installation performed by C(ansible-galaxy). - If I(type) is C(both), then I(requirements_file) must be passed and it may contain both roles and collections. - 'Note however that the opposite is not true: if using a I(requirements_file), then I(type) can be any of the three choices.' - 'B(Ansible 2.9): The option C(both) will have the same effect as C(role).' required: true type: str force: default: false description: - Force overwriting an existing role or collection. - Using I(force=true) is mandatory when downgrading. - 'B(Ansible 2.9 and 2.10): Must be C(true) to upgrade roles and collections.' type: bool ack_ansible29: default: false description: - Acknowledge using Ansible 2.9 with its limitations, and prevents the module from generating warnings about them. - This option is completely ignored if using a version of Ansible greater than C(2.9.x). type: bool requirements_file: description: - Path to a file containing a list of requirements to be installed. - It works for I(type) equals to C(collection) and C(role). - I(name) and I(requirements_file) are mutually exclusive. - 'B(Ansible 2.9): It can only be used to install either I(type=role) or I(type=collection), but not both at the same run.' type: path
dest: description: The value of the I(dest) parameter. returned: always type: str force: description: The value of the I(force) parameter. returned: always type: bool installed_collections: contains: <path>: description: Collections and versions for that path type: dict description: - If I(requirements_file) is specified instead, returns dictionary with all the collections installed per path. - If I(name) is specified, returns that collection name and the version installed per path. - 'B(Ansible 2.9): Returns empty because C(ansible-galaxy) has no C(list) subcommand.' returned: always when installing collections sample: /custom/ansible/ansible_collections: community.general: 3.1.0 /home/az/.ansible/collections/ansible_collections: community.docker: 1.6.0 community.general: 3.0.2 type: dict installed_roles: contains: <path>: description: Roles and versions for that path. type: dict description: - If I(requirements_file) is specified instead, returns dictionary with all the roles installed per path. - If I(name) is specified, returns that role name and the version installed per path. - 'B(Ansible 2.9): Returns empty because C(ansible-galaxy) has no C(list) subcommand.' returned: always when installing roles sample: /custom/ansible/roles: ansistrano.deploy: 3.8.0 /home/user42/.ansible/roles: ansistrano.deploy: 3.9.0 baztian.xfce: v0.0.3 type: dict name: description: The value of the I(name) parameter. returned: always type: str new_collections: description: New collections installed by this module. returned: success sample: community.docker: 1.6.1 community.general: 3.1.0 type: dict new_roles: description: New roles installed by this module. returned: success sample: ansistrano.deploy: 3.8.0 baztian.xfce: v0.0.3 type: dict requirements_file: description: The value of the I(requirements_file) parameter. returned: always type: str type: description: The value of the I(type) parameter. returned: always type: str