Chef: use attributes from specific resource in generic resource
up vote
0
down vote
favorite
I have a cookbook that installs several RPM packages through the use of the package
Chef resource:
%w(
nfs-utils
autofs
# etc.
# etc.
# etc.
).each do |pkg|
package pkg
I often have problems downloading the files from the server due to network glitches. I see that the packages are compiled as yum_package
s:
Resource Declaration:
---------------------
# In /downloads/chef/cache/cookbooks/my_cookbook/recipes/default.rb
65: package pkg
66:
Compiled Resource:
------------------
# Declared in /downloads/chef/cache/cookbooks/my_cookbook/recipes/default.rb:65:in `block in from_file'
yum_package("nfs-utils") do
package_name "nfs-utils"
action [:install]
retries 0
retry_delay 2
default_guard_interpreter :default
declared_type :package
cookbook_name "my_cookbook"
recipe_name "default"
flush_cache {:before=>false, :after=>false}
end
Platform:
---------
x86_64-linux
I would like to use the retries
option which is available with yum_package
, but not available through the generic package
resource. Is that possible? (I can't change from package
to yum_package
explicitly, though).
chef
add a comment |
up vote
0
down vote
favorite
I have a cookbook that installs several RPM packages through the use of the package
Chef resource:
%w(
nfs-utils
autofs
# etc.
# etc.
# etc.
).each do |pkg|
package pkg
I often have problems downloading the files from the server due to network glitches. I see that the packages are compiled as yum_package
s:
Resource Declaration:
---------------------
# In /downloads/chef/cache/cookbooks/my_cookbook/recipes/default.rb
65: package pkg
66:
Compiled Resource:
------------------
# Declared in /downloads/chef/cache/cookbooks/my_cookbook/recipes/default.rb:65:in `block in from_file'
yum_package("nfs-utils") do
package_name "nfs-utils"
action [:install]
retries 0
retry_delay 2
default_guard_interpreter :default
declared_type :package
cookbook_name "my_cookbook"
recipe_name "default"
flush_cache {:before=>false, :after=>false}
end
Platform:
---------
x86_64-linux
I would like to use the retries
option which is available with yum_package
, but not available through the generic package
resource. Is that possible? (I can't change from package
to yum_package
explicitly, though).
chef
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have a cookbook that installs several RPM packages through the use of the package
Chef resource:
%w(
nfs-utils
autofs
# etc.
# etc.
# etc.
).each do |pkg|
package pkg
I often have problems downloading the files from the server due to network glitches. I see that the packages are compiled as yum_package
s:
Resource Declaration:
---------------------
# In /downloads/chef/cache/cookbooks/my_cookbook/recipes/default.rb
65: package pkg
66:
Compiled Resource:
------------------
# Declared in /downloads/chef/cache/cookbooks/my_cookbook/recipes/default.rb:65:in `block in from_file'
yum_package("nfs-utils") do
package_name "nfs-utils"
action [:install]
retries 0
retry_delay 2
default_guard_interpreter :default
declared_type :package
cookbook_name "my_cookbook"
recipe_name "default"
flush_cache {:before=>false, :after=>false}
end
Platform:
---------
x86_64-linux
I would like to use the retries
option which is available with yum_package
, but not available through the generic package
resource. Is that possible? (I can't change from package
to yum_package
explicitly, though).
chef
I have a cookbook that installs several RPM packages through the use of the package
Chef resource:
%w(
nfs-utils
autofs
# etc.
# etc.
# etc.
).each do |pkg|
package pkg
I often have problems downloading the files from the server due to network glitches. I see that the packages are compiled as yum_package
s:
Resource Declaration:
---------------------
# In /downloads/chef/cache/cookbooks/my_cookbook/recipes/default.rb
65: package pkg
66:
Compiled Resource:
------------------
# Declared in /downloads/chef/cache/cookbooks/my_cookbook/recipes/default.rb:65:in `block in from_file'
yum_package("nfs-utils") do
package_name "nfs-utils"
action [:install]
retries 0
retry_delay 2
default_guard_interpreter :default
declared_type :package
cookbook_name "my_cookbook"
recipe_name "default"
flush_cache {:before=>false, :after=>false}
end
Platform:
---------
x86_64-linux
I would like to use the retries
option which is available with yum_package
, but not available through the generic package
resource. Is that possible? (I can't change from package
to yum_package
explicitly, though).
chef
chef
asked Nov 7 at 20:31
Phil
414719
414719
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53197365%2fchef-use-attributes-from-specific-resource-in-generic-resource%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown