summaryrefslogtreecommitdiffstats
path: root/anslib/link_vars.sh
blob: 651c09cf86947e45526b8787502a88bc92ec1bac (plain)
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

function mklink_func {
#    if [ -d openshift-cluster ]; then
#        mklink_func "openshift-cluster"
#    fi

    name=$(basename "$1")
#    [[ $name == "private" ]] && exit
    [[ $name == "vars" ]] && exit
    [[ $name == "roles" ]] && exit
    
    (
        cd $1
        path=..
        while [ ! -f "$path/link_vars.sh" ]; do
            path="../$path"
        done
        path="../$path"

        ln -sf "$path/group_vars"
        ln -sf "$path/host_vars"
    )
}

export -f mklink_func
find openshift-ansible/playbooks -mindepth 0 -maxdepth 2 -type d -print0 | xargs -0 -L 1 -I {} bash -c 'mklink_func "$@"' _ {}
find openshift-ansible/playbooks/common/openshift-cluster/upgrades -mindepth 0 -maxdepth 1 -type d -print0 | xargs -0 -L 1 -I {} bash -c 'mklink_func "$@"' _ {}