mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-20 23:30:22 -07:00
docker_swarm_service: Add working_dir option (#52425)
* Add working_dir option * Check local mounts var to align with other checks * Add changelog fragment * Add trailing comma
This commit is contained in:
parent
37b0f5c81b
commit
c80ad43371
4 changed files with 58 additions and 3 deletions
|
@ -2524,6 +2524,43 @@
|
|||
- user_2 is not changed
|
||||
- user_3 is changed
|
||||
|
||||
####################################################################
|
||||
## working_dir #####################################################
|
||||
####################################################################
|
||||
|
||||
- name: working_dir
|
||||
docker_swarm_service:
|
||||
name: "{{ service_name }}"
|
||||
image: alpine:3.8
|
||||
working_dir: /tmp
|
||||
register: working_dir_1
|
||||
|
||||
- name: working_dir (idempotency)
|
||||
docker_swarm_service:
|
||||
name: "{{ service_name }}"
|
||||
image: alpine:3.8
|
||||
working_dir: /tmp
|
||||
register: working_dir_2
|
||||
|
||||
- name: working_dir (change)
|
||||
docker_swarm_service:
|
||||
name: "{{ service_name }}"
|
||||
image: alpine:3.8
|
||||
working_dir: /
|
||||
register: working_dir_3
|
||||
|
||||
- name: cleanup
|
||||
docker_swarm_service:
|
||||
name: "{{ service_name }}"
|
||||
state: absent
|
||||
diff: no
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- working_dir_1 is changed
|
||||
- working_dir_2 is not changed
|
||||
- working_dir_3 is changed
|
||||
|
||||
####################################################################
|
||||
####################################################################
|
||||
####################################################################
|
||||
|
|
|
@ -44,3 +44,4 @@ service_expected_output:
|
|||
update_monitor: null
|
||||
update_order: null
|
||||
update_parallelism: 1
|
||||
working_dir: null
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue