Fix docker_plugin crash when handling plugin options (#447)

* Fix docker_plugin crash when handling plugin options.

* Try to add tests.
This commit is contained in:
Felix Fontein
2022-08-12 19:29:45 +02:00
committed by GitHub
parent f513ba2c59
commit a50257381f
4 changed files with 50 additions and 4 deletions
@@ -5,7 +5,7 @@
- name: Create random name prefix
set_fact:
name_prefix: "cvmfs/overlay2-graphdriver"
name_prefix: "vieux/sshfs"
plugin_names: []
- debug:
@@ -62,6 +62,12 @@
state: absent
register: absent_4
- name: Cleanup
docker_plugin:
plugin_name: "{{ plugin_name }}"
state: absent
force_remove: true
- assert:
that:
- create_1 is changed
@@ -75,10 +81,48 @@
############ Plugin_Options ############
########################################
# Integration-Test with plugin_options is in TODO-List
- name: Install a plugin with options
docker_plugin:
plugin_name: "{{ plugin_name }}"
plugin_options:
DEBUG: '1'
state: present
register: create_1
- name: Install a plugin with options (idempotent)
docker_plugin:
plugin_name: "{{ plugin_name }}"
plugin_options:
DEBUG: '1'
state: present
register: create_2
- name: Install a plugin with different options
docker_plugin:
plugin_name: "{{ plugin_name }}"
plugin_options:
DEBUG: '0'
state: present
register: update_1
- name: Install a plugin with different options (idempotent)
docker_plugin:
plugin_name: "{{ plugin_name }}"
plugin_options:
DEBUG: '0'
state: present
register: update_2
- name: Cleanup
docker_plugin:
plugin_name: "{{ plugin_name }}"
state: absent
force_remove: true
- assert:
that:
- create_1 is changed
- create_2 is not changed
- update_1 is changed
- update_2 is not changed