Skip to content

Commit

Permalink
initialize empty array so it ends up as an empty array when num_users…
Browse files Browse the repository at this point in the history
…=0 instead of undefined (#2552)
  • Loading branch information
jamesfalkner authored Sep 19, 2020
1 parent f93c36f commit 3e9c4a9
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@
debug:
msg: "Debugging num_users {{ num_users }}"

- name: initialize username array
set_fact:
users: []

- name: create usernames
set_fact:
users: "{{ users | default([]) + ['user'+item | string] }}"
users: "{{ users + ['user'+item | string] }}"
loop: "{{ range(1,((num_users | int) + 1)) | list }}"

# Figure out paths
Expand Down

0 comments on commit 3e9c4a9

Please sign in to comment.