mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-04-20 15:51:13 +00:00
Adding an option `groups` to create multiple groups in one operation.
Adding tests (present/absent/external/nonposix) with server and
client context.
Simple example of `groups` option:
```
tasks:
- name: Ensure 2 groups are present
ipagroup:
ipaadmin_password: SomeADMINpassword
groups:
- name: group1
- name: group2
```
Signed-off-by: Denis Karpelevich <dkarpele@redhat.com>
26 lines
447 B
Bash
26 lines
447 B
Bash
#!/bin/bash
|
|
|
|
NUM=${1-1000}
|
|
FILE="groups.json"
|
|
|
|
echo "{" > "$FILE"
|
|
|
|
echo " \"group_list\": [" >> "$FILE"
|
|
|
|
for i in $(seq 1 "$NUM"); do
|
|
{
|
|
echo " {"
|
|
echo " \"name\": \"group$i\","
|
|
echo " \"description\": \"group description $i\""
|
|
} >> "$FILE"
|
|
if [ "$i" -lt "$NUM" ]; then
|
|
echo " }," >> "$FILE"
|
|
else
|
|
echo " }" >> "$FILE"
|
|
fi
|
|
done
|
|
|
|
echo " ]" >> "$FILE"
|
|
|
|
echo "}" >> "$FILE"
|