Questions tagged [chef-custom-resource]

8 questions
2
votes
2 answers

Using library functions in chef resources

I have created a chef cookbook "lcd_web_source" with the following directory structure. The content of my helpers.rb is shown below module Lcd_web_source module Helpers def platform_package_httpd case node['platform'] when 'centos' then…
thinkingmonster
  • 5,063
  • 8
  • 35
  • 57
2
votes
1 answer

How may I determine Java version from inside the Chef custom resource without passing it as a parameter?

I am creating a custom resource and would like to make it as self-contained as possible. I need to determine java version that is going to be available on the node so I will be able to setup JAVA_OPTS variable properly, depending on Java version. I…
Denuil
  • 35
  • 1
  • 4
0
votes
2 answers

Chef - Custom Resource - How to notify only if the content of the ressource updates a file?

I'm not sure if I've understood the concept of notifying other resources based on a custom resource correctly. I have a resource: get_api_calls 'www.myapi.com' do request '' target_path '/// notifies :reload,…
Pegasus1985
  • 126
  • 4
  • 11
0
votes
2 answers

cookbook : propagate list from node to fill template values

I have a list of veriables in node file in cookbook as "normal": { "Data_list": 'one, two, three, four', "tags": [ ] } based on this list i want to add values to template , below is the source fro same , but it seems instead of…
0
votes
2 answers

Is it possible to use a custom resource from some cookbook to create a custom resource in your own cookbook?

I have a cookbook let's say the name of my cookbook is check and I am trying to build a custom resource by having the file in the following directory structure : check/resources/myresource.rb. In this myresource.rb file I need to use a custom…
0
votes
1 answer

Customizing deploy key and ssh wrapper path for git cloning through application_git cookbook

I am using chef for managing servers. Earlier I was using application cookbook for cloning repository. But now in higher version of application cookbook, this support is moved to new cookbook application_git. I am using 1.1.0 Issue - I want to…
Arora20
  • 983
  • 10
  • 17
0
votes
1 answer

How to capture Chef::Util::FileEdit.new operation in why-run mode

I want to have a custom resource to edit a file like "crontab" resource does. Below is my custom resource which does the job but in 'why-run' mode it doesn't show what string it would add or remove. resource_name :super_tab provides…
Shiv
  • 3
  • 5
0
votes
1 answer

Chef Custom Resources : mutable property or an alternative

I read that as of 2016 OpsCode recommends against LWRP and the alternative HWRP. They rather recommend to use custom resources. While this makes sense it leaves a lot to be desired in terms of leveraging ruby (unless I've misunderstood?) I would…
Sam Hammamy
  • 10,819
  • 10
  • 56
  • 94