From cb1dcdeb3d63b317947113f99f30cfdd367585f1 Mon Sep 17 00:00:00 2001 From: Muhammad Hussein Fattahizdeh Date: Mon, 14 Nov 2016 21:10:52 +0330 Subject: [PATCH] fix readme config add postinstall --- README.md | 16 +++++++++++----- config.sample | 2 +- post-install.sh | 7 +++++++ preseed.cfg.template | 2 ++ 4 files changed, 21 insertions(+), 6 deletions(-) create mode 100644 post-install.sh diff --git a/README.md b/README.md index 74ebdc5..0cc45e2 100644 --- a/README.md +++ b/README.md @@ -14,8 +14,6 @@ Create your own netiso and reinstall it over ssh. You can partion yor server as 2. Clone this repo to your server 3. Copy `config.sample` to `config` file and edit field by field exactly: ``` - #!/bin/bash - # country COUNTRY='IR' @@ -27,14 +25,14 @@ Create your own netiso and reinstall it over ssh. You can partion yor server as INTERFACE_NAMESERVERS='4.2.2.4' # preseed file: upload created preseed.cfg to your own host before reboot system - PRESEED_URL="http://10.1.1.2/preseed.cfg" + PRESEED_URL="http://yourserver.tld/preseed.cfg" # ssh installer password PASSWORD="tHISiSpASSWORD" # hostname and domain - HOSTNAME="${INTERFACE_IP//\./\-}-$COUNTRY_LOWER" - DOMAIN="servers.aasaam.net" + HOSTNAME="${INTERFACE_IP//\./\-}" + DOMAIN="servers.domain.org" # lowercase of country code dont change it COUNTRY_LOWER="${COUNTRY,,}" @@ -71,6 +69,14 @@ Remember you must do as root user also ... Your password is tHISiSpASSWORD ``` +#### Upload your preseed file +Upload your preseed.cfg file to configured location `PRESEED_URL`. + +You can test it. We must get 200 response as we expected +``` +curl -o /dev/null --silent --head --write-out '%{http_code}\n' http://yourserver.tld/preseed.cfg +200 +``` #### Reboot ``` reboot diff --git a/config.sample b/config.sample index c0637fc..a4c1cc9 100644 --- a/config.sample +++ b/config.sample @@ -18,7 +18,7 @@ PASSWORD="tHISiSpASSWORD" # hostname and domain HOSTNAME="${INTERFACE_IP//\./\-}" -DOMAIN="servers.aasaam.net" +DOMAIN="servers.domain.org" # lowercase of country code dont change it COUNTRY_LOWER="${COUNTRY,,}" diff --git a/post-install.sh b/post-install.sh new file mode 100644 index 0000000..301d7fb --- /dev/null +++ b/post-install.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +# sysdig +# curl -s https://s3.amazonaws.com/download.draios.com/stable/install-sysdig | bash + +# fluentd +# curl -L https://toolbelt.treasuredata.com/sh/install-ubuntu-xenial-td-agent2.sh | sh diff --git a/preseed.cfg.template b/preseed.cfg.template index a659035..101907e 100644 --- a/preseed.cfg.template +++ b/preseed.cfg.template @@ -19,3 +19,5 @@ d-i hw-detect/load_firmware boolean true d-i anna/choose_modules string network-console d-i network-console/password password PASSWORD d-i network-console/password-again password PASSWORD +# d-i pkgsel/include string ntp htop iotop curl +# d-i preseed/late_command string in-target post-install.sh