![]() Let’s first create a directory to house our playbooks with:Ĭreate the new playbook with the command:Ī quick rundown of the playbook looks like this: For example, you can create a playbook that copies a file, adds a new user, and updates all apt packages on your remote host. ![]() You create these playbooks which map out the states you want your remote hosts to be in. How to create and run a playbookĪt the heart of Ansible is the playbook. ![]() You should be presented with a listing of the root directory of the user associated with the SSH key you sent to the host, indicating all is well. Let’s run the ls command on our remote host. You should be prompted for your remote user password and, upon successfully pinging the remote host, Ansible will report back: To test if Ansible is working properly, issue the command (from the controller): That file will look like this:Īnsible_python_interpreter=/usr/bin/python3 We’ll list our remote host under with an IP address of 192.168.1.66. First, create a directory to house the files with: On your controller, you’ll need to create an inventory file, which contains all the necessary details of your remote hosts. Where NODE is the IP address of your remote hosts. Once the key is complete, you’ll need to copy it to your remote host with the command: If you haven’t already done so, create an SSH key on the controller with the command: Sudo apt-get install sshpass -y How to create an SSH key We’ll also need to install a second piece of software, called SSHpass, which is a non-interactive password provider - otherwise you’d have trouble with SSH authentication. The installation will pick up a large number of dependencies and will take anywhere from 2-10 minutes to complete. Oracle Linux checklist: What to do after installationīecause Ansible is found in the standard repositories, the installation is as simple as logging in to your controller node and issuing the command: This Linux learning path will help you start using the OS like a proītop is a much-improved take on the Linux top command Open-source repository SourceHut to remove all cryptocurrency-related projects You’ll also need a user with sudo privileges and an SSH key created on the controller. I’ll be demonstrating with two Ubuntu Server 22.04 instances. In order to get Ansible up and running, you’ll need at least two hosts: One to serve as a controller and one host used to test the setup. You’ll walk away from this surprised at how easy it can be. I want to walk you through the steps of getting Ansible up and running on Ubuntu Server 22.04 (Jammy Jellyfish). In other words, Ansible makes a task that could be incredibly challenging, simple enough that any admin regardless of skill level can take care of. SEE: 40+ open source and Linux terms you need to know (TechRepublic Premium) Instead, Ansible uses SSH to execute all tasks, and YAML files hold the definitions of the tasks to be run. One reason why I prefer Ansible over similar tools is that Ansible doesn’t require you to install clients on remote nodes. Instead of having to remote into each server to handle a task, you can take care of much of it from a single point of entry. Image: Song_about_summer/Adobe StockĪnsible makes it much easier for busy admins to manage a large collection of servers. Jack Wallen takes you through the process of installing the Ansible configuration management system on the latest release of Ubuntu Server. How to install Ansible on Ubuntu Server 22.04
0 Comments
Leave a Reply. |