docker_swarm_service: Add stop_signal option (#52424)

* Add stop_signal option

* Add changelog fragment
This commit is contained in:
Hannes Ljungberg
2019-02-18 10:43:35 +01:00
committed by John R Barker
parent 435e0c5dba
commit 77d116f66e
4 changed files with 59 additions and 0 deletions

View File

@@ -1390,6 +1390,46 @@
- networks_3 is changed
- networks_4 is not changed
####################################################################
## stop_signal #####################################################
####################################################################
- name: stop_signal
docker_swarm_service:
name: "{{ service_name }}"
image: alpine:3.8
command: '/bin/sh -v -c "sleep 10m"'
stop_signal: 30
register: stop_signal_1
- name: stop_signal (idempotency)
docker_swarm_service:
name: "{{ service_name }}"
image: alpine:3.8
command: '/bin/sh -v -c "sleep 10m"'
stop_signal: 30
register: stop_signal_2
- name: stop_signal (change)
docker_swarm_service:
name: "{{ service_name }}"
image: alpine:3.8
command: '/bin/sh -v -c "sleep 10m"'
stop_signal: 9
register: stop_signal_3
- name: cleanup
docker_swarm_service:
name: "{{ service_name }}"
state: absent
diff: no
- assert:
that:
- stop_signal_1 is changed
- stop_signal_2 is not changed
- stop_signal_3 is changed
####################################################################
## placement_preferences ###########################################
####################################################################

View File

@@ -22,6 +22,7 @@ service_expected_output:
mode: global
mounts: null
networks: null
stop_signal: null
placement_preferences: null
publish:
- {mode: null, protocol: tcp, published_port: 60001, target_port: 60001}