Skip to content
This repository has been archived by the owner on Sep 13, 2019. It is now read-only.

Ensure that the chef shutdown service is configurable #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

JonathanSerafini
Copy link
Owner

New attributes in attributes/cfn-shutdown.rb

# Name of the node which should be deleted when the service executes
#
# This option supports the following values:
# - DETECT_CLIENTNAME: grep the node_name from /etc/chef/client.rb
# - DETECT_NODENAME: node.name
# - DETECT_HOSTNAME: hostname --fqdn
# - *: Any other value is considered as the node_name you wish to delete
#
# @since 2.2.0
default['cfn']['shutdown']['node_name'] = 'DETECT_NODENAME'

Pull request to resolve issue in #1
@webframp @sandervanburken Would this change work for you ?

;;
stop)
echo "***** Deleting node and client *****"
node_name="<%= @node_name %>"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this expected to be the value of the attribute?

@@ -1,6 +1,7 @@
# Ensure deletes the node and client upon shutdown
#
cookbook_file '/etc/init.d/chef_lifecycle' do
template '/etc/init.d/chef_lifecycle' do
source 'shutdown/chef_lifecycle.erb'
mode '0750'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need a variables parameter to pass node['cfn']['shutdown']['node_name'] to the template as node_name ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants