Skip to content

Commit 4801bc1

Browse files
committed
Don't disable using dest filename as credential name in systemd_creds_encrypt
1 parent 6d85d71 commit 4801bc1

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

plugins/modules/systemd_creds_encrypt.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@
3232
name:
3333
description:
3434
- The credential name to embed in the encrypted credential data.
35+
- When using the O(dest) option, you can set this to an empty
36+
- string ("") to prevent C(systemd-creds encrypt) from using
37+
- filename from O(dest) as the credential name. And vice versa,
38+
- leave out the O(name) option to let C(systemd-creds encrypt)
39+
- use the filename from O(dest) as the credential name.
3540
type: str
3641
required: false
3742
not_after:
@@ -135,9 +140,9 @@ def main():
135140
dest = module.params["dest"]
136141

137142
encrypt_cmd = [cmd, "encrypt"]
138-
if name:
143+
if name is not None:
139144
encrypt_cmd.append("--name=" + name)
140-
else:
145+
elif not dest:
141146
encrypt_cmd.append("--name=")
142147
if not_after:
143148
encrypt_cmd.append("--not-after=" + not_after)

0 commit comments

Comments
 (0)