By Erika Heidi
Developer Advocate
Ansible is a modern configuration management tool that doesn’t require the use of an agent software on remote nodes. Instead, it uses only SSH and Python to communicate and execute commands on managed servers.
Ansible allows users to manage servers in two different ways: via ad hoc commands, and via playbooks. Playbooks are YAML files containing a list of ordered tasks that should be executed on a remote server to complete a task or reach a certain goal, such as to set up a LEMP environment. Ansible playbooks allow you to fully automate server setup and application deployment, using an accessible syntax and an extensive library of built-in resources.
This series will walk you through some of Ansible’s main features which you can use to write playbooks for server automation. At the end, you’ll create a playbook to automate setting up a remote Nginx web server and deploy a static HTML website to it. The playbook examples used in this series can be found in our ansible-practice repository at the DigitalOcean Community organization on GitHub.
In order to follow along with the practical examples in this series, you’ll need:
ufw
and enable external access to your non-root user profile, both of which will help keep the remote server secure.authorized_keys
of a system user. This user can be either root or a regular user with sudo
privileges. To set this up, you can follow Step 2 of How to Set Up SSH Keys on Ubuntu 20.04.Once you have met these prerequisites, run a connection test as outlined in our guide on How To Manage Multiple Servers with Ansible Ad Hoc Commands to make sure you’re able to connect and execute Ansible instructions on your remote nodes.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.