Properties
The windows_update_settings resource has the following properties:
-
add_to_target_wsus_group
Ruby Type: true, false | Default Value: false
If you have a WSUS Server and Target Groups, set this True
-
automatically_install_minor_updates
Ruby Type: true, false | Default Value: false
Automatically install minor updates. Default is False
-
custom_detection_frequency
Ruby Type: Integer | Default Value: 22
If you decide to override the OS default detection frequency, specify your choice here. Valid choices are 0 - 22
-
disable_os_upgrades
Ruby Type: true, false | Default Value: false
True/False to disable OS upgrades.
-
enable_detection_frequency
Ruby Type: true, false | Default Value: false
Used to override the OS default of how often to check for updates
Common Properties🌐
Every chef resources shares the following characteristics:
-
compile_time
Ruby Type: true, false | Default Value: false
Control the stage of the node's resource execution. Run while the resource collection is being constructed by setting the value to true (the compile phase). Run when the Chef Infra Client configures the node by setting false (the converge phase).
-
ignore_failure
Ruby Type: true, false, :quiet | Default Value: false
If a resource fails, the recipe will still be executed. Quiet won't show the complete stack trace if a resource fails.
-
retries
Ruby Type: Integer | Default Value: 0
The number of times the resource will be tried once any exceptions are caught.
-
retry_delay
Ruby Type: Integer | Default Value: 2
seconds that pass between retry attempts.
-
sensitive
Ruby Type: true, false | Default Value: false
Make sure that Chef Infra Client does not record critical resource information.
Notifications🎯
notifies
Ruby Type: Symbol, 'Chef::Resource[String]'
When one resource's state changes, it may alert another resource to take appropriate action. Name the resource, specify the activity it should perform, and then set a timer for that action. When notifying multiple resources, use a notifies statement for each resource that needs to be informed.
An error is triggered if the referenced resource is missing. In contrast, if the source resource cannot be located, it will not fail.
When a notification is run during a Chef Infra Client run is determined by a timer. There are the upcoming timings available:
-
: before
Specifies that the action on a resource that has received a notification should be executed before processing the resource block that contains the notification.
-
: delayed
Default. Specifies that execution of notification should be queued up for execution after a run of the Chef Infra Client.
-
:immediate, :immediately
Specifies that for each resource informed, a notification should be run right away.
Guards💯
During the execution stage of a Chef Infra Client run, the condition of a node can be assessed using a guard property. A guard property is then used to inform Chef Infra Client whether it should keep running a resource in response to the findings of this assessment. Both a Ruby block value and a string value are acceptable values for a guard property:
-
A string is used to run a command in the shell. The guard is applied if the command returns 0. The guard property is not used if the command returns any other value. In a PowerShell script, string guards can return true in addition to 0 and launch Windows PowerShell commands.
-
The Ruby code that executes a block must return either true or false. The guard property is used if the block returns true. The guard attribute is not used if the block returns false.
By allowing a chef resource to check for the desired state as it is being performed and then do nothing if the required state is present, a guard property helps guarantee that a resource is idempotent.
Properties
Every chef resources shares the following characteristics: A guard may be defined using the chef resources following properties to be assessed during the execution phase of a Chef Infra Client run:
-
not_if
When the condition returns true, don't let a resource run.
-
only_if
Only permit the use of a resource if the condition returns true.
Frequently Asked Questions❓
What are the resources in chef?
Chef resources are an example of an operating system component in their ideal state. It is a declaration of configuration policy that explains the desired state of a node to be reached by resource providers using the existing configuration.
What are the attributes of a chef?
A node's attributes are detailed information about it. The chef-client uses attributes to comprehend: the node's current condition. What the node's condition was after the last chef-client execution?
What is chef software used for?
Chef is an open-source cloud deployment and configuration management tool. Anyone can use it to organize servers, whether they are in a departmental data center or the cloud.
What is a node in Chef?
A node is any machine—physical, virtual, cloud, network device, etc. —under Chef management.
How do you configure Windows Update Settings?
Select Start > Settings > Update & Security > Windows Update . Select either Pause updates for seven days or Advanced options. Then, in the Pause updates section, select the drop-down menu and specify a date for updates to resume.
Conclusion
Congratulations! You made it till here. In this article, we understood the Chef Resources-windows_update_settings Resource, its actions, properties, typical properties, notifications, and guards.
Refer to our guided paths on Coding Ninjas Studio to learn more about DSA, Competitive Programming, JavaScript, System Design, etc. And also, enroll in our courses and refer to the mock test and problems available. Have a look at the interview experiences and interview bundle for placement preparations. Nevertheless, you may consider our paid courses to give your career an edge over others!
Happy Coding!