generated from ansible-collections/collection_template
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
- Loading branch information
Showing
6 changed files
with
134 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
tests/integration/targets/ah_build/files/sample/sample/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Ansible Collection - sample.sample | ||
|
||
Documentation for the collection. |
17 changes: 17 additions & 0 deletions
17
tests/integration/targets/ah_build/files/sample/sample/galaxy.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
namespace: sample | ||
name: sample | ||
version: 1.0.0 | ||
readme: README.md | ||
authors: | ||
- your name <example@domain.com> | ||
description: your collection description | ||
license: | ||
- GPL-2.0-or-later | ||
license_file: '' | ||
tags: [] | ||
dependencies: {} | ||
repository: http://example.com/repository | ||
documentation: http://docs.example.com | ||
homepage: http://example.com | ||
issues: http://example.com/issue/tracker | ||
build_ignore: [] |
31 changes: 31 additions & 0 deletions
31
tests/integration/targets/ah_build/files/sample/sample/plugins/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Collections Plugins Directory | ||
|
||
This directory can be used to ship various plugins inside an Ansible collection. Each plugin is placed in a folder that | ||
is named after the type of plugin it is in. It can also include the `module_utils` and `modules` directory that | ||
would contain module utils and modules respectively. | ||
|
||
Here is an example directory of the majority of plugins currently supported by Ansible: | ||
|
||
``` | ||
└── plugins | ||
├── action | ||
├── become | ||
├── cache | ||
├── callback | ||
├── cliconf | ||
├── connection | ||
├── filter | ||
├── httpapi | ||
├── inventory | ||
├── lookup | ||
├── module_utils | ||
├── modules | ||
├── netconf | ||
├── shell | ||
├── strategy | ||
├── terminal | ||
├── test | ||
└── vars | ||
``` | ||
|
||
A full list of plugin types can be found at [Working With Plugins](https://docs.ansible.com/ansible-core/2.16/plugins/plugins.html). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
--- | ||
- name: ah_build integration tests | ||
block: | ||
- name: Generate a test_id for the test | ||
set_fact: | ||
test_id: "{{ lookup('password', '/dev/null chars=ascii_letters length=16') | lower }}" | ||
when: test_id is not defined | ||
|
||
- name: Define variables | ||
set_fact: | ||
namespace: "sample" | ||
company: "my_company_{{ test_id }}" | ||
collection_name: "sample" | ||
build_path: "{{ playbook_dir }}/targets/ah_build/files" | ||
|
||
- name: Build Ansible Collection from the directory | ||
ansible.hub.ah_build: | ||
path: "{{ build_path }}/sample/sample" | ||
output_path: "{{ build_path }}/" | ||
register: r | ||
|
||
- name: Check if the file exists | ||
ansible.builtin.stat: | ||
path: "{{ build_path }}/sample-sample-1.0.0.tar.gz" | ||
register: build_stat | ||
|
||
- name: Check if the build is successful | ||
assert: | ||
that: | ||
- r.changed | ||
- build_stat.stat.exists | ||
|
||
- name: Build Ansible Collection from the directory again | ||
ansible.hub.ah_build: | ||
path: "{{ build_path }}/sample/sample" | ||
output_path: "{{ build_path }}/" | ||
register: r | ||
ignore_errors: yes | ||
|
||
- name: Check if re-building the collection without force fails | ||
assert: | ||
that: | ||
- r.failed | ||
- "'ERROR' in r.msg" | ||
|
||
- name: Build Ansible Collection from the directory again | ||
ansible.hub.ah_build: | ||
path: "{{ build_path }}/sample/sample" | ||
output_path: "{{ build_path }}/" | ||
force: true | ||
register: r | ||
|
||
- name: Check if re-building the collection with force works | ||
assert: | ||
that: | ||
- r.changed | ||
always: | ||
- name: Remove built collection | ||
ansible.builtin.file: | ||
path: "{{ build_path }}/sample-sample-1.0.0.tar.gz" | ||
state: absent | ||
ignore_errors: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters