Browse Source

Use default(False) filter for conditional check

Change-Id: Icafbe9bc031005241df5ead6762cbc9815b82fb9
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
changes/00/569300/6
Paul Belanger 1 year ago
parent
commit
ce6d804c06
No account linked to committer's email address
1 changed files with 3 additions and 3 deletions
  1. 3
    3
      tasks/config.yaml

+ 3
- 3
tasks/config.yaml View File

@@ -29,7 +29,7 @@
29 29
     mode: 0644
30 30
     owner: "{{ ssh_user_name }}"
31 31
     src: "{{ ssh_known_hosts_src }}"
32
-  when: ssh_known_hosts_content | default('') != ''
32
+  when: ssh_known_hosts_content | default(False)
33 33
 
34 34
 - name: Create ssh private key.
35 35
   become: yes
@@ -39,7 +39,7 @@
39 39
     mode: 0600
40 40
     owner: "{{ ssh_user_name }}"
41 41
     src: "{{ ssh_key_private_src }}"
42
-  when: ssh_key_private_content | default('') != ''
42
+  when: ssh_key_private_content | default(False)
43 43
 
44 44
 - name: Create ssh public key.
45 45
   become: yes
@@ -49,4 +49,4 @@
49 49
     mode: 0644
50 50
     owner: "{{ ssh_user_name }}"
51 51
     src: "{{ ssh_key_public_src }}"
52
-  when: ssh_key_public_content | default('') != ''
52
+  when: ssh_key_public_content | default(False)

Loading…
Cancel
Save