aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2018-03-03 22:24:19 +0100
committerIsmaël Bouya <ismael.bouya@normalesup.org>2018-03-04 12:32:55 +0100
commit85abd2fdbad83430df4824843764719064afb9b4 (patch)
tree767792a5691b3b253508a87362cde079a4a6f8fb /bin
parenta77b768abb31be9e19563e130d763f163496477d (diff)
downloadPuppet-85abd2fdbad83430df4824843764719064afb9b4.tar.gz
Puppet-85abd2fdbad83430df4824843764719064afb9b4.tar.zst
Puppet-85abd2fdbad83430df4824843764719064afb9b4.zip
Fetch node informations from LDAP
environment, hostname
Diffstat (limited to 'bin')
-rwxr-xr-xbin/install_script.sh12
1 files changed, 9 insertions, 3 deletions
diff --git a/bin/install_script.sh b/bin/install_script.sh
index 49a737f..6b1aa39 100755
--- a/bin/install_script.sh
+++ b/bin/install_script.sh
@@ -12,6 +12,7 @@ cat <<EOF
12 --no-reboot-start Don't reboot to rescue at the beginning 12 --no-reboot-start Don't reboot to rescue at the beginning
13 --no-reboot-end Don't reboot to normal at the end 13 --no-reboot-end Don't reboot to normal at the end
14 --git-branch Use another puppet branch (default: master) 14 --git-branch Use another puppet branch (default: master)
15 --environment Environment to use for the installl (default: production)
15EOF 16EOF
16} 17}
17 18
@@ -19,6 +20,7 @@ set -e
19 20
20host_user=root 21host_user=root
21git_branch=master 22git_branch=master
23environment=production
22 24
23while [ -n "$1" ]; do 25while [ -n "$1" ]; do
24 case "$1" in 26 case "$1" in
@@ -50,6 +52,10 @@ while [ -n "$1" ]; do
50 git_branch="$2" 52 git_branch="$2"
51 shift 53 shift
52 ;; 54 ;;
55 --environment)
56 environment="$2"
57 shift
58 ;;
53 --help|-h) 59 --help|-h)
54 usage 60 usage
55 exit 0 61 exit 0
@@ -173,9 +179,9 @@ cat > $ARCH_INSTALL_SCRIPT <<EOF
173CODE_PATH="/etc/puppetlabs/code" 179CODE_PATH="/etc/puppetlabs/code"
174rm -rf \$CODE_PATH 180rm -rf \$CODE_PATH
175git clone -b $git_branch --recursive https://git.immae.eu/perso/Immae/Projets/Puppet.git \$CODE_PATH 181git clone -b $git_branch --recursive https://git.immae.eu/perso/Immae/Projets/Puppet.git \$CODE_PATH
176puppet apply --tags base_installation --test \$CODE_PATH/manifests/site.pp 182puppet apply --environment $environment --tags base_installation --test \$CODE_PATH/manifests/site.pp
177# The password seed requires puppet to be run twice 183# The password seed requires puppet to be run twice
178puppet apply --tags base_installation --test \$CODE_PATH/manifests/site.pp 184puppet apply --environment $environment --tags base_installation --test \$CODE_PATH/manifests/site.pp
179EOF 185EOF
180 186
181chmod a+x $ARCH_HOST_SCRIPT $ARCH_CHROOT_SCRIPT $ARCH_INSTALL_SCRIPT 187chmod a+x $ARCH_HOST_SCRIPT $ARCH_CHROOT_SCRIPT $ARCH_INSTALL_SCRIPT
@@ -197,7 +203,7 @@ read -p "Press key when LDAP is configured" i
197 203
198cat > $ARCH_PUPPET_CONFIGURATION_SCRIPT <<EOF 204cat > $ARCH_PUPPET_CONFIGURATION_SCRIPT <<EOF
199CODE_PATH="/etc/puppetlabs/code" 205CODE_PATH="/etc/puppetlabs/code"
200puppet apply --tags base_installation --test \$CODE_PATH/manifests/site.pp 206puppet apply --environment $environment --tags base_installation --test \$CODE_PATH/manifests/site.pp
201EOF 207EOF
202 208
203cat > $ARCH_HOST_PUPPET_CONFIGURATION_SCRIPT <<EOF 209cat > $ARCH_HOST_PUPPET_CONFIGURATION_SCRIPT <<EOF