1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/tests/integration/targets/ansible_galaxy_install/tasks/main.yml

89 lines
2.3 KiB
YAML
Raw Normal View History

ansible_galaxy_install - new module (#2933) * initial commit * multiple changes: - added a proper process_command_output() - adjusted the output_params fields (and removed other *_params fields) * added RETURN documentation, plus few adjustments * fixed sanity tests * updated BOTMETA.yml * further adjustments * integration tests - first commit * removed unused files from integration test * added role installation tests * removed extraneous cmd line option * added requirement-file installation tests * adjusted documentation and output variable names * fixed integration test * Update plugins/modules/packaging/language/ansible_galaxy_install.py Co-authored-by: Ajpantuso <ajpantuso@gmail.com> * Update plugins/modules/packaging/language/ansible_galaxy_install.py Co-authored-by: Ajpantuso <ajpantuso@gmail.com> * Update plugins/modules/packaging/language/ansible_galaxy_install.py Co-authored-by: Ajpantuso <ajpantuso@gmail.com> * Update plugins/modules/packaging/language/ansible_galaxy_install.py Co-authored-by: Ajpantuso <ajpantuso@gmail.com> * Update plugins/modules/packaging/language/ansible_galaxy_install.py Co-authored-by: Ajpantuso <ajpantuso@gmail.com> * Update plugins/modules/packaging/language/ansible_galaxy_install.py Co-authored-by: Ajpantuso <ajpantuso@gmail.com> * Update plugins/modules/packaging/language/ansible_galaxy_install.py Co-authored-by: Ajpantuso <ajpantuso@gmail.com> * Update plugins/modules/packaging/language/ansible_galaxy_install.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update tests/integration/targets/ansible_galaxy_install/aliases Co-authored-by: Felix Fontein <felix@fontein.de> * Per comments in the PR: - fixed missing paths case - fixed install parsing (regexp) for ansible-galaxy collection install in v2.10 * changed the collection installed in test to something unlikely to come embedded in Ansible itself * fixed logic for Ansible 2.9 * kill trailing whitespace * changed default language from C.UTF-8 to en_US.UTF-8 * updated c.g version * skipping test in python 2.6, as ansible-galaxy no longer supports it in devel * Multiple changes: - improved docs on ansible 2.9 and python 2.6 - removed method __changed__() - unnecessary since tracking changes in the ansible29_change var - renamed methods __run29__() and __run210plus__() to __setup29__() and __setup210plus__(), respectively - ansible 2.9 warning for requirements_file only when type is "both" * sanity fix * further adjustments * removed extraneous doc * changed method to determine remote ansible version * do not allow type=both in Ansible 2.9 * Update plugins/modules/packaging/language/ansible_galaxy_install.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/modules/packaging/language/ansible_galaxy_install.py Co-authored-by: Felix Fontein <felix@fontein.de> * changed method names per PR Co-authored-by: Ajpantuso <ajpantuso@gmail.com> Co-authored-by: Felix Fontein <felix@fontein.de>
2021-07-29 22:30:20 +02:00
---
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
ansible_galaxy_install - new module (#2933) * initial commit * multiple changes: - added a proper process_command_output() - adjusted the output_params fields (and removed other *_params fields) * added RETURN documentation, plus few adjustments * fixed sanity tests * updated BOTMETA.yml * further adjustments * integration tests - first commit * removed unused files from integration test * added role installation tests * removed extraneous cmd line option * added requirement-file installation tests * adjusted documentation and output variable names * fixed integration test * Update plugins/modules/packaging/language/ansible_galaxy_install.py Co-authored-by: Ajpantuso <ajpantuso@gmail.com> * Update plugins/modules/packaging/language/ansible_galaxy_install.py Co-authored-by: Ajpantuso <ajpantuso@gmail.com> * Update plugins/modules/packaging/language/ansible_galaxy_install.py Co-authored-by: Ajpantuso <ajpantuso@gmail.com> * Update plugins/modules/packaging/language/ansible_galaxy_install.py Co-authored-by: Ajpantuso <ajpantuso@gmail.com> * Update plugins/modules/packaging/language/ansible_galaxy_install.py Co-authored-by: Ajpantuso <ajpantuso@gmail.com> * Update plugins/modules/packaging/language/ansible_galaxy_install.py Co-authored-by: Ajpantuso <ajpantuso@gmail.com> * Update plugins/modules/packaging/language/ansible_galaxy_install.py Co-authored-by: Ajpantuso <ajpantuso@gmail.com> * Update plugins/modules/packaging/language/ansible_galaxy_install.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update tests/integration/targets/ansible_galaxy_install/aliases Co-authored-by: Felix Fontein <felix@fontein.de> * Per comments in the PR: - fixed missing paths case - fixed install parsing (regexp) for ansible-galaxy collection install in v2.10 * changed the collection installed in test to something unlikely to come embedded in Ansible itself * fixed logic for Ansible 2.9 * kill trailing whitespace * changed default language from C.UTF-8 to en_US.UTF-8 * updated c.g version * skipping test in python 2.6, as ansible-galaxy no longer supports it in devel * Multiple changes: - improved docs on ansible 2.9 and python 2.6 - removed method __changed__() - unnecessary since tracking changes in the ansible29_change var - renamed methods __run29__() and __run210plus__() to __setup29__() and __setup210plus__(), respectively - ansible 2.9 warning for requirements_file only when type is "both" * sanity fix * further adjustments * removed extraneous doc * changed method to determine remote ansible version * do not allow type=both in Ansible 2.9 * Update plugins/modules/packaging/language/ansible_galaxy_install.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/modules/packaging/language/ansible_galaxy_install.py Co-authored-by: Felix Fontein <felix@fontein.de> * changed method names per PR Co-authored-by: Ajpantuso <ajpantuso@gmail.com> Co-authored-by: Felix Fontein <felix@fontein.de>
2021-07-29 22:30:20 +02:00
###################################################
- name: Install collection netbox.netbox
community.general.ansible_galaxy_install:
type: collection
name: netbox.netbox
register: install_c0
- name: Assert collection was installed
assert:
that:
- install_c0 is changed
- '"netbox.netbox" in install_c0.new_collections'
- name: Install collection netbox.netbox (again)
community.general.ansible_galaxy_install:
type: collection
name: netbox.netbox
register: install_c1
- name: Assert collection was not installed
assert:
that:
- install_c1 is not changed
###################################################
- name: Install role ansistrano.deploy
community.general.ansible_galaxy_install:
type: role
name: ansistrano.deploy
register: install_r0
- name: Assert collection was installed
assert:
that:
- install_r0 is changed
- '"ansistrano.deploy" in install_r0.new_roles'
- name: Install role ansistrano.deploy (again)
community.general.ansible_galaxy_install:
type: role
name: ansistrano.deploy
register: install_r1
- name: Assert role was not installed
assert:
that:
- install_r1 is not changed
###################################################
- name:
set_fact:
reqs_file: '{{ remote_tmp_dir }}/reqs.yaml'
ansible_galaxy_install - new module (#2933) * initial commit * multiple changes: - added a proper process_command_output() - adjusted the output_params fields (and removed other *_params fields) * added RETURN documentation, plus few adjustments * fixed sanity tests * updated BOTMETA.yml * further adjustments * integration tests - first commit * removed unused files from integration test * added role installation tests * removed extraneous cmd line option * added requirement-file installation tests * adjusted documentation and output variable names * fixed integration test * Update plugins/modules/packaging/language/ansible_galaxy_install.py Co-authored-by: Ajpantuso <ajpantuso@gmail.com> * Update plugins/modules/packaging/language/ansible_galaxy_install.py Co-authored-by: Ajpantuso <ajpantuso@gmail.com> * Update plugins/modules/packaging/language/ansible_galaxy_install.py Co-authored-by: Ajpantuso <ajpantuso@gmail.com> * Update plugins/modules/packaging/language/ansible_galaxy_install.py Co-authored-by: Ajpantuso <ajpantuso@gmail.com> * Update plugins/modules/packaging/language/ansible_galaxy_install.py Co-authored-by: Ajpantuso <ajpantuso@gmail.com> * Update plugins/modules/packaging/language/ansible_galaxy_install.py Co-authored-by: Ajpantuso <ajpantuso@gmail.com> * Update plugins/modules/packaging/language/ansible_galaxy_install.py Co-authored-by: Ajpantuso <ajpantuso@gmail.com> * Update plugins/modules/packaging/language/ansible_galaxy_install.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update tests/integration/targets/ansible_galaxy_install/aliases Co-authored-by: Felix Fontein <felix@fontein.de> * Per comments in the PR: - fixed missing paths case - fixed install parsing (regexp) for ansible-galaxy collection install in v2.10 * changed the collection installed in test to something unlikely to come embedded in Ansible itself * fixed logic for Ansible 2.9 * kill trailing whitespace * changed default language from C.UTF-8 to en_US.UTF-8 * updated c.g version * skipping test in python 2.6, as ansible-galaxy no longer supports it in devel * Multiple changes: - improved docs on ansible 2.9 and python 2.6 - removed method __changed__() - unnecessary since tracking changes in the ansible29_change var - renamed methods __run29__() and __run210plus__() to __setup29__() and __setup210plus__(), respectively - ansible 2.9 warning for requirements_file only when type is "both" * sanity fix * further adjustments * removed extraneous doc * changed method to determine remote ansible version * do not allow type=both in Ansible 2.9 * Update plugins/modules/packaging/language/ansible_galaxy_install.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/modules/packaging/language/ansible_galaxy_install.py Co-authored-by: Felix Fontein <felix@fontein.de> * changed method names per PR Co-authored-by: Ajpantuso <ajpantuso@gmail.com> Co-authored-by: Felix Fontein <felix@fontein.de>
2021-07-29 22:30:20 +02:00
- name: Copy requirements file
copy:
src: 'files/test.yml'
dest: '{{ reqs_file }}'
- name: Install from requirements file
community.general.ansible_galaxy_install:
type: both
requirements_file: "{{ reqs_file }}"
register: install_rq0
ignore_errors: true
- name: Assert requirements file was installed
ansible_galaxy_install - new module (#2933) * initial commit * multiple changes: - added a proper process_command_output() - adjusted the output_params fields (and removed other *_params fields) * added RETURN documentation, plus few adjustments * fixed sanity tests * updated BOTMETA.yml * further adjustments * integration tests - first commit * removed unused files from integration test * added role installation tests * removed extraneous cmd line option * added requirement-file installation tests * adjusted documentation and output variable names * fixed integration test * Update plugins/modules/packaging/language/ansible_galaxy_install.py Co-authored-by: Ajpantuso <ajpantuso@gmail.com> * Update plugins/modules/packaging/language/ansible_galaxy_install.py Co-authored-by: Ajpantuso <ajpantuso@gmail.com> * Update plugins/modules/packaging/language/ansible_galaxy_install.py Co-authored-by: Ajpantuso <ajpantuso@gmail.com> * Update plugins/modules/packaging/language/ansible_galaxy_install.py Co-authored-by: Ajpantuso <ajpantuso@gmail.com> * Update plugins/modules/packaging/language/ansible_galaxy_install.py Co-authored-by: Ajpantuso <ajpantuso@gmail.com> * Update plugins/modules/packaging/language/ansible_galaxy_install.py Co-authored-by: Ajpantuso <ajpantuso@gmail.com> * Update plugins/modules/packaging/language/ansible_galaxy_install.py Co-authored-by: Ajpantuso <ajpantuso@gmail.com> * Update plugins/modules/packaging/language/ansible_galaxy_install.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update tests/integration/targets/ansible_galaxy_install/aliases Co-authored-by: Felix Fontein <felix@fontein.de> * Per comments in the PR: - fixed missing paths case - fixed install parsing (regexp) for ansible-galaxy collection install in v2.10 * changed the collection installed in test to something unlikely to come embedded in Ansible itself * fixed logic for Ansible 2.9 * kill trailing whitespace * changed default language from C.UTF-8 to en_US.UTF-8 * updated c.g version * skipping test in python 2.6, as ansible-galaxy no longer supports it in devel * Multiple changes: - improved docs on ansible 2.9 and python 2.6 - removed method __changed__() - unnecessary since tracking changes in the ansible29_change var - renamed methods __run29__() and __run210plus__() to __setup29__() and __setup210plus__(), respectively - ansible 2.9 warning for requirements_file only when type is "both" * sanity fix * further adjustments * removed extraneous doc * changed method to determine remote ansible version * do not allow type=both in Ansible 2.9 * Update plugins/modules/packaging/language/ansible_galaxy_install.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/modules/packaging/language/ansible_galaxy_install.py Co-authored-by: Felix Fontein <felix@fontein.de> * changed method names per PR Co-authored-by: Ajpantuso <ajpantuso@gmail.com> Co-authored-by: Felix Fontein <felix@fontein.de>
2021-07-29 22:30:20 +02:00
assert:
that:
- install_rq0 is changed
- '"geerlingguy.java" in install_rq0.new_roles'
- '"geerlingguy.php_roles" in install_rq0.new_collections'
- name: Install from requirements file (again)
community.general.ansible_galaxy_install:
type: both
requirements_file: "{{ reqs_file }}"
register: install_rq1
ignore_errors: true
- name: Assert requirements file was not installed
assert:
that:
- install_rq1 is not changed