Pull mode is associated with scalability and rich metadata capabilities: the target nodes do the configuration themselves, asynchronously, and the pull server can store metadata of each target node state in a central location. Push mode is more associated with simplicity and control: it doesn't require the installation of any specific software on the target nodes and the configuration is triggered at the user's request. There are many arguments for and against each mode. The Windows Powershell team published an article with a helper tool to make it easier to setup the pull server.Īlthough most tools support both modes, some, like Ansible, favor push while others, such as Puppet or Chef, favor pull. Pull mode is a bit more complex to setup: the pull server, a web site, needs to be configured and a LCM needs to be configured on each target node, via the Set-DscLocalConfigurationManager. When a new configuration is available, the Local Configuration Manager (LCM) - Powershell DSC's engine - downloads and applies it. It is a node's responsibility to poll a pull server to check for new configurations. Pull mode gives the initiative to the nodes themselves. Start-DscConfiguration -Wait -Verbose -Path. For instance, the following command applies the configuration on the current path to all the specified nodes inside the script: Push mode is triggered immediately by the execution of the Start-DscConfiguration cmdlet. To apply a configuration, PowerShell offers two modes: push and pull. SourcePath = "C:\SiteFiles" # This is a path that has web filesĭestinationPath = "C:\inetpub\wwwroot" # The path where we want to ensure the web files are present # This example ensures files from the source directory are present in the destination directoryĮnsure = "Present" # You can also set Ensure to "Absent" # File is a built-in resource you can use to manage files and directories # A Configuration block can have zero or more Node blocks The following example uses the File resource to state that on localhost the contents of C:\inetpub\wwwroot should be an exact replica of C:\SiteFiles: PowerShell DSC already has several built-in resources, but it is possible to create custom ones. DSC configurations are a declarative type of PowerShell script that configure instances of code and the resources to support this code in the proper (desired) state. Resources are building blocks that allow the configuration of items such as: users groups server roles or registry entries. Desired State Configuration (DSC) first appeared in Windows PowerShell 4.0. PowerShell DSC has the concept of resources. It is for the PowerShell DSC system to decide on how to do it. Instead of focusing on what steps are to be executed in order to configure a machine, a script that leverages DSC just states the intended configuration. This is a different approach from what PowerShell already allowed with an imperative style. One of the last articles explains how DSC allows both push and pull configuration modes.ĭesired State Configuration is an addition to the PowerShell tool which gives the possibility of declaring what is the desired configuration of a given node, or machine. DSC is the Microsoft's proposal for computer's configuration management on the Windows world. And please return the favor by sharing your thoughts on this blog or Chef combination with DSC in general.The Windows PowerShell Blog has been writing about PowerShell's Desired State Configuration (DSC). This proved to be a very interesting excercise since it gave me valuable insight into the possibilities and differences of how Chef interacts with DSC, and how I seem to have a problem with the ‘code’ attribute of ‘dsc_script’.īy writing this blog I hope to help others gain insight into Chef and DSC as well. Building an Active Directory (domain controller) using this new combination of technologies drew my specific attention. One of these technologies which Chef is adopting is PowerShell Desired State Configuration (DSC). For this reason I keep a close look on developments of Chef on MS Windows technologies. In my daily work I use Chef for managing MS Windows infrastructures. Thanks to Bob and the whole Schuberg Philis team for helping make Chef and the Chef community great! The full post, with lots of awesome tips and code examples for using Chef with DSC, can be found here. This entry digs into using Chef with Microsoft Powershell DSC and comes from Chef contributor and Schuberg Philis engineer Bob van den Heuvel. This is an excerpt from a recent posting on the Cupfighter blog, authored by the team at Schuberg Philis.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |