summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2021-03-23 12:11:12 -0700
committerTim Smith <tsmith84@gmail.com>2021-03-23 12:11:12 -0700
commit93cf64a6afabb803e290eb65e248a9ceac2308c6 (patch)
treeac6561d04d002f031070a9c30f51b94091193a21
parentd27c48f306acb31a78c89b8b0f275dea91ffc944 (diff)
downloadchef-sample_config.tar.gz
Switch to HEREDOCsample_config
Signed-off-by: Tim Smith <tsmith@chef.io>
-rwxr-xr-xomnibus/package-scripts/chef/postinst16
1 files changed, 9 insertions, 7 deletions
diff --git a/omnibus/package-scripts/chef/postinst b/omnibus/package-scripts/chef/postinst
index ed6689e246..61d1d0abe1 100755
--- a/omnibus/package-scripts/chef/postinst
+++ b/omnibus/package-scripts/chef/postinst
@@ -97,13 +97,15 @@ ln -sf $INSTALLER_DIR/bin/chef-client $PREFIX/bin || error_exit "Cannot link che
# the sample client.rb is only written out of no chef config dir exists yet
if ! [ -d $CONFIG_DIR ]; then
mkdir -p $CONFIG_DIR
- echo -e "# The client.rb file specifies how Chef Infra Client is configured on a node" > "$CONFIG_DIR/client.rb"
- echo -e "# See https://docs.chef.io/config_rb_client/ for detailed configuration options" >> "$CONFIG_DIR/client.rb"
- echo -e "#" >> "$CONFIG_DIR/client.rb"
- echo -e "# Minimal example configuration:" >> "$CONFIG_DIR/client.rb"
- echo -e "# node_name \"THIS_NODE_NAME\"" >> "$CONFIG_DIR/client.rb"
- echo -e "# chef_server_url \"https://CHEF.MYCOMPANY.COM/organizations/MY_CHEF_ORG\"" >> "$CONFIG_DIR/client.rb"
- echo -e "# chef_license \"accept\"" >> "$CONFIG_DIR/client.rb"
+ cat >"$CONFIG_DIR/client.rb" <<EOF
+# The client.rb file specifies how Chef Infra Client is configured on a node
+# See https://docs.chef.io/config_rb_client/ for detailed configuration options
+#
+# Minimal example configuration:
+# node_name "THIS_NODE_NAME"
+# chef_server_url "https://CHEF.MYCOMPANY.COM/organizations/MY_CHEF_ORG"
+# chef_license "accept"
+EOF
fi
mkdir -p "$CONFIG_DIR/client.d"