Open pa-yourserveradmin-com opened 4 years ago
Originally posted in https://github.com/ansible/ansible/issues/71386.
cc @DBendit @WojciechowskiPiotr @akshay196 @chouseknecht @danihodovic @dariko @felixfontein @hannseman @jwitko @kassiansun @tbouvet click here for bot help
Hey, guys. Do you need any additional details about this issue?
@dariko @jwitko @hannseman can you take a look at this?
Ping @dariko @jwitko @hannseman
SUMMARY
The problem is docker_swarm_service module works incorrectly with Swarm services which use host network(s) and continuously attempts to update such services due to wrong processing of host networks.
Sample patch which also may help to solve the issue can be found in f43219827dbabf33f43af2114838ee20.
ISSUE TYPE
COMPONENT NAME
docker_swarm_service
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
Docker server and API information:
Python docker module version:
STEPS TO REPRODUCE
Before all you will need Docker Swarm cluster to deploy service using example playbook provided below.
Example playbook which will deploy Nginx containers to Swarm using host network (please customize it according to local testing environment):
Once playbook is applied - run it once again with
--check --diff
options to see planned changes.Run playbook once again and it will report changes in Swarm service configuration while service configuration actually not changed (i.e. no downtime actually happen what significantly reduces impact of this issue).
EXPECTED RESULTS
No changes reported in dry-run and run modes when nothing really changed in service configuration.
ACTUAL RESULTS
Either in dry-run or run mode Ansible updates Swarm service with wrong network ID:
Correct network exvfwyotuxat3z1bt38s3rork has swarm scope and inspect returns the next information:
Wrong network 71d4bd2cf80870bf68df480c876e01ea02183d8fc33d292658c49f323e5c795a has local scope and inspect returns the next information: