docker_swarm_service: Remove root as default user (#51110)

* Remove root as default user

* Add changelog fragment

* Add deprecation documentation

* Tweak user default docs for docker_swarm_service

Co-Authored-By: hannseman <hannes@5monkeys.se>

* Tweak user default deprecation docs

Co-Authored-By: hannseman <hannes@5monkeys.se>
This commit is contained in:
Hannes Ljungberg 2019-01-27 17:26:41 +01:00 committed by John R Barker
parent ee39853426
commit b426daa064
3 changed files with 10 additions and 6 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- "docker_swarm_service - Don't set ``root`` as the default user."

View file

@ -162,6 +162,8 @@ Noteworthy module changes
* The ``docker_service`` module was renamed to :ref:`docker_compose <docker_compose_module>`. * The ``docker_service`` module was renamed to :ref:`docker_compose <docker_compose_module>`.
* The ``docker_swarm_service`` module no longer sets a default for the ``user`` option. Before, the default was ``root``.
Plugins Plugins
======= =======

View file

@ -320,12 +320,12 @@ options:
- Maps to docker service --update-order - Maps to docker service --update-order
- Requires API version >= 1.29 - Requires API version >= 1.29
user: user:
type: str
required: false required: false
default: root
description: description:
- username or UID. - Sets the username or UID used for the specified command.
- "If set to C(null) the image provided value (or the one already - Before Ansible 2.8, the default value for this option was C(root).
set for the service) will be used" The default has been removed so that the user defined in the image is used if no user is specified here.
extends_documentation_fragment: extends_documentation_fragment:
- docker - docker
requirements: requirements:
@ -558,7 +558,7 @@ class DockerService(DockerBaseClass):
self.reserve_cpu = 0.000 self.reserve_cpu = 0.000
self.reserve_memory = 0 self.reserve_memory = 0
self.mode = "replicated" self.mode = "replicated"
self.user = "root" self.user = None
self.mounts = [] self.mounts = []
self.configs = [] self.configs = []
self.secrets = [] self.secrets = []
@ -1300,7 +1300,7 @@ def main():
update_monitor=dict(default=5000000000, type='int'), update_monitor=dict(default=5000000000, type='int'),
update_max_failure_ratio=dict(default=0, type='float'), update_max_failure_ratio=dict(default=0, type='float'),
update_order=dict(default=None, type='str'), update_order=dict(default=None, type='str'),
user=dict(default='root')) user=dict(type='str'))
option_minimal_versions = dict( option_minimal_versions = dict(
dns=dict(docker_py_version='2.6.0', docker_api_version='1.25'), dns=dict(docker_py_version='2.6.0', docker_api_version='1.25'),