Questions tagged [lwrp]

An LWRP is a part of a cookbook that is used to extend the chef-client in a way that allows custom actions to be defined, and then used in recipes in much the same way as any platform resource.

An LWRP is a part of a cookbook that is used to extend the chef-client in a way that allows custom actions to be defined, and then used in recipes in much the same way as any platform resource. A LWRP has two principal components:

  • A lightweight resource that defines a set of actions and attributes
  • A lightweight provider that tells the chef-client how to handle each action, what to do if certain conditions are met, and so on In addition, most lightweight providers are built using platform resources and some lightweight providers are built using custom Ruby code

Once created, a LWRP becomes a Ruby class within the organization. During each chef-client run, the chef-client will read the lightweight resources from recipes and process them alongside all of the other resources. When it is time to configure the node, the chef-client will use the corresponding lightweight provider to determine the steps required to bring the system into the desired state.

Where the lightweight resource represents a piece of the system, its current state, and the action that is needed to move it to the desired state, a lightweight provider defines the steps that are required to bring that piece of the system from its current state to the desired state. A LWRP behaves similar to platform resources and providers:

  • A lightweight resource is a key part of a recipe
  • A lightweight resource defines the actions that can be taken
  • During a chef-client run, each lightweight resource is identified, and then associated with a lightweight provider
  • A lightweight provider does the work to complete the action requested by the lightweight resource

You can read more about how to build custom lightweight resources on the Chef docs.

73 questions
1
vote
2 answers

Chef LWRP "undefined method 'checkname' for nil:NilClass"

I'm trying to write an LWRP for a Chef cookbook and I'm running into a strange issue where this property seems to be perfectly valid on one line, and the nil the next. From the provider code, error on the source line: def create_check …
Sammitch
  • 30,782
  • 7
  • 50
  • 77
1
vote
1 answer

Iterating over an array attribute in Chef

I am using Chef provisioning to create machines in AWS. When creating the machine, I add an attribute to it that is an array of JSON files. In the recipes I run, I want to iterate over this array and create a template file on the machine. The…
streetsoldier
  • 1,259
  • 1
  • 14
  • 32
1
vote
1 answer

How do you use a LWRP with chef?

I'm new to chef, and I'm trying to setup a wrapper cookbook to manage logstash. The cookbook I am wrapping uses LWRP. How do you manage a config file using a LWRP? Here is the wrapper cookbook that I have so far recipes/default.rb include_recipe…
spuder
  • 17,437
  • 19
  • 87
  • 153
1
vote
1 answer

Where yum_repository resource is defined?

Probably this would be an easier one for the experts. I’m learning to write custom LWRP and hence trying to understand the one that is already written.. the yum cookbook. It can be found here: http://community.opscode.com/cookbooks/yum Question: In…
slayedbylucifer
  • 22,878
  • 16
  • 94
  • 123
1
vote
1 answer

use lwrp with chef-solo

I'm using chef-solo with librarian-chef to manage my servers. Here's the structure I have locally: Cheffile Cheffile.lock cookbooks data_bags Gemfile Gemfile.lock .git .gitignore nodes README.md roles tmp Each node from the nodes/ dir has a role…
savamane
  • 148
  • 1
  • 7
1
vote
1 answer

Chef: Nested LWRP issue with cookbook_file/template resources

I wrote a couple of LWRP cookbooks to install and manage some services (Monit and Omnicheck). One of the functions they provide is for you to supply a file that will be used with the template or cookbook_file resources. I found that when I call…
gnat
  • 11
  • 1
1
vote
0 answers

How can you access Chef LWRP attributes in a recipe

With some of the default chef resources, it is possible to access some of their attributes after they have been called # recipes/default.rb f = file "/tmp/file_resource" do owner "root" group "root" mode "0755" action :create end log "Path…
Pete Mitchell
  • 2,879
  • 1
  • 16
  • 22
1
vote
1 answer

Using git resource in a Chef LWRP

I'm attempting to use an LWRP (with Chef 10) to create my own deployment resource, but it's throwing an error and I haven't been able to find any examples in the docs. My resource file looks like this: actions :install attribute :package_name,…
Josh Hancock
  • 795
  • 10
  • 15
1
vote
1 answer

When I create a LWRP why is nil my global resource into the Chef resource context

The creation of a custom LWRP are reporting that the resource is nil into the Chef's resource context . This was my first step? action :install do converge_by "Installing postgresql-#{@new_resource.version}" do execute "sudo apt-get…
Robert
  • 10,403
  • 14
  • 67
  • 117
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

Disable Unity Debug Canvas

For about an hour ago a Debug Canvas started Instantiating on Play. I've searched around on the internet but can't seem to find anything. Are there by any chance some of you who might know how to disable it as it's taking up about half of the…
Bugge
  • 15
  • 7
0
votes
0 answers

Why is LWRP/URP not rendering anything after migrating to Unity 2019.4.x?

I got a problem I'm struggling with for quite some time. I have a project (Mixed Reality Toolkit based app targeted for HoloLens) and in the process of migrating the project to suit HoloLens 2, I upgraded the Unity version from 2019.1.f1 to…
0
votes
0 answers

Unity: can't get Post-Processing Stack v2 effects to work with LWRP

I'm trying to set up some post processing effects for my scene in Unity 2019.1.1. I'm currently using LWRP v5.7.2 and Post Processing v2.1.7 I created a PostProcessing Profile and I attached a Post Processing Layer and Post Processing Volume to my…
N Dev
  • 3
  • 2
0
votes
1 answer

IOS AR Build using ARkit, ARfoundation and LWRP Render Meshes Partially

When I make my IOS build using ARFoundation, ARKit and LWRP then its render meshes partially in AR view. I am using Unity 2018.3.11f1 and LWRP 4.8.0. Any Help? Why meshes render partially? See what I tried
Vishal
  • 140
  • 1
  • 4
  • 13
0
votes
1 answer

Post-Processing effects not visible with LWRP in Unity3D

I'm are running into an issue when setting up Post-Processing effects for the new Lightweight render pipeline. Post-processing effects are visible in scene and Game view, but not through the camera when running the game. The project is using single…
alpha_rats
  • 128
  • 2
  • 10