for role in "$basedir"/roles/ceph-*; do
rolename=$(basename "$role")
if [[ $rolename == "ceph-common" ]]; then
- output="all.yml.sample"
+ output="all.yml.sample"
elif [[ $rolename == "ceph-agent" ]]; then
- output="agent.yml.sample"
+ output="agent.yml.sample"
elif [[ $rolename == "ceph-fetch-keys" ]]; then
- output="ceph-fetch-keys.yml.sample"
+ output="ceph-fetch-keys.yml.sample"
else
- output="${rolename:5}s.yml.sample"
+ output="${rolename:5}s.yml.sample"
fi
cat <<EOF > "$basedir"/group_vars/"$output"
EOF
defaults="$role"/defaults/main.yml
if [[ ! -f $defaults ]]; then
- continue
+ continue
fi
if [ "$(uname)" == "Darwin" ]; then
- sed '/^---/d; s/^\([A-Za-z[:space:]]\)/#\1/' \
- "$defaults" >> "$basedir"/group_vars/"$output"
+ sed '/^---/d; s/^\([A-Za-z[:space:]]\)/#\1/' \
+ "$defaults" >> "$basedir"/group_vars/"$output"
echo >> "$basedir"/group_vars/"$output"
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
sed '/^---/d; s/^\([A-Za-z[:space:]].\+\)/#\1/' \
- "$defaults" >> "$basedir"/group_vars/"$output"
+ "$defaults" >> "$basedir"/group_vars/"$output"
echo >> "$basedir"/group_vars/"$output"
else
echo "Unsupported platform"