generated from ansible-collections/collection_template
-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docker_plugin - adding alias option and general cleanup (#161)
* Initial Commit * Adding changelog fragment
- Loading branch information
Showing
3 changed files
with
132 additions
and
26 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
minor_changes: | ||
- docker_plugin - added ``alias`` option to specify local names for docker plugins (https://github.com/ansible-collections/community.docker/pull/161). |
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
79 changes: 79 additions & 0 deletions
79
tests/integration/targets/docker_plugin/tasks/tests/basic_with_alias.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,79 @@ | ||
--- | ||
- name: Register plugin name and alias | ||
set_fact: | ||
plugin_name: "{{ name_prefix }}" | ||
alias: "test" | ||
|
||
- name: Create a plugin with an alias | ||
docker_plugin: | ||
plugin_name: "{{ plugin_name }}" | ||
alias: "{{ alias }}" | ||
state: present | ||
register: create_1 | ||
|
||
- name: Create a plugin with an alias (Idempotent) | ||
docker_plugin: | ||
plugin_name: "{{ plugin_name }}" | ||
alias: "{{ alias }}" | ||
state: present | ||
register: create_2 | ||
|
||
- name: Enable a plugin with an alias | ||
docker_plugin: | ||
plugin_name: "{{ plugin_name }}" | ||
alias: "{{ alias }}" | ||
state: enable | ||
register: create_3 | ||
|
||
- name: Enable a plugin with an alias (Idempotent) | ||
docker_plugin: | ||
plugin_name: "{{ plugin_name }}" | ||
alias: "{{ alias }}" | ||
state: enable | ||
register: create_4 | ||
|
||
- name: Disable a plugin with an alias | ||
docker_plugin: | ||
plugin_name: "{{ plugin_name }}" | ||
alias: "{{ alias }}" | ||
state: disable | ||
register: absent_1 | ||
|
||
- name: Disable a plugin with an alias (Idempotent) | ||
docker_plugin: | ||
plugin_name: "{{ plugin_name }}" | ||
alias: "{{ alias }}" | ||
state: disable | ||
register: absent_2 | ||
|
||
- name: Remove a plugin with an alias | ||
docker_plugin: | ||
plugin_name: "{{ plugin_name }}" | ||
alias: "{{ alias }}" | ||
state: absent | ||
register: absent_3 | ||
|
||
- name: Remove a plugin with an alias (Idempotent) | ||
docker_plugin: | ||
plugin_name: "{{ plugin_name }}" | ||
alias: "{{ alias }}" | ||
state: absent | ||
register: absent_4 | ||
|
||
- assert: | ||
that: | ||
- create_1 is changed | ||
- create_2 is not changed | ||
- create_3 is changed | ||
- create_4 is not changed | ||
- absent_1 is changed | ||
- absent_2 is not changed | ||
- absent_3 is changed | ||
- absent_4 is not changed | ||
|
||
- name: Cleanup plugin with an alias | ||
docker_plugin: | ||
plugin_name: "{{ plugin_name }}" | ||
alias: "{{ alias }}" | ||
state: absent | ||
force_remove: true |