In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly shows you "how to use ansible+powershell DSC to manage windows server", the content is easy to understand, clear, hope to help you solve doubts, the following let the editor lead you to study and learn "how to use ansible+powershell DSC to manage windows server" this article.
What is DSC?
So what is the ideal state configuration? It is basically a system configuration management platform that uses a declarative model; in other words, you tell DSC "what" and it will find "how". Just like Ansible, DSC uses push mode execution to send the configuration to the target host. This is important when delivering resources to multiple targets.
This time-saving tool is built into PowerShell to define Windows node settings through code. It uses LocalConfigurationManager (which is the DSC execution engine running on each node).
Microsoft encourages the community to work hard to build and maintain DSC resources for various technologies. The results of these efforts are used as DSC resource kits every month. If the technology you need to manage does not have a local Ansible module available, you may have DSC resources.
How do you use DSC and Ansible?
DSC resources are distributed as PowerShell modules, which means that it works like Ansible, but is implemented differently. This, this, that, that win_dsc module has been available since the release of Ansible 2.4, and whenever it interacts with a Windows host, it affects existing DSC resources.
To use this module, you will need PowerShell version 5.1 or later. Once you have ensured that the correct version of PowerShell is installed on the Windows node, using DSC is like using the win_dsc module.
Let's see what it does. For this example, we will ensure that the DNS server is installed, that the xDnsServerDSC resource module exists, and use several DSC resources under it to define the zone and A record:
-hosts: Erasmus tasks:-win_feature: name:-DNS- RSAT-DNS-Server state: present-win_psmodule: name: xDnsServer repository: PSGallery-win_dsc: resource_name: xDnsServerPrimaryZone Name: my-arbre.com-win_dsc: resource_name: xDnsRecord Name: test Zone: my-arbre.com Target: 192.168.17.75 Type: ARecord
Let's introduce what happened in the above script: it starts with installing the DNS server on the target, and then installs the DSC resource module on xDnsServer. Use the DSC resource now installed, the xDnsServerPrimaryZone resource, to create the zone, and then call xDnsRecord to invoke the resource with parameters to populate our zone details. My-arbre.com live. This, this, that, that xDnsServer resource can be downloaded from PowerShellGallery.com, which provides a reliable community for DSC resources.
Remember that the win_dsc module is designed to drive a single DSC resource provider to make it work like an unacceptable module. It is not intended to be used to define the DSC equivalent of the game manual on the console and run it.
There are a few more points to remember:
When resource_name defines a task, it must be set to the name of the DSC resource that is already installed on the target.
Matching cases to documents is a best practice; it also makes it easier to distinguish between DSC resource options and Ansible resource options. Win_dsc a variety of options.
The above is all the contents of the article "how to use ansible+powershell DSC to manage windows server". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.