[openstack-dev] [HEAT] Qestions on adding a new Software Config element for Opscode Chef

Thomas Spatzier thomas.spatzier at de.ibm.com
Sat Aug 2 14:58:57 UTC 2014


> From: Tao Tao <ttao at us.ibm.com>
> To: openstack-dev at lists.openstack.org
> Cc: Shu Tao <shutao at us.ibm.com>, Yan Yan YY Hu
> <yanyanhu at cn.ibm.com>, Bo B Yang <yangbbo at cn.ibm.com>
> Date: 01/08/2014 22:19
> Subject: [openstack-dev] [HEAT] Qestions on adding a new Software
> Config element for Opscode Chef
>
> Hi, All:
>
> We are trying to leverage Heat software config model to support
> Chef-based software installation. Currently the chef-based software
> config is not in place with Heat version 0.2.9.
>
> Therefore, we do have a number of questions on the implementation
byourselves:
>
> 1. Should we create new software config child resource types (e.g.
> OS::Heat::SoftwareConfig::Chef and
> OS::Heat::SoftwareDeployment::Chef proposed in the https://
> wiki.openstack.org/wiki/Heat/Blueprints/hot-software-config-spec) or
> should we reuse the existing software config resource type (e.g.
> OS::Heat::SoftwareConfig by leveraging group attribute) like the

Right, you should not implement your own resource plugin, but use the
current SoftwareConfig resource and specify 'chef' in the group attribute.

You will have to build an image that contains the right in-instance tools
as described here:
https://github.com/openstack/heat-templates/blob/master/hot/software-config/elements/README.rst

Note that the in-instance hook for handling chef-solo is still in review
and has not yet been merged to the heat-templates repository. Before
building you image, you can pull the changes for the chef config hook from
this review:

https://review.openstack.org/#/c/80229/

> following example with Puppet? What are the pros and cons with
> either approach?
>
>   config:
>     type: OS::Heat::SoftwareConfig
>     properties:
>       group: puppet
>       inputs:
>       - name: foo
>       - name: bar
>       outputs:
>       - name: result
>       config:
>         get_file: config-scripts/example-puppet-manifest.pp
>
>   deployment:
>     type: OS::Heat::SoftwareDeployment
>     properties:
>       config:
>         get_resource: config
>       server:
>         get_resource: server
>       input_values:
>         foo: fooooo
>         bar: baaaaa
>
> 2. Regarding OpsCode Chef and Heat integration, should our software
> config support chef-solo only, or should support Chef server? In
> another word,  should we let Heat to do the orchestration for the
> chef-based software install or should we continue to use chef-server
> for the chef-based software install?

I would say, with the current chef in-instance hook for Heat, you could use
chef-solo for the software install per package and per server and let Heat
do the overall orchestration.

>
> 3. In the current implementation of software config hook for puppet
> as follows:
>
> heat-templates / hot / software-config / elements / heat-config-puppet /
> install.d / 50-heat-config-hook-puppet
>
> 3.1 why we need a 50-* as a prefix for the heat-config hook name?
>
> 3.2 In the script as follows, what is the "install-packages" script?
> where does it load puppet package? How would we change the script to
> install chef package?
>
> #!/bin/bash
> set -x
>
> SCRIPTDIR=$(dirname $0)
>
> install-packages puppet
> install -D -g root -o root -m 0755 ${SCRIPTDIR}/hook-puppet.py /var/
> lib/heat-config/hooks/puppet
>
> 4. With diskimage-builder, we can build in images with many software
> config elements(chef, puppet, script, salt), which means there will
> be many hooks in the image.
>  However, By reading the source code of the os-refresh-config, it
> seems it will execute only the hooks which has corresponding "group"
> defined in the software config, is that right?

Right, you have to have the group property in your SoftwareConfig resources
set appropriately.

>
> def invoke_hook(c, log):
>         # sanitise the group to get an alphanumeric hook file name
>         hook = "".join(
>             x for x in c['group'] if x == '-' or x == '_' or x.isalnum())
>         hook_path = os.path.join(HOOKS_DIR, hook)
>
>         signal_data = None
>         if not os.path.exists(hook_path):
>             log.warn('Skipping group %s with no hook script %s' % (
>                 c['group'], hook_path))
>         else:
>
>
> Thanks a lot for your kind assistance!
>
>
>
> Thanks,
> Tao Tao, Ph.D.
> IBM T. J. Watson Research Center
> 1101 Kitchawan Road
> Yorktown Heights, NY 10598
> Phone: (914) 945-4541
> Email: ttao at us.ibm.com_______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev




More information about the OpenStack-dev mailing list