diff --git a/lib/ansible/modules/cloud/docker/docker_config.py b/lib/ansible/modules/cloud/docker/docker_config.py index 6527f46640b..ccb6876b418 100644 --- a/lib/ansible/modules/cloud/docker/docker_config.py +++ b/lib/ansible/modules/cloud/docker/docker_config.py @@ -85,7 +85,7 @@ EXAMPLES = ''' # If the file is JSON or binary, Ansible might modify it (because # it is first decoded and later re-encoded). Base64-encoding the # file directly after reading it prevents this to happen. - data: "{{ lookup('file', '/path/to/config/file') | base64 }}" + data: "{{ lookup('file', '/path/to/config/file') | b64encode }}" data_is_b64: true state: present diff --git a/lib/ansible/modules/cloud/docker/docker_secret.py b/lib/ansible/modules/cloud/docker/docker_secret.py index 3acc51be079..2554d90ac01 100644 --- a/lib/ansible/modules/cloud/docker/docker_secret.py +++ b/lib/ansible/modules/cloud/docker/docker_secret.py @@ -85,7 +85,7 @@ EXAMPLES = ''' # If the file is JSON or binary, Ansible might modify it (because # it is first decoded and later re-encoded). Base64-encoding the # file directly after reading it prevents this to happen. - data: "{{ lookup('file', '/path/to/secret/file') | base64 }}" + data: "{{ lookup('file', '/path/to/secret/file') | b64encode }}" data_is_b64: true state: present