win_file: Create or remove files and folders.win_domain_controller: Manage both domain controller and member server state for target hosts. Some of the most common built-in Windows Ansible modules include the following: Run the ansible-doc Ansible CLI command to see all the available built-in modules: ansible-doc -l | grep 'win' The Windows Ansible modules all have the prefix win_. When you install Ansible, you get a library of built-in modules each of which covers a particular product or technology. We'll work from the control node in your WSL prompt from now on. Now let's undertake some actual configuration management with Ansible. You'll want to run the commands below on both your control node and your management node. Enable PowerShell remotingĪnsible provides a PowerShell script that simplifies the WinRM listener configuration. This subject is too broad to be included in this introductory tutorial. These include encrypting the relevant files, using Ansible Vault, or a third-party secrets solution. Ansible presents a number of ways to protect sensitive information. NOTE: Obviously, you never want to expose passwords in plain text in any file. Here, we define variables that instruct Ansible to use WinRM as our transport and the built-in local Administrator account and password as connection credentials. : Variables operate in Ansible like they do in any programming language: reusable key:value pairs.It's optional, but a nice way to use a short alias name for a node (think of how many nonintuitive DNS names you use in your environment). ansible_host: This is an Ansible built-in variable that tells Ansible the DNS host name or IP address to use when communicating with that node.We put our controller node in a group called control and our managed node in a group called infra. Mem1 a lot going on in that INI-format inventory file. Next, add the following text to the file, save your work, and exit nano: Run these commands to create the file and open it in nano: sudo touch /etc/ansible/hosts We need to add dc1 and mem1 to our Ansible inventory file so that we can include these machines in our Ansible configuration management tasks. While we're on the subject, go ahead and open the config file with a text editor such as nano: sudo nano /etc/ansible/ansible.cfgĪdd the following text block to the top of the file: While this is the global location, you can override its values by specifying a configuration file in another path. Ansible stores all its configuration properties in this INI-format text file. Take special note of the location of the default Ansible configuration file: /etc/ansible/ansible.cfg. Verifying Ansible installation Edit the configuration file
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |