Skip to content

Commit

Permalink
ocp4_workload_showroom: move and update usernum creation to safer spot (
Browse files Browse the repository at this point in the history
#8909)

* move and update usernum creation to safer spot

* Fix wrong indentation

---------

Co-authored-by: Wolfgang Kulhanek <[email protected]>
  • Loading branch information
newgoliath and Wolfgang Kulhanek authored Dec 5, 2024
1 parent ba05dce commit f99be0e
Showing 1 changed file with 12 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,6 @@
quiet: true
fail_msg: Required variables not defined

- name: Set a default num_users
ansible.builtin.set_fact:
num_users: "{{ num_users | default(1) }}"

- name: Set a user.usernum
agnosticd_user_info:
data:
usernum: "{{ n }}"
user: "user{{ n }}"
loop: "{{ range(1, num_users | int + 1) | list }}"
loop_control:
loop_var: n

- name: Set passthrough variables to per-user data, if desired
when:
- agnosticd_passthrough_user_data is defined
Expand All @@ -42,6 +29,18 @@
ansible.builtin.set_fact:
_user_count: "{{ _showroom_user_data['users'] | length }}"

- name: Set a user.usernum
when:
- _user_count is defined
- _user_count | int > 0
agnosticd_user_info:
data:
usernum: "{{ n }}"
user: "user{{ n }}"
loop: "{{ range(1, _user_count | int + 1) | list }}"
loop_control:
loop_var: n

- name: Read user-info.yaml
delegate_to: localhost
ansible.builtin.slurp:
Expand Down

0 comments on commit f99be0e

Please sign in to comment.