mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 21:32:49 +00:00
docker_swarm_service: Add groups option (#52428)
* Add groups option * Add changelog fragment * Remove whitespace * Remove whitespace
This commit is contained in:
committed by
John R Barker
parent
bb0a69e084
commit
64b12d2c0d
@@ -889,6 +889,69 @@
|
||||
- "('version is ' ~ docker_api_version ~'. Minimum version required is 1.25') in force_update_1.msg"
|
||||
when: docker_api_version is version('1.25', '<')
|
||||
|
||||
####################################################################
|
||||
## groups ##########################################################
|
||||
####################################################################
|
||||
|
||||
- name: groups
|
||||
docker_swarm_service:
|
||||
name: "{{ service_name }}"
|
||||
image: alpine:3.8
|
||||
command: '/bin/sh -v -c "sleep 10m"'
|
||||
groups:
|
||||
- 1234
|
||||
- 5678
|
||||
register: groups_1
|
||||
|
||||
- name: groups (idempotency)
|
||||
docker_swarm_service:
|
||||
name: "{{ service_name }}"
|
||||
image: alpine:3.8
|
||||
command: '/bin/sh -v -c "sleep 10m"'
|
||||
groups:
|
||||
- 1234
|
||||
- 5678
|
||||
register: groups_2
|
||||
|
||||
- name: groups (change)
|
||||
docker_swarm_service:
|
||||
name: "{{ service_name }}"
|
||||
image: alpine:3.8
|
||||
command: '/bin/sh -v -c "sleep 10m"'
|
||||
groups:
|
||||
- 1234
|
||||
register: groups_3
|
||||
|
||||
- name: groups (empty)
|
||||
docker_swarm_service:
|
||||
name: "{{ service_name }}"
|
||||
image: alpine:3.8
|
||||
command: '/bin/sh -v -c "sleep 10m"'
|
||||
groups: []
|
||||
register: groups_4
|
||||
|
||||
- name: groups (empty idempotency)
|
||||
docker_swarm_service:
|
||||
name: "{{ service_name }}"
|
||||
image: alpine:3.8
|
||||
command: '/bin/sh -v -c "sleep 10m"'
|
||||
groups: []
|
||||
register: groups_5
|
||||
|
||||
- name: cleanup
|
||||
docker_swarm_service:
|
||||
name: "{{ service_name }}"
|
||||
state: absent
|
||||
diff: no
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- groups_1 is changed
|
||||
- groups_2 is not changed
|
||||
- groups_3 is changed
|
||||
- groups_4 is changed
|
||||
- groups_5 is not changed
|
||||
|
||||
####################################################################
|
||||
## healthcheck #####################################################
|
||||
####################################################################
|
||||
|
||||
@@ -12,6 +12,7 @@ service_expected_output:
|
||||
endpoint_mode: vip
|
||||
env: null
|
||||
force_update: null
|
||||
groups: null
|
||||
healthcheck: null
|
||||
healthcheck_disabled: null
|
||||
hostname: null
|
||||
|
||||
Reference in New Issue
Block a user