-
Notifications
You must be signed in to change notification settings - Fork 2
Description
I'm working on a playbook that will enable a list of 10 test users but I want to be able to see when each user's state has changed so I figured I would loop it so it iterates in terminal well.
I was curious, if I wanted to do this with 100 users, is there a way to set an array in my variables so I don't have such a long list. forgive me if this is the wrong place to put this
Projected example (with possibly bad syntax) :
test_users: "test_user_[1-100]"
Variables
ipa_host: "ipa.example.com"
exp_date: 20210209235959
test_users:
-
"test_user_1"
-
"test_user_2"
-
"test_user_3"
-
"test_user_4"
-
"test_user_5"
-
"test_user_6"
-
"test_user_7"
-
"test_user_8"
-
"test_user_9"
-
"test_user_10"
Playbook -
name: Ensure test_users are enabled
community.general.ipa_user:
name: "{{ item }}"
state: enabled
ipa_host: "{{ ipa_host }}"
krbpasswordexpiration: "{{ exp_date }}"
with_items:- "{{ test_users }}"