How to doing polling in a recipe


#1

Currently remote_file resource keeps getting the following error:

Error connecting to
http://SOMEURL/yum/5/x86_64/omakase-release-5-2.noarch.rpm -
Connection timed out - connect(2)

Basically the network configuration is not ready when the recipe got
triggered.
I would hope there is a resource I can use to wait and poll the status.

Is there a way to fix this?


#2

On 10/15/12 2:27 PM, xyuan@mspot.com wrote:

Currently remote_file resource keeps getting the following error:

Error connecting to
http://SOMEURL/yum/5/x86_64/omakase-release-5-2.noarch.rpm -
Connection timed out - connect(2)

Basically the network configuration is not ready when the recipe got
triggered.
I would hope there is a resource I can use to wait and poll the status.

Is there a way to fix this?

You could use the “retries” and “retry_delay” common attributes for this
purpose:
http://wiki.opscode.com/display/chef/Resources#Resources-CommonAttributes

Just include retries or both attributes (if you want to control delay
between tries) as attributes in your remote_file resource.


#3

On 10/15/12 2:27 PM, xyuan@mspot.com wrote:

Currently remote_file resource keeps getting the following error:

Error connecting to
http://SOMEURL/yum/5/x86_64/omakase-release-5-2.noarch.rpm -
Connection timed out - connect(2)

Basically the network configuration is not ready when the recipe got
triggered.
I would hope there is a resource I can use to wait and poll the status.

Is there a way to fix this?

You could use the “retries” and “retry_delay” common attributes for this
purpose:
http://wiki.opscode.com/display/chef/Resources#Resources-CommonAttributes

Just include retries or both attributes (if you want to control delay
between tries) as attributes in your remote_file resource.