Skip to content

Commit a4cc451

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

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

plugins/modules/systemd_creds_encrypt.py

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

137143
encrypt_cmd = [cmd, "encrypt"]
138-
if name:
144+
if name != None:
139145
encrypt_cmd.append("--name=" + name)
140-
else:
146+
elif not dest:
141147
encrypt_cmd.append("--name=")
142148
if not_after:
143149
encrypt_cmd.append("--not-after=" + not_after)

0 commit comments

Comments
 (0)