mirror of
https://github.com/ansible-collections/community.docker.git
synced 2026-07-29 11:55:04 +00:00
Replicas max per node (#92)
* Adding 'replicas_max_per_node' placement parameter * Adding 'replicas_max_per_node' placement parameter * Adding 'replicas_max_per_node' integration tests * Adding 'replicas_max_per_node' feature * 'replicas_max_per_node' documentation update * 'replicas_max_per_node' unit test fix * Documentation and changelog updates * Update changelogs/fragments/92-replicas-max-per-node.yml Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: WojciechowskiPiotr <devel@it-playground.pl> Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
committed by
GitHub
parent
f5d68755c4
commit
3ddd75ac68
@@ -200,3 +200,59 @@
|
||||
- constraints_1 is failed
|
||||
- "'Minimum version required' in constraints_1.msg"
|
||||
when: docker_api_version is version('1.27', '<') or docker_py_version is version('2.4.0', '<')
|
||||
|
||||
####################################################################
|
||||
## placement.replicas_max_per_node #####################################################
|
||||
####################################################################
|
||||
|
||||
- name: placement.replicas_max_per_node
|
||||
docker_swarm_service:
|
||||
name: "{{ service_name }}"
|
||||
image: "{{ docker_test_image_alpine }}"
|
||||
resolve_image: no
|
||||
command: '/bin/sh -v -c "sleep 10m"'
|
||||
placement:
|
||||
replicas_max_per_node: 1
|
||||
register: replicas_max_per_node_1
|
||||
ignore_errors: yes
|
||||
|
||||
- name: placement.replicas_max_per_node (idempotency)
|
||||
docker_swarm_service:
|
||||
name: "{{ service_name }}"
|
||||
image: "{{ docker_test_image_alpine }}"
|
||||
resolve_image: no
|
||||
command: '/bin/sh -v -c "sleep 10m"'
|
||||
placement:
|
||||
replicas_max_per_node: 1
|
||||
register: replicas_max_per_node_2
|
||||
ignore_errors: yes
|
||||
|
||||
- name: placement.replicas_max_per_node (change)
|
||||
docker_swarm_service:
|
||||
name: "{{ service_name }}"
|
||||
image: "{{ docker_test_image_alpine }}"
|
||||
resolve_image: no
|
||||
command: '/bin/sh -v -c "sleep 10m"'
|
||||
placement:
|
||||
replicas_max_per_node: 2
|
||||
register: replicas_max_per_node_3
|
||||
ignore_errors: yes
|
||||
|
||||
|
||||
- name: cleanup
|
||||
docker_swarm_service:
|
||||
name: "{{ service_name }}"
|
||||
state: absent
|
||||
diff: no
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- replicas_max_per_node_1 is changed
|
||||
- replicas_max_per_node_2 is not changed
|
||||
- replicas_max_per_node_3 is changed
|
||||
when: docker_api_version is version('1.40', '>=') and docker_py_version is version('4.4.3', '>=')
|
||||
- assert:
|
||||
that:
|
||||
- replicas_max_per_node_1 is failed
|
||||
- "'Minimum version required' in replicas_max_per_node_1.msg"
|
||||
when: docker_api_version is version('1.40', '<') or docker_py_version is version('4.4.3', '<')
|
||||
|
||||
@@ -35,6 +35,7 @@ service_expected_output:
|
||||
- {mode: null, protocol: udp, published_port: 60001, target_port: 60001}
|
||||
read_only: null
|
||||
replicas: null
|
||||
replicas_max_per_node: null
|
||||
reserve_cpu: null
|
||||
reserve_memory: null
|
||||
restart_policy: null
|
||||
|
||||
Reference in New Issue
Block a user