forked from adfinis/ansible-collection-bareos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
UPDATING.sh
executable file
·28 lines (24 loc) · 1013 Bytes
/
UPDATING.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh
# Copy all roles.
for role in ../ansible-role-bareos_* ; do
short=$(echo ${role} | cut -d\- -f3)
if [ ! -d roles/${short} ] ; then
mkdir "roles/${short}"
echo "Copying ${role} to roles/${short}."
for object in LICENSE README.md defaults files handlers meta requirements.yml tasks templates vars ; do
if [ -d "${role}/${object}" ] ; then
cp -Rip "${role}/${object}" "roles/${short}/${object}"
elif [ -f "${role}/${object}" ] ; then
cp "${role}/${object}" "roles/${short}/${object}"
fi
done
fi
done
# Use proper role FQCNs in README example playbooks
sed -i '' 's|- role: adfinis\.|- role: adfinis.roles.|' roles/*/README.md
# Use proper role FQCNs in role `dependencies:`
sed -i '' 's|- adfinis\.|- adfinis.roles.|' roles/*/meta/main.yml
# Regenerate all used collections.
echo "---" > requirements.yml
echo "collections:" >> requirements.yml
cat roles/*/requirements.yml | grep ' - name: ' | grep -v adfinis | sort | uniq >> requirements.yml