diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2018-03-03 22:24:19 +0100 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2018-03-04 12:32:55 +0100 |
commit | 85abd2fdbad83430df4824843764719064afb9b4 (patch) | |
tree | 767792a5691b3b253508a87362cde079a4a6f8fb /bin | |
parent | a77b768abb31be9e19563e130d763f163496477d (diff) | |
download | Puppet-85abd2fdbad83430df4824843764719064afb9b4.tar.gz Puppet-85abd2fdbad83430df4824843764719064afb9b4.tar.zst Puppet-85abd2fdbad83430df4824843764719064afb9b4.zip |
Fetch node informations from LDAP
environment, hostname
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/install_script.sh | 12 |
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) | ||
15 | EOF | 16 | EOF |
16 | } | 17 | } |
17 | 18 | ||
@@ -19,6 +20,7 @@ set -e | |||
19 | 20 | ||
20 | host_user=root | 21 | host_user=root |
21 | git_branch=master | 22 | git_branch=master |
23 | environment=production | ||
22 | 24 | ||
23 | while [ -n "$1" ]; do | 25 | while [ -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 | |||
173 | CODE_PATH="/etc/puppetlabs/code" | 179 | CODE_PATH="/etc/puppetlabs/code" |
174 | rm -rf \$CODE_PATH | 180 | rm -rf \$CODE_PATH |
175 | git clone -b $git_branch --recursive https://git.immae.eu/perso/Immae/Projets/Puppet.git \$CODE_PATH | 181 | git clone -b $git_branch --recursive https://git.immae.eu/perso/Immae/Projets/Puppet.git \$CODE_PATH |
176 | puppet apply --tags base_installation --test \$CODE_PATH/manifests/site.pp | 182 | puppet 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 |
178 | puppet apply --tags base_installation --test \$CODE_PATH/manifests/site.pp | 184 | puppet apply --environment $environment --tags base_installation --test \$CODE_PATH/manifests/site.pp |
179 | EOF | 185 | EOF |
180 | 186 | ||
181 | chmod a+x $ARCH_HOST_SCRIPT $ARCH_CHROOT_SCRIPT $ARCH_INSTALL_SCRIPT | 187 | chmod 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 | ||
198 | cat > $ARCH_PUPPET_CONFIGURATION_SCRIPT <<EOF | 204 | cat > $ARCH_PUPPET_CONFIGURATION_SCRIPT <<EOF |
199 | CODE_PATH="/etc/puppetlabs/code" | 205 | CODE_PATH="/etc/puppetlabs/code" |
200 | puppet apply --tags base_installation --test \$CODE_PATH/manifests/site.pp | 206 | puppet apply --environment $environment --tags base_installation --test \$CODE_PATH/manifests/site.pp |
201 | EOF | 207 | EOF |
202 | 208 | ||
203 | cat > $ARCH_HOST_PUPPET_CONFIGURATION_SCRIPT <<EOF | 209 | cat > $ARCH_HOST_PUPPET_CONFIGURATION_SCRIPT <<EOF |