diff --git a/lib/ansible/modules/cloud/docker/docker_swarm_service.py b/lib/ansible/modules/cloud/docker/docker_swarm_service.py index 2889d8373c..56f544fcbf 100644 --- a/lib/ansible/modules/cloud/docker/docker_swarm_service.py +++ b/lib/ansible/modules/cloud/docker/docker_swarm_service.py @@ -1047,7 +1047,7 @@ class DockerServiceManager(): update_config_data = raw_data['Spec']['UpdateConfig'] ds.image = task_template_data['ContainerSpec']['Image'] - ds.user = task_template_data['ContainerSpec'].get('User', 'root') + ds.user = task_template_data['ContainerSpec'].get('User', None) ds.env = task_template_data['ContainerSpec'].get('Env', []) ds.command = task_template_data['ContainerSpec'].get('Command') ds.args = task_template_data['ContainerSpec'].get('Args', [])