diff --git a/plugins/modules/podman_volume.py b/plugins/modules/podman_volume.py index 2193501..850bcb5 100644 --- a/plugins/modules/podman_volume.py +++ b/plugins/modules/podman_volume.py @@ -234,21 +234,21 @@ class PodmanVolumeDiff: before = self.info['options'] if 'options' in self.info else {} before = ["=".join((k, v)) for k, v in before.items()] after = self.params['options'] - # For UID, GID - if 'uid' in self.info or 'gid' in self.info: - ids = [] - if 'uid' in self.info and self.info['uid']: - before = [i for i in before if 'uid' not in i] - before += ['uid=%s' % str(self.info['uid'])] - if 'gid' in self.info and self.info['gid']: - before = [i for i in before if 'gid' not in i] - before += ['gid=%s' % str(self.info['gid'])] - if self.params['options']: - for opt in self.params['options']: - if 'uid=' in opt or 'gid=' in opt: - ids += opt.split("o=")[1].split(",") - after = [i for i in after if 'gid' not in i and 'uid' not in i] - after += ids + # # For UID, GID + # if 'uid' in self.info or 'gid' in self.info: + # ids = [] + # if 'uid' in self.info and self.info['uid']: + # before = [i for i in before if 'uid' not in i] + # before += ['uid=%s' % str(self.info['uid'])] + # if 'gid' in self.info and self.info['gid']: + # before = [i for i in before if 'gid' not in i] + # before += ['gid=%s' % str(self.info['gid'])] + # if self.params['options']: + # for opt in self.params['options']: + # if 'uid=' in opt or 'gid=' in opt: + # ids += opt.split("o=")[1].split(",") + # after = [i for i in after if 'gid' not in i and 'uid' not in i] + # after += ids before, after = sorted(list(set(before))), sorted(list(set(after))) return self._diff_update_and_compare('options', before, after) diff --git a/tests/integration/targets/podman_volume/tasks/main.yml b/tests/integration/targets/podman_volume/tasks/main.yml index 783e2eb..a06d970 100644 --- a/tests/integration/targets/podman_volume/tasks/main.yml +++ b/tests/integration/targets/podman_volume/tasks/main.yml @@ -160,126 +160,6 @@ - info10 is failed - delete.volume == {} - - name: Create volume with UID option - containers.podman.podman_volume: - name: "{{ volume_name }}" - state: present - options: - - "o=uid=1001" - executable: "{{ podman_cmd | default(omit) }}" - register: info11 - - - name: Check info - assert: - that: - - info11 is changed - - - name: Create volume with UID option - again - containers.podman.podman_volume: - name: "{{ volume_name }}" - state: present - options: - - "o=uid=1001" - executable: "{{ podman_cmd | default(omit) }}" - register: info12 - - - name: Check info - assert: - that: - - info12 is not changed - - - name: Create volume with UID option - default - containers.podman.podman_volume: - name: "{{ volume_name }}" - state: present - executable: "{{ podman_cmd | default(omit) }}" - register: info13 - - - name: Check info - assert: - that: - - info13 is changed - - - name: Create volume with GID option - containers.podman.podman_volume: - name: "{{ volume_name }}" - state: present - options: - - "o=gid=1001" - executable: "{{ podman_cmd | default(omit) }}" - register: info14 - - - name: Check info - assert: - that: - - info14 is changed - - - name: Create volume with GID option - again - containers.podman.podman_volume: - name: "{{ volume_name }}" - state: present - options: - - "o=gid=1001" - executable: "{{ podman_cmd | default(omit) }}" - register: info15 - - - name: Check info - assert: - that: - - info15 is not changed - - - name: Create volume with GID option - default - containers.podman.podman_volume: - name: "{{ volume_name }}" - state: present - executable: "{{ podman_cmd | default(omit) }}" - register: info16 - - - name: Check info - assert: - that: - - info16 is changed - - - name: Create volume with GID and UID option - containers.podman.podman_volume: - name: "{{ volume_name }}" - state: present - options: - - "o=gid=1002,uid=1002" - executable: "{{ podman_cmd | default(omit) }}" - register: info17 - - - name: Check info - assert: - that: - - info17 is changed - - - name: Create volume with GID and UID option - again - containers.podman.podman_volume: - name: "{{ volume_name }}" - state: present - options: - - "o=uid=1002" - - "o=gid=1002" - executable: "{{ podman_cmd | default(omit) }}" - register: info18 - - - name: Check info - assert: - that: - - info18 is not changed - - - name: Create volume with GID and UID option - default - containers.podman.podman_volume: - name: "{{ volume_name }}" - state: present - executable: "{{ podman_cmd | default(omit) }}" - register: info19 - - - name: Check info - assert: - that: - - info19 is changed always: - name: Make sure volume doesn't exist