diff options
author | Vincent S. Cojot <vcojot@redhat.com> | 2017-02-08 18:28:32 -0500 |
---|---|---|
committer | Vincent S. Cojot <vcojot@redhat.com> | 2017-02-08 18:28:32 -0500 |
commit | 97f7e224a46b427e0616b94378abdce8c2973cd3 (patch) | |
tree | 5ec0744018409797bafc9a00e42039d910d3eb7e | |
parent | f2df9df1f864a00127daca517afa7330c7d31f15 (diff) | |
download | openstack-access-policy-97f7e224a46b427e0616b94378abdce8c2973cd3.tar.gz openstack-access-policy-97f7e224a46b427e0616b94378abdce8c2973cd3.tar.xz openstack-access-policy-97f7e224a46b427e0616b94378abdce8c2973cd3.zip |
Working rev...
-rwxr-xr-x | files/push_sevone_policies_to_overcloud.sh | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/files/push_sevone_policies_to_overcloud.sh b/files/push_sevone_policies_to_overcloud.sh index c4c6695..7a46880 100755 --- a/files/push_sevone_policies_to_overcloud.sh +++ b/files/push_sevone_policies_to_overcloud.sh @@ -1,6 +1,6 @@ #!/bin/bash # $Id$ -set -euf -o pipefail +set -euf CTLR_LIST="" declare -A IP_LIST src_config="" @@ -70,16 +70,30 @@ fi for myctrl in "${!IP_LIST[@]}" do myip=${IP_LIST[${myctrl}]} - echo "(II) Processing controller: ${myctrl} (${myip})..." + # Test controller + echo -n "(II) Testing ssh and sudo access to controller ${myctrl} (${myip}): " + ssh -q heat-admin@${myip} sudo -l|grep -q 'ALL.*NOPASSWD.*ALL' + if [ $? -ne 0 ]; then + echo "NOK" ; exit 127 + else + echo "OK" + fi + + rsync -a ${TOP_DIR}/etc heat-admin@${myip}: + for mysvc in aodh ceilometer cinder glance gnocchi heat ironic keystone manila mistral neutron nova sahara zaqar do src_config="${TOP_DIR}/etc/${mysvc}/policy.json" dst_config="/etc/${mysvc}/policy.json" + sev1_backup="${dst_config}.sevone" + + ssh heat-admin@${myip} "sudo test -f ${sev1_backup} || sudo /bin/cp -afv ${dst_config} ${sev1_backup}" + # Start by backing up config files.. - if [ -f ${src_config} ]; then - echo " (II) Uploading ${src_config} to ${myip}:${dst_config}..." - else - echo "(**) Unable to find new policy file at ${src_config}! Exit!"; exit 127 - fi + #if [ -f ${src_config} ]; then + # echo " (II) Uploading ${src_config} to ${myip}:${dst_config}..." + #else + # echo "(**) Unable to find new policy file at ${src_config}! Exit!"; exit 127 + #fi done done |