diff --git a/lib/ansible/modules/cloud/docker/docker_config.py b/lib/ansible/modules/cloud/docker/docker_config.py index 6527f46640..ccb6876b41 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 3acc51be07..2554d90ac0 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