diff options
author | Thom May <thom@chef.io> | 2018-05-02 14:51:30 +0100 |
---|---|---|
committer | Thom May <thom@chef.io> | 2018-05-02 15:20:11 +0100 |
commit | cf9fa5c5d903c8b81728d53281b3eef70913fd45 (patch) | |
tree | 79f1b6ad6238e31eb6cc23a6b1a77baad7af6a31 /habitat | |
parent | a83949542458218908db56256add2f3da3618006 (diff) | |
download | chef-cf9fa5c5d903c8b81728d53281b3eef70913fd45.tar.gz |
Update hab plan to current standardselliott/update_hab_plan
Also tidy up the config a bit
Signed-off-by: Thom May <thom@chef.io>
Diffstat (limited to 'habitat')
-rw-r--r-- | habitat/config/client.rb | 11 | ||||
-rw-r--r-- | habitat/config/data_collector_metadata.json | 1 | ||||
-rw-r--r-- | habitat/default.toml | 8 | ||||
-rw-r--r-- | habitat/hooks/init | 8 | ||||
-rw-r--r-- | habitat/plan.sh | 14 |
5 files changed, 16 insertions, 26 deletions
diff --git a/habitat/config/client.rb b/habitat/config/client.rb index 1b1f512184..2d28d223c5 100644 --- a/habitat/config/client.rb +++ b/habitat/config/client.rb @@ -1,16 +1,10 @@ -cookbook_path "{{pkg.svc_data_path}}/{{cfg.cookbook_path}}" -data_bag_path "{{pkg.svc_data_path}}/{{cfg.data_bag_path}}" -environment_path "{{pkg.svc_data_path}}/{{cfg.environment_path}}" +chef_repo_path "{{pkg.svc_data_path}}/chef" file_backup_path "{{pkg.svc_data_path}}/{{cfg.file_backup_path}}" -node_path "{{pkg.svc_data_path}}/{{cfg.node_path}}" -role_path "{{pkg.svc_data_path}}/{{cfg.role_path}}" pid_file "{{pkg.svc_data_path}}/{{cfg.pid_file}}" data_collector.server_url "{{cfg.data_collector.url}}" data_collector.token "{{cfg.data_collector.token}}" data_collector.mode "{{cfg.data_collector.mode}}".to_sym data_collector.raise_on_failure {{cfg.data_collector.raise_on_failure}} -chef_repo_path "{{pkg.svc_data_path}}/chef" -environment "{{cfg.environment}}" minimal_ohai {{cfg.minimal_ohai}} {{#if cfg.chef-client.node_name ~}} node_name "{{cfg.node_name}}" @@ -19,3 +13,6 @@ splay {{cfg.splay}} interval {{cfg.interval}} log_location {{cfg.log_location}} log_level "{{cfg.log_level}}".to_sym +{{#if cfg.use_member_id_as_uuid ~}} +chef_guid "{{svc.me.member_id}}" +{{/if ~}} diff --git a/habitat/config/data_collector_metadata.json b/habitat/config/data_collector_metadata.json deleted file mode 100644 index 10a5f027d3..0000000000 --- a/habitat/config/data_collector_metadata.json +++ /dev/null @@ -1 +0,0 @@ -{"node_uuid": "{{svc.me.member_id}}"} diff --git a/habitat/default.toml b/habitat/default.toml index 38b33210f9..1422305835 100644 --- a/habitat/default.toml +++ b/habitat/default.toml @@ -1,11 +1,3 @@ -cookbook_path = "chef/cookbooks" -data_bag_bath = "chef/data_bags" -environment_path = "chef/environments" -file_backup_path = "chef/backup" -file_cache_path = "chef/cache" -node_path = "chef/node" -role_path = "chef/roles" - pid_file = "chef.pid" run_list = "" diff --git a/habitat/hooks/init b/habitat/hooks/init index f615b11d85..a23344b2a9 100644 --- a/habitat/hooks/init +++ b/habitat/hooks/init @@ -1,11 +1,5 @@ #!/bin/sh exec 2>&1 -for path in {{cfg.cookbook_path}} {{cfg.data_bag_path}} {{cfg.environment_path}} {{cfg.file_backup_path}} {{cfg.file_cache_path}} {{cfg.node_path}} {{cfg.role_path}}; do - mkdir -p "{{pkg.svc_data_path}}/$path" -done -{{#if cfg.use_member_id_as_uuid ~}} -mkdir -p "{{pkg.svc_config_path}}/local-mode-cache/cache/" -cp -v "{{pkg.svc_config_path}}/data_collector_metadata.json" "{{pkg.svc_config_path}}/local-mode-cache/cache/" -{{/if ~}} +mkdir -p "{{pkg.svc_data_path}}/chef" diff --git a/habitat/plan.sh b/habitat/plan.sh index 9c9b5b19c8..26fcd5dad6 100644 --- a/habitat/plan.sh +++ b/habitat/plan.sh @@ -3,14 +3,18 @@ pkg_origin=chef pkg_maintainer="The Chef Maintainers <humans@chef.io>" pkg_description="The Chef Client" pkg_version=$(cat ../VERSION) -pkg_source=nosuchfile.tar.gz -pkg_filename=${pkg_dirname}.tar.gz pkg_license=('Apache-2.0') +pkg_filename=${pkg_dirname}.tar.gz pkg_bin_dirs=(bin) pkg_build_deps=(core/make core/gcc core/git) -pkg_deps=(core/glibc core/ruby core/libxml2 core/libxslt core/libiconv core/xz core/zlib core/bundler core/openssl core/cacerts core/libffi core/coreutils) +pkg_deps=(core/glibc core/ruby core/libxml2 core/libxslt core/libiconv core/xz core/zlib core/bundler core/openssl core/cacerts core/libffi core/coreutils core/libarchive) pkg_svc_user=root +do_before() { + do_default_before + update_pkg_version +} + do_download() { build_line "Fake download! Creating archive of latest repository commit." # source is in this repo, so we're going to create an archive from the @@ -86,6 +90,10 @@ do_end() { fi } +do_strip() { + return 0 +} + # Helper function to wrap up some repetitive bundle install flags _bundle_install() { local path |