bootstrap.sh: always download the latest version of files
This commit is contained in:
+12
-9
@@ -70,6 +70,11 @@ as_hpf_ans () {
|
|||||||
su --login hpf-ans -c "if [ -r \"${VENV_ACTIVATE}\" ] ; then source \"${VENV_ACTIVATE}\" ; fi ; ${1}"
|
su --login hpf-ans -c "if [ -r \"${VENV_ACTIVATE}\" ] ; then source \"${VENV_ACTIVATE}\" ; fi ; ${1}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# $file_name
|
||||||
|
backup_file () {
|
||||||
|
mv "${1}" "${1}.backup-$(date "+%Y%m%d%H%M%S")"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
#### PROCESS
|
#### PROCESS
|
||||||
@@ -102,11 +107,10 @@ add_groups_to_user "hpf-sudo-np" hpf-ans
|
|||||||
|
|
||||||
# Create /etc/sudoers.d/hpf
|
# Create /etc/sudoers.d/hpf
|
||||||
f="/etc/sudoers.d/hpf"
|
f="/etc/sudoers.d/hpf"
|
||||||
if [ ! -f "$f" ] ; then
|
backup_file "${f}"
|
||||||
curl -o "$f" "${GIT_REPO_ETC_SUDOERS_D_HPF}"
|
curl -o "$f" "${GIT_REPO_ETC_SUDOERS_D_HPF}"
|
||||||
chown root:root "$f"
|
chown root:root "$f"
|
||||||
chmod u=rw,g=r,o= "$f"
|
chmod u=rw,g=r,o= "$f"
|
||||||
fi
|
|
||||||
|
|
||||||
# Make sure the hpf-ans ansible venv exists
|
# Make sure the hpf-ans ansible venv exists
|
||||||
as_hpf_ans "if [ ! -d \"${VENV_DIRECTORY}\" ] ; then python3 -m venv \"${VENV_DIRECTORY}\" ; fi"
|
as_hpf_ans "if [ ! -d \"${VENV_DIRECTORY}\" ] ; then python3 -m venv \"${VENV_DIRECTORY}\" ; fi"
|
||||||
@@ -126,10 +130,9 @@ fi
|
|||||||
|
|
||||||
# Create ~hpf-ans/bin/ansible-pull.sh
|
# Create ~hpf-ans/bin/ansible-pull.sh
|
||||||
f=~hpf-ans/bin/ansible-pull.sh
|
f=~hpf-ans/bin/ansible-pull.sh
|
||||||
if [ ! -f "${f}" ] ; then
|
backup_file "${f}"
|
||||||
as_hpf_ans "curl -o \"${f}\" \"${GIT_REPO_HOME_HPF_ANS_BIN_ANSIBLE_PULL_SH}\""
|
as_hpf_ans "curl -o \"${f}\" \"${GIT_REPO_HOME_HPF_ANS_BIN_ANSIBLE_PULL_SH}\""
|
||||||
as_hpf_ans "chown hpf-ans:hpf-ans \"${f}\"; chmod ug=rwx,o= \"${f}\""
|
as_hpf_ans "chown hpf-ans:hpf-ans \"${f}\"; chmod ug=rwx,o= \"${f}\""
|
||||||
fi
|
|
||||||
|
|
||||||
# Run ansible-pull to finish up
|
# Run ansible-pull to finish up
|
||||||
as_hpf_ans "bin/ansible-pull.sh"
|
as_hpf_ans "bin/ansible-pull.sh"
|
||||||
|
|||||||
Reference in New Issue
Block a user