Ansible Galaxy and Prebuilt Playbooks Updated on August 22, 2023 by InMotion Hosting Contributor 1 Minutes, 24 Seconds to Read Rather than create our roles from scratch, we’ll use community submitted roles from Ansible Galaxy for use in our playbook. You can think of Ansible Galaxy as a community repository for Ansible Roles. As any person or team is able to contribute, it is important to use curated playbooks that are well-tested. This ensures that you choose one that is maintained and has a good rating among users. What do I need to get started? Installing Roles from Ansible Galaxy Ad-hoc Using a Requirements file Roles from Ansible Galaxy What do I need to get started with Ansible Galaxy? Only thing you need to get started using Ansible Galaxy is a machine with Ansible installed (referred to as a Control Node). You can learn more about how to install Ansible manually or simply use InMotion’s Ansible Control Node. Our Ansible Control Node comes free with our Cloud VPS Hosting. Installing Roles from Ansible Galaxy Using the ansible-galaxy command you can install roles ad-hoc or use a requirements file to install multiple roles at once. Here are some examples of that using InMotion Hosting’s curated modular Ansible roles. Ad-hoc: $ ansible-galaxy install \ inmotionhosting.apache inmotionhosting.mysql inmotionhosting.php_fpm Using a Requirements file: In your requirements.yml : --- - src: inmotionhosting.apache - src: inmotionhosting.mysql - src: inmotionhosting.php_fpm Then simply run: $ ansible-galaxy install -r requirements.yml Using Roles from Ansible Galaxy Using the roles we installed earlier, let’s incorporate them into a playbook: # site.yml - name: Deploy a LAMP stack hosts: lamp roles: - role: inmotionhosting.apache - role: inmotionhosting.mysql - role: inmotionhosting.php_fpm Learn more about how to create an Ansible Playbook. Share this Article IC InMotion Hosting Contributor Content Writer InMotion Hosting contributors are highly knowledgeable individuals who create relevant content on new trends and troubleshooting techniques to help you achieve your online goals! More Articles by InMotion Hosting Related Articles Ansible and Docker What is Ansible? Ansible vs Terraform Getting Started with Ansible How to Install Ansible on a Linux Server WordPress UltraStack Ansible Playbook Tutorial Using Git to Manage your Workflow Ansible Galaxy and Prebuilt Playbooks Accessing your Ansible Control Node How to Backup Ansible