mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-03-26 21:33:05 +00:00
Adding an option to create multiple services in one go. Adding tests (present/absent/without_skip_host_check) Copied from PR #1054 Signed-off-by: Denis Karpelevich <dkarpele@redhat.com>
26 lines
471 B
Bash
26 lines
471 B
Bash
#!/bin/bash -eu
|
|
|
|
NUM=${1-1000}
|
|
FILE="services.json"
|
|
|
|
echo "{" > "$FILE"
|
|
|
|
echo " \"service_list\": [" >> "$FILE"
|
|
|
|
for i in $(seq 1 "$NUM"); do
|
|
{
|
|
echo " {"
|
|
echo " \"name\": \"HTTP/www.example$i.com\","
|
|
echo " \"principal\": \"host/test.example$i.com\""
|
|
} >> "$FILE"
|
|
if [ "$i" -lt "$NUM" ]; then
|
|
echo " }," >> "$FILE"
|
|
else
|
|
echo " }" >> "$FILE"
|
|
fi
|
|
done
|
|
|
|
echo " ]" >> "$FILE"
|
|
|
|
echo "}" >> "$FILE"
|