[chef] Re: Digest for list chef (3/3)


Chronological Thread 
  • From: Tim Trefren < >
  • To:
  • Subject: [chef] Re: Digest for list chef (3/3)
  • Date: Fri, 23 Aug 2013 19:26:02 -0700

unsubscribe


On Thu, Aug 22, 2013 at 1:26 PM, < " target="_blank"> > wrote:
Table of contents:

51. [chef] Re: Re: Re: Re: knife.rb cookbook_path with Berkshelf - "Mark H. Nichols" < "> >
52. [chef] Re: Re: Re: Re: Re: knife.rb cookbook_path with Berkshelf - Ranjib Dey < "> >
53. [chef] Omnibus/Debian(Ubuntu 12.04 LTS) not symlinking
 /opt/<project>/embedded/bin - Michael Hayes < "> >
54. [chef] Re: Re: Re: Re: Re: Re: knife.rb cookbook_path with Berkshelf - "Mark H. Nichols" < "> >
55. [chef] Re: Omnibus/windows - Michael Hayes < "> >
56. [chef] Re: Re: Re: Re: Re: Best Practice Performing Upgrade and
 Uninstall - Seth Falcon < "> >
57. [chef] Re: how to know if a chef-client run is occuring - Michael Hart < "> >
58. [chef] 11.6.0 on Solaris and line feeds in files rendered from
 templates - < "> >
59. [chef] Re: Re: Omnibus/windows - Anton Baranov < "> >
60. [chef] Confused by range search - Jeppe Nejsum Madsen < "> >
61. [chef] pre-update notifications - Gregoire Seux < "> >
62. [chef] Re: pre-update notifications - Andrew Gross < "> >
63. [chef] Re: Re: pre-update notifications - Grégoire Seux < "> >
64. [chef] Re: Re: Re: pre-update notifications - Andrew Gross < "> >
65. [chef] Re: Re: Re: pre-update notifications - Ranjib Dey < "> >
66. [chef] Re: Re: how to know if a chef-client run is occuring - Daniel DeLeo < "> >
67. [chef] Re: pre-update notifications - Daniel DeLeo < "> >
68. [chef] Re: Re: Re: Omnibus/windows - Daniel DeLeo < "> >
69. [chef] Re: 11.6.0 on Solaris and line feeds in files rendered
 from templates - Daniel DeLeo < "> >
70. [chef] Re: Re: Re: Re: Omnibus/windows - Anton Baranov < "> >
71. [chef] Re: Re: pre-update notifications - Grégoire Seux < "> >
72. [chef] Re: Confused by range search - Seth Falcon < "> >
73. [chef] Re: Re: 11.6.0 on Solaris and line feeds in files rendered
 from templates - Jesse Nelson < "> >



---------- Forwarded message ----------
From: "Mark H. Nichols" < "> >
To:  ">
Cc: 
Date: Wed, 21 Aug 2013 14:40:45 -0500
Subject: [chef] Re: Re: Re: Re: knife.rb cookbook_path with Berkshelf

On Aug 21, 2013, at 2:34 PM, Ranjib Dey < "> > wrote:

> you can specify any valid git rev iirc (i.e. branch, sha, tag etc), since berks uses the ~/.berkshelf/cookbooks as cache directory, it will store all the versions that you have specified in your berksfile.

I have successfully used branch before. However the resulting directory under .berkshelf/cookbooks includes the Git SHA as part of the name. Over time I've accumulated several versions of the same cookbook that all have different SHAs as a part of the directory name. What I can't figure out is how to get a more meaningful name created via Berkshelf when I pull the cookbook from Github. Having to specify `knife cookbook upload ome_jboss-daa338348c4d14e9e1abe693ecc98dfc6d412f5c` isn't going to be a lot of fun.




---------- Forwarded message ----------
From: Ranjib Dey < "> >
To:  ">
Cc: 
Date: Wed, 21 Aug 2013 12:47:05 -0700
Subject: [chef] Re: Re: Re: Re: Re: knife.rb cookbook_path with Berkshelf
this is expected right? When you say branch you it expand to the HEAD of that branch, which might be different revision at different point in time. If you dont want that, either use tag or revision

I am not getting why you want a meaningful name in the cache directory? `berk install -p` foo will copy over the correct (as specified by berksfile) version in foo. You can alias point cookbook_dir to a vendor directory, and alias knife upload to invoke (berks install -p vendor && knife cookbook upload) berks install , 


On Wed, Aug 21, 2013 at 12:40 PM, Mark H. Nichols < " target="_blank"> > wrote:

On Aug 21, 2013, at 2:34 PM, Ranjib Dey < " target="_blank"> > wrote:

> you can specify any valid git rev iirc (i.e. branch, sha, tag etc), since berks uses the ~/.berkshelf/cookbooks as cache directory, it will store all the versions that you have specified in your berksfile.

I have successfully used branch before. However the resulting directory under .berkshelf/cookbooks includes the Git SHA as part of the name. Over time I've accumulated several versions of the same cookbook that all have different SHAs as a part of the directory name. What I can't figure out is how to get a more meaningful name created via Berkshelf when I pull the cookbook from Github. Having to specify `knife cookbook upload ome_jboss-daa338348c4d14e9e1abe693ecc98dfc6d412f5c` isn't going to be a lot of fun.





---------- Forwarded message ----------
From: Michael Hayes < "> >
To:  ">
Cc: 
Date: Wed, 21 Aug 2013 14:59:21 -0500
Subject: [chef] Omnibus/Debian(Ubuntu 12.04 LTS) not symlinking /opt/<project>/embedded/bin
In my Omnibus package, I uncommented the line in the 'makeselfinst' file to symlink my /opt etc bin directory:

# You may want to symlink your packages bin files into /usr/bin
ln -sf $DEST_DIR/embedded/bin/rumm /usr/bin || error_exit "Cannot link rumm to /usr/bin"

It creates the symlink fine in OSX, but  in Ubuntu it doesn't create the symlink. 


------
Michael Hayes
Morris Mobile Labs, Inc.



---------- Forwarded message ----------
From: "Mark H. Nichols" < "> >
To:  ">
Cc: 
Date: Wed, 21 Aug 2013 15:03:41 -0500
Subject: [chef] Re: Re: Re: Re: Re: Re: knife.rb cookbook_path with Berkshelf


this is expected right? When you say branch you it expand to the HEAD of that branch, which might be different revision at different point in time. If you dont want that, either use tag or revision

I am not getting why you want a meaningful name in the cache directory?

I can't run `knife cookbook upload ome_jboss` since berks added the Git SHA to the directory name in .berkshelf/cookbooks. 

`berk install -p` foo will copy over the correct (as specified by berksfile) version in foo. You can alias point cookbook_dir to a vendor directory, and alias knife upload to invoke (berks install -p vendor && knife cookbook upload) berks install , 

It looks like your alias was cut off. I don't follow what you intend.




On Wed, Aug 21, 2013 at 12:40 PM, Mark H. Nichols < " target="_blank"> > wrote:

On Aug 21, 2013, at 2:34 PM, Ranjib Dey < " target="_blank"> > wrote:

> you can specify any valid git rev iirc (i.e. branch, sha, tag etc), since berks uses the ~/.berkshelf/cookbooks as cache directory, it will store all the versions that you have specified in your berksfile.

I have successfully used branch before. However the resulting directory under .berkshelf/cookbooks includes the Git SHA as part of the name. Over time I've accumulated several versions of the same cookbook that all have different SHAs as a part of the directory name. What I can't figure out is how to get a more meaningful name created via Berkshelf when I pull the cookbook from Github. Having to specify `knife cookbook upload ome_jboss-daa338348c4d14e9e1abe693ecc98dfc6d412f5c` isn't going to be a lot of fun.






---------- Forwarded message ----------
From: Michael Hayes < "> >
To:  ">
Cc: 
Date: Wed, 21 Aug 2013 15:57:28 -0500
Subject: [chef] Re: Omnibus/windows
Any hints on getting zlib to compile?


As i said earlier, you should create an omnibus.rb file in the root of your project, which should contain sth like lines under "# windows config" in this file: https://github.com/opscode/omnibus-chef/blob/master/omnibus.rb.example.windows

--------------------------
With best regards, Anton Baranov.

четверг, 22 августа 2013 г. в 0:39, Michael Hayes написал:

No. How do I do that?


But, did you create omnibus.rb with actual paths for omnibus on windows in root of project?





---------- Forwarded message ----------
From: Seth Falcon < "> >
To: < "> >
Cc: 
Date: Wed, 21 Aug 2013 14:26:25 -0700
Subject: [chef] Re: Re: Re: Re: Re: Best Practice Performing Upgrade and Uninstall

"> writes:
> Yes, I know the "package" resource, but the prerequisite is that I have
> pack my own source code into a .deb package or .rpm package.
>
> But if the software is developed by myself, I did not pack the source code,
> and it do not exist in any package repository.
>
> What is the common practice on this situation?

If you have non-packaged code that you want to cleanup, I'd recommend
creating a cleanup recipe that removes it (perhaps stopping a service,
removing files and directories, etc).

For non-packaged things, it is hard to make a general uninstall
solution, so the common practice, if you can call it that, is custom
uninstall recipes.

+ seth

--
Seth Falcon | Development Lead | Opscode | @sfalcon



---------- Forwarded message ----------
From: Michael Hart < "> >
To: "< "> >" < "> >
Cc: 
Date: Thu, 22 Aug 2013 00:45:25 +0000
Subject: [chef] Re: how to know if a chef-client run is occuring
Thanks Daniel, the feature in Enterprise Chef sounds interesting. Do you know the timeline for this feature's release in Enterprise Chef?

cheers
mike

-- 
Michael Hart
Arctic Wolf Networks



On Wednesday, August 21, 2013 at 9:22 AM, Michael Hart wrote:

Is there a definitive way of querying the chef server to see if a chef-client run is occurring on a node? We've noticed that a "knife status" will return a timestamp of "382528 hours ago", or however many hours you are away from epoch, and but it's not entirely consistent and using that in code feels like a bit of a hack. Ideally I'd like an API to return true or false if a chef-client run is occurring. Thoughts?
Chef client communicates over HTTP, which is a stateless protocol, so there's no robust way for the server to know anything other than the last time a client made a request.

In Enterprise Chef (née Hosted and Private Chef), upcoming updates will include a node run history reporting feature that emulates the ability to track running clients by having them check in at the beginning and end of a run. How much of this makes it into the open source version and when is an open question at this point, but you could use a custom event dispatcher to track the state of clients in a similar way by integrating with a different system.
 

cheers
mike

-- 
Michael Hart
Arctic Wolf Networks



-- 
Daniel DeLeo




---------- Forwarded message ----------
From: < "> >
To:  ">
Cc: 
Date: Wed, 21 Aug 2013 20:58:06 -0700 (PDT)
Subject: [chef] 11.6.0 on Solaris and line feeds in files rendered from templates
I tried using chef.11.6.0-1.solaris2.5.10.i386.solaris on Solaris 10 today, but
I found that when a template source file containing line feeds such as the
following:

domain <%= @domain %>^M
search <% @search_domains.each do |search_domain| -%><%= search_domain %> <%
end -%>^M
<% @nameservers.each do |nameserver| -%>^M
nameserver <%= nameserver %>^M
<% end -%>^M

The rendered file also has the line feeds:

domain xyz.com^M
search xyz.com ^M
nameserver 10.nnn.nn.nn^M

Such garbage in the rendered files causes the resolver to fail.

With 11.4, the rendered file is free of the line feeds and the resolver works
as expected.

Has anyone noticed this issue with 11.6 in general and/or specifically on
Solaris?

Is there a workaround?  Or perhaps this is a case of garbage in and garbage
out? i.e. the behavior in 11.4 is masking the need for us to ensure that the
template files don't have this style of new line?


---------- Forwarded message ----------
From: Anton Baranov < "> >
To:  ">
Cc: 
Date: Thu, 22 Aug 2013 15:59:34 +0900
Subject: [chef] Re: Re: Omnibus/windows
I didn't work with omnibus and zlib.

--------------------------
With best regards, Anton Baranov.

четверг, 22 августа 2013 г. в 5:57, Michael Hayes написал:

Any hints on getting zlib to compile?


As i said earlier, you should create an omnibus.rb file in the root of your project, which should contain sth like lines under "# windows config" in this file: https://github.com/opscode/omnibus-chef/blob/master/omnibus.rb.example.windows

--------------------------
With best regards, Anton Baranov.

четверг, 22 августа 2013 г. в 0:39, Michael Hayes написал:

No. How do I do that?


But, did you create omnibus.rb with actual paths for omnibus on windows in root of project?






---------- Forwarded message ----------
From: Jeppe Nejsum Madsen < "> >
To: " "> " < "> >
Cc: 
Date: Thu, 22 Aug 2013 11:04:40 +0200
Subject: [chef] Confused by range search
Ohai,

Maybe I'm expecting too much, but this is slightly confusing:

$ knife search 'ipaddress:[172.26.133.95 TO 172.26.133.99]'|grep IP|sort
IP:          172.26.133.95
IP:          172.26.133.96
IP:          172.26.133.97
IP:          172.26.133.98
IP:          172.26.133.99

$ knife search 'ipaddress:[172.26.133.95 TO 172.26.133.105]'
0 items found

Seems like I have to match the number of digits for the range query to work:

$ knife search 'ipaddress:[172.26.133.100 TO 172.26.133.105]'|grep IP|sort
IP:          172.26.133.100
IP:          172.26.133.101
IP:          172.26.133.102
IP:          172.26.133.103
IP:          172.26.133.104
IP:          172.26.133.105

Is this WAD?

/Jeppe



---------- Forwarded message ----------
From: Gregoire Seux < "> >
To: < "> >
Cc: 
Date: Thu, 22 Aug 2013 14:31:07 +0200
Subject: [chef] pre-update notifications
Hello,

I'd like to have pre-update notifications which would be the same as
"notifies" but triggered before resource convergence.

For instance, some packages automatically restart a service during
upgrade and I'd like to downtime the host in supervision _before_
actually starting to upgrade those packages.

Classic notifications would be :

>package "cassandra" do
>  notifies :run, "execute[downtime host]"
>end

but notification is triggered _after_ the upgrade so it is not useful
anymore.

I wondered how to do this and came up with a partial solution switching
to why_run  temporarily to find wether a given resource (package) will
be updated during convergence.
An example is https://gist.github.com/kamaradclimber/6306398
which would execute the resource to downtime only if the package will be
upgrade later.

Does anyone has already encountered such need? and fixed it?

--
Grégoire


---------- Forwarded message ----------
From: Andrew Gross < "> >
To: chef < "> >
Cc: 
Date: Thu, 22 Aug 2013 10:17:00 -0400
Subject: [chef] Re: pre-update notifications
Hey,

Our solution for this was to chain notifications in the order we wanted.  

For example:

execute "Update Cassandra" do
  notifies :run, execute[Downtime Cassandra Host],
end

execute "Downtime Cassandra Host" do
  action :nothing
  notifies :restart, service[Cassandra],
end

service "Cassandra" do
  action :nothing
end

The upside is that you have a relatively straightforward way to chain these processes, the downside is that this is entirely up to the coder to make sure they follow the pattern.

We do something similar with config validation before service restarts for Nginx.


On Thu, Aug 22, 2013 at 8:31 AM, Gregoire Seux < " target="_blank"> > wrote:
Hello,

I'd like to have pre-update notifications which would be the same as
"notifies" but triggered before resource convergence.

For instance, some packages automatically restart a service during
upgrade and I'd like to downtime the host in supervision _before_
actually starting to upgrade those packages.

Classic notifications would be :

>package "cassandra" do
>  notifies :run, "execute[downtime host]"
>end

but notification is triggered _after_ the upgrade so it is not useful
anymore.

I wondered how to do this and came up with a partial solution switching
to why_run  temporarily to find wether a given resource (package) will
be updated during convergence.
An example is https://gist.github.com/kamaradclimber/6306398
which would execute the resource to downtime only if the package will be
upgrade later.

Does anyone has already encountered such need? and fixed it?

--
Grégoire



---------- Forwarded message ----------
From: "Grégoire Seux" < "> >
To: < "> >
Cc: 
Date: Thu, 22 Aug 2013 16:52:17 +0200
Subject: [chef] Re: Re: pre-update notifications
Le 22/08/2013 16:17, Andrew Gross a écrit :

execute "Update Cassandra" do
  notifies :run, execute[Downtime Cassandra Host],
end

execute "Downtime Cassandra Host" do
  action :nothing
  notifies :restart, service[Cassandra],
end

service "Cassandra" do
  action :nothing
end
Hi Andrew,

thanks for your reply.
This issue with your solution is that it assumes that you can update the package and then decide to restart the service.
In my case, the package contains triggers to update restart the service (stop it as pre-install and start as post-install hook). This pattern is quite commom I guess on rhel and debian systems.

So in your example you would have updated the package (thus restart the service), downtimed the host and restart the service once more.

--
Gregoire


---------- Forwarded message ----------
From: Andrew Gross < "> >
To: chef < "> >
Cc: 
Date: Thu, 22 Aug 2013 10:56:05 -0400
Subject: [chef] Re: Re: Re: pre-update notifications
Fair enough, the order was rather arbitrary in my example, though I can see how it might be problematic, as you would now need an additional block to determine if an update was available, and one to install it.


On Thu, Aug 22, 2013 at 10:52 AM, Grégoire Seux < " target="_blank"> > wrote:
Le 22/08/2013 16:17, Andrew Gross a écrit :


execute "Update Cassandra" do
  notifies :run, execute[Downtime Cassandra Host],
end

execute "Downtime Cassandra Host" do
  action :nothing
  notifies :restart, service[Cassandra],
end

service "Cassandra" do
  action :nothing
end
Hi Andrew,

thanks for your reply.
This issue with your solution is that it assumes that you can update the package and then decide to restart the service.
In my case, the package contains triggers to update restart the service (stop it as pre-install and start as post-install hook). This pattern is quite commom I guess on rhel and debian systems.

So in your example you would have updated the package (thus restart the service), downtimed the host and restart the service once more.

--
Gregoire



---------- Forwarded message ----------
From: Ranjib Dey < "> >
To:  ">
Cc: 
Date: Thu, 22 Aug 2013 07:58:11 -0700
Subject: [chef] Re: Re: Re: pre-update notifications
Chef does not provide anything like before resource update notification. you have post update even handler hooks and standard notification/subscription via dsl.might be able to get close to what you want by doing a why_run first and then dynamically changing the action of notified resource, but this wont be very straightforward, also you have to ensure the why_run implementations are correct.


On Thu, Aug 22, 2013 at 7:52 AM, Grégoire Seux < " target="_blank"> > wrote:
Le 22/08/2013 16:17, Andrew Gross a écrit :


execute "Update Cassandra" do
  notifies :run, execute[Downtime Cassandra Host],
end

execute "Downtime Cassandra Host" do
  action :nothing
  notifies :restart, service[Cassandra],
end

service "Cassandra" do
  action :nothing
end
Hi Andrew,

thanks for your reply.
This issue with your solution is that it assumes that you can update the package and then decide to restart the service.
In my case, the package contains triggers to update restart the service (stop it as pre-install and start as post-install hook). This pattern is quite commom I guess on rhel and debian systems.

So in your example you would have updated the package (thus restart the service), downtimed the host and restart the service once more.

--
Gregoire



---------- Forwarded message ----------
From: Daniel DeLeo < "> >
To:  ">
Cc: 
Date: Thu, 22 Aug 2013 08:02:58 -0700
Subject: [chef] Re: Re: how to know if a chef-client run is occuring

On Wednesday, August 21, 2013 at 5:45 PM, Michael Hart wrote:

Thanks Daniel, the feature in Enterprise Chef sounds interesting. Do you know the timeline for this feature's release in Enterprise Chef?

cheers
mike
We're looking at a release some time in Q4 this year. The core code is there, but we have a lot of performance and other testing to do before we ship it to everyone.


-- 
Daniel DeLeo



---------- Forwarded message ----------
From: Daniel DeLeo < "> >
To:  ">
Cc: 
Date: Thu, 22 Aug 2013 08:06:19 -0700
Subject: [chef] Re: pre-update notifications

On Thursday, August 22, 2013 at 5:31 AM, Gregoire Seux wrote:

Hello,

I'd like to have pre-update notifications which would be the same as
"notifies" but triggered before resource convergence.

For instance, some packages automatically restart a service during
upgrade and I'd like to downtime the host in supervision _before_
actually starting to upgrade those packages.

Classic notifications would be :

package "cassandra" do
notifies :run, "execute[downtime host]"
end

but notification is triggered _after_ the upgrade so it is not useful
anymore.

I wondered how to do this and came up with a partial solution switching
to why_run temporarily to find wether a given resource (package) will
be updated during convergence.
which would execute the resource to downtime only if the package will be
upgrade later.

Does anyone has already encountered such need? and fixed it?

--
Grégoire
Your problem here is that Chef resources are declarative, i.e., they say what the state of the system should be, but in this case you're trying to control the way the system transitions from one state (old packages) to another (up-to-date packages). The best way to accomplish this is to write a LWRP that checks if a new package is available and shuts the service down before upgrading.


-- 
Daniel DeLeo



---------- Forwarded message ----------
From: Daniel DeLeo < "> >
To:  ">
Cc: 
Date: Thu, 22 Aug 2013 09:22:35 -0700
Subject: [chef] Re: Re: Re: Omnibus/windows

On Wednesday, August 21, 2013 at 11:59 PM, Anton Baranov wrote:

I didn't work with omnibus and zlib.

--------------------------
With best regards, Anton Baranov.

четверг, 22 августа 2013 г. в 5:57, Michael Hayes написал:

Any hints on getting zlib to compile?
For the Windows omnibus packages, we cheat and use the Ruby DevKit packages for windows. I'm not familiar with the project, so I don't have any pointers on where to look, but you may be able to find what you need by browsing the source:



-- 
Daniel DeLeo



---------- Forwarded message ----------
From: Daniel DeLeo < "> >
To:  ">
Cc: 
Date: Thu, 22 Aug 2013 09:24:47 -0700
Subject: [chef] Re: 11.6.0 on Solaris and line feeds in files rendered from templates

On Wednesday, August 21, 2013 at 8:58 PM, " target="_blank"> wrote:

I tried using chef.11.6.0-1.solaris2.5.10.i386.solaris on Solaris 10 today, but
I found that when a template source file containing line feeds such as the
following:

domain <%= @domain %>^M
search <% @search_domains.each do |search_domain| -%><%= search_domain %> <%
end -%>^M
<% @nameservers.each do |nameserver| -%>^M
nameserver <%= nameserver %>^M
<% end -%>^M

The rendered file also has the line feeds:

domain xyz.com^M
search xyz.com ^M
nameserver 10.nnn.nn.nn^M

Such garbage in the rendered files causes the resolver to fail.

With 11.4, the rendered file is free of the line feeds and the resolver works
as expected.

Has anyone noticed this issue with 11.6 in general and/or specifically on
Solaris?

Is there a workaround? Or perhaps this is a case of garbage in and garbage
out? i.e. the behavior in 11.4 is masking the need for us to ensure that the
template files don't have this style of new line?
This is intentional. 11.4 and earlier would always convert Windows-style newlines to Unix-style ones. You should take care to ensure that your templates have the correct line endings for the target systems you're installing on.

-- 
Daniel DeLeo



---------- Forwarded message ----------
From: Anton Baranov < "> >
To:  ">
Cc: 
Date: Fri, 23 Aug 2013 02:05:32 +0900
Subject: [chef] Re: Re: Re: Re: Omnibus/windows
Yes, of course, we need to install dependencies before running omnibus for windows.

I found, that dependencies include these packages:

These dependencies doesn't describe on official omnibus-ruby page, but without them omnibus doesn't work.

--------------------------
With best regards, Anton Baranov.

пятница, 23 августа 2013 г. в 1:22, Daniel DeLeo написал:


On Wednesday, August 21, 2013 at 11:59 PM, Anton Baranov wrote:

I didn't work with omnibus and zlib.

--------------------------
With best regards, Anton Baranov.

четверг, 22 августа 2013 г. в 5:57, Michael Hayes написал:

Any hints on getting zlib to compile?
For the Windows omnibus packages, we cheat and use the Ruby DevKit packages for windows. I'm not familiar with the project, so I don't have any pointers on where to look, but you may be able to find what you need by browsing the source:



-- 
Daniel DeLeo




---------- Forwarded message ----------
From: "Grégoire Seux" < "> >
To: < "> >
Cc: 
Date: Thu, 22 Aug 2013 19:28:32 +0200
Subject: [chef] Re: Re: pre-update notifications
Le 22/08/2013 17:06, Daniel DeLeo a écrit :
Your problem here is that Chef resources are declarative, i.e., they say what the state of the system should be, but in this case you're trying to control the way the system transitions from one state (old packages) to another (up-to-date packages). The best way to accomplish this is to write a LWRP that checks if a new package is available and shuts the service down before upgrading.

I agree with you that I want to go further than simply declare resources. Allowing notifications and subscription is already a step in that direction.

I have wrapped the logic in a lwrp (https://gist.github.com/kamaradclimber/6306398) it gives a not so complicated way to declare prehooks

--
Gregoire


---------- Forwarded message ----------
From: Seth Falcon < "> >
To: < "> >
Cc: 
Date: Thu, 22 Aug 2013 10:43:40 -0700
Subject: [chef] Re: Confused by range search

"> writes:
> Maybe I'm expecting too much, but this is slightly confusing:
>
> $ knife search 'ipaddress:[172.26.133.95 TO 172.26.133.99]'|grep IP|sort
> IP:          172.26.133.95
> IP:          172.26.133.96
> IP:          172.26.133.97
> IP:          172.26.133.98
> IP:          172.26.133.99
>
> $ knife search 'ipaddress:[172.26.133.95 TO 172.26.133.105]'
> 0 items found
>
> Seems like I have to match the number of digits for the range query to work:
>
> $ knife search 'ipaddress:[172.26.133.100 TO 172.26.133.105]'|grep IP|sort
> IP:          172.26.133.100
> IP:          172.26.133.101
> IP:          172.26.133.102
> IP:          172.26.133.103
> IP:          172.26.133.104
> IP:          172.26.133.105
>
> Is this WAD?

The sorting in range queries is done lexicographically so the problem
you are seeing is that, as text, 95 > 105.

So this is "expected", but understandably confusing/surprising since
*we* know those are IP addresses and how to sort them :)

+ seth



--
Seth Falcon | Development Lead | Opscode | @sfalcon



---------- Forwarded message ----------
From: Jesse Nelson < "> >
To:  ">
Cc: 
Date: Thu, 22 Aug 2013 11:12:28 -0700
Subject: [chef] Re: Re: 11.6.0 on Solaris and line feeds in files rendered from templates
could be a new file meta parameter: 
   auto_newline false
:D 

Who likes to deal with CRLF issues.. 




On Wednesday, August 21, 2013 at 8:58 PM, " target="_blank"> wrote:

I tried using chef.11.6.0-1.solaris2.5.10.i386.solaris on Solaris 10 today, but
I found that when a template source file containing line feeds such as the
following:

domain <%= @domain %>^M
search <% @search_domains.each do |search_domain| -%><%= search_domain %> <%
end -%>^M
<% @nameservers.each do |nameserver| -%>^M
nameserver <%= nameserver %>^M
<% end -%>^M

The rendered file also has the line feeds:

domain xyz.com^M
search xyz.com ^M
nameserver 10.nnn.nn.nn^M

Such garbage in the rendered files causes the resolver to fail.

With 11.4, the rendered file is free of the line feeds and the resolver works
as expected.

Has anyone noticed this issue with 11.6 in general and/or specifically on
Solaris?

Is there a workaround? Or perhaps this is a case of garbage in and garbage
out? i.e. the behavior in 11.4 is masking the need for us to ensure that the
template files don't have this style of new line?
This is intentional. 11.4 and earlier would always convert Windows-style newlines to Unix-style ones. You should take care to ensure that your templates have the correct line endings for the target systems you're installing on.

-- 
Daniel DeLeo



End of digest for list chef - Thu, 22 Aug 2013




--
Cofounder, Mixpanel
360.909.5389


  • [chef] Re: Digest for list chef (3/3), Tim Trefren, 08/23/2013

Archive powered by MHonArc 2.6.16.

§