{"id":54663,"date":"2020-04-01T09:55:25","date_gmt":"2020-04-01T14:55:25","guid":{"rendered":"https:\/\/www.inmotionhosting.com\/support\/?p=54663"},"modified":"2023-08-22T14:28:32","modified_gmt":"2023-08-22T18:28:32","slug":"getting-started-with-ansible-galaxy","status":"publish","type":"post","link":"https:\/\/www.inmotionhosting.com\/support\/edu\/ansible\/getting-started-with-ansible-galaxy\/","title":{"rendered":"Ansible Galaxy and Prebuilt Playbooks"},"content":{"rendered":"\n<p>Rather than create our roles from scratch, we\u2019ll use community submitted roles from <a href=\"https:\/\/www.inmotionhosting.com\/support\/edu\/ansible\/getting-started-with-ansible-galaxy\/\">Ansible Galaxy<\/a> 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<strong>.<\/strong> This ensures that you choose one that is maintained and has a good rating among users.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"#needs\">What do I need to get started?<\/a><\/li>\n\n\n\n<li><a href=\"#install\">Installing Roles from Ansible Galaxy<\/a>\n<ul class=\"wp-block-list\">\n<li><a href=\"#ad-hoc\">Ad-hoc<\/a><\/li>\n\n\n\n<li><a href=\"#requirements\">Using a Requirements file<\/a><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><a href=\"#roles\">Roles from Ansible Galaxy<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"needs\">What do I need to get started with Ansible Galaxy?<\/h2>\n\n\n\n<p>Only thing you need to get started using Ansible Galaxy is a machine with <a href=\"https:\/\/www.inmotionhosting.com\/ansible\">Ansible<\/a> installed (referred to as a <strong>Control Node<\/strong>). You can learn more about <a href=\"https:\/\/www.inmotionhosting.com\/support\/edu\/ansible\/install-ansible\/\">how to install Ansible manually<\/a> or simply use InMotion&#8217;s <a href=\"https:\/\/www.inmotionhosting.com\/support\/edu\/ansible\/getting-started-ansible-control-node\/\">Ansible Control Node<\/a>.<\/p>\n\n\n\n<p class=\"alert alert-info\">Our Ansible Control Node comes free with our <a href=\"https:\/\/www.inmotionhosting.com\/cloud-vps\">Cloud VPS Hosting<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"install\">Installing Roles from Ansible Galaxy<\/h2>\n\n\n<p>Using the <span style=\"color: #ff0000;\">ansible-galaxy<\/span> command you can <a href=\"https:\/\/www.inmotionhosting.com\/support\/edu\/ansible\/install-ansible-galaxy-roles-and-collections\/\">install roles<\/a> ad-hoc or use a requirements file to install multiple roles at once. Here are some examples of that using InMotion Hosting\u2019s curated modular Ansible roles.<\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"ad-hoc\">Ad-hoc:<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>$ ansible-galaxy install \\\n      inmotionhosting.apache inmotionhosting.mysql inmotionhosting.php_fpm<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"requirements\">Using a Requirements file:<\/h3>\n\n\n<p>In your <span style=\"color: #ff0000;\">requirements.yml<\/span> :<\/p>\n\n\n<pre class=\"wp-block-code\"><code>---\n- src: inmotionhosting.apache\n- src: inmotionhosting.mysql\n- src: inmotionhosting.php_fpm<\/code><\/pre>\n\n\n\n<p>Then simply run:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ ansible-galaxy install -r requirements.yml<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"roles\">Using Roles from Ansible Galaxy<\/h2>\n\n\n\n<p>Using the roles we installed earlier, let\u2019s incorporate them into a playbook:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># site.yml\n- name: Deploy a LAMP stack\n  hosts: lamp\n  roles:\n    - role: inmotionhosting.apache\n    - role: inmotionhosting.mysql\n    - role: inmotionhosting.php_fpm<\/code><\/pre>\n\n\n\n<p>Learn more about <a href=\"https:\/\/www.inmotionhosting.com\/support\/edu\/ansible\/getting-started-with-ansible-galaxy\/\">how to create an Ansible Playbook<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Rather than create our roles from scratch, we\u2019ll 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<a class=\"moretag\" href=\"https:\/\/www.inmotionhosting.com\/support\/edu\/ansible\/getting-started-with-ansible-galaxy\/\"> Read More ><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4349],"tags":[],"class_list":["post-54663","post","type-post","status-publish","format-standard","hentry","category-ansible"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Ansible Galaxy and Prebuilt Playbooks | InMotion Hosting<\/title>\n<meta name=\"description\" content=\"Learn about getting started with Ansible Galaxy. You will learn what&#039;s needed to install it, how to install roles and use the roles.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.inmotionhosting.com\/support\/edu\/ansible\/getting-started-with-ansible-galaxy\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Ansible Galaxy and Prebuilt Playbooks | InMotion Hosting\" \/>\n<meta property=\"og:description\" content=\"Learn about getting started with Ansible Galaxy. You will learn what&#039;s needed to install it, how to install roles and use the roles.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.inmotionhosting.com\/support\/edu\/ansible\/getting-started-with-ansible-galaxy\/\" \/>\n<meta property=\"og:site_name\" content=\"InMotion Hosting Support Center\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/inmotionhosting\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-04-01T14:55:25+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-08-22T18:28:32+00:00\" \/>\n<meta name=\"author\" content=\"InMotion Hosting Contributor\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/InMotionHosting\" \/>\n<meta name=\"twitter:site\" content=\"@InMotionHosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"InMotion Hosting Contributor\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/ansible\/getting-started-with-ansible-galaxy\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/ansible\/getting-started-with-ansible-galaxy\/\"},\"author\":{\"name\":\"InMotion Hosting Contributor\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/5fbfcaed32a2672fb83ab312f5b7237b\"},\"headline\":\"Ansible Galaxy and Prebuilt Playbooks\",\"datePublished\":\"2020-04-01T14:55:25+00:00\",\"dateModified\":\"2023-08-22T18:28:32+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/ansible\/getting-started-with-ansible-galaxy\/\"},\"wordCount\":234,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"articleSection\":[\"Ansible Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/edu\/ansible\/getting-started-with-ansible-galaxy\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/ansible\/getting-started-with-ansible-galaxy\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/ansible\/getting-started-with-ansible-galaxy\/\",\"name\":\"Ansible Galaxy and Prebuilt Playbooks | InMotion Hosting\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\"},\"datePublished\":\"2020-04-01T14:55:25+00:00\",\"dateModified\":\"2023-08-22T18:28:32+00:00\",\"description\":\"Learn about getting started with Ansible Galaxy. You will learn what's needed to install it, how to install roles and use the roles.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/ansible\/getting-started-with-ansible-galaxy\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/edu\/ansible\/getting-started-with-ansible-galaxy\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/ansible\/getting-started-with-ansible-galaxy\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.inmotionhosting.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Ansible Galaxy and Prebuilt Playbooks\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"name\":\"InMotion Hosting Support Center\",\"description\":\"Web Hosting Support &amp; Tutorials\",\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\",\"name\":\"InMotion Hosting\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"contentUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"width\":696,\"height\":696,\"caption\":\"InMotion Hosting\"},\"image\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/inmotionhosting\/\",\"https:\/\/x.com\/InMotionHosting\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/5fbfcaed32a2672fb83ab312f5b7237b\",\"name\":\"InMotion Hosting Contributor\",\"description\":\"InMotion Hosting contributors are highly knowledgeable individuals who create relevant content on new trends and troubleshooting techniques to help you achieve your online goals!\",\"sameAs\":[\"https:\/\/www.linkedin.com\/company\/inmotion-hosting\/\",\"https:\/\/x.com\/https:\/\/twitter.com\/InMotionHosting\"],\"url\":\"https:\/\/www.inmotionhosting.com\/support\/author\/john-paul\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Ansible Galaxy and Prebuilt Playbooks | InMotion Hosting","description":"Learn about getting started with Ansible Galaxy. You will learn what's needed to install it, how to install roles and use the roles.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.inmotionhosting.com\/support\/edu\/ansible\/getting-started-with-ansible-galaxy\/","og_locale":"en_US","og_type":"article","og_title":"Ansible Galaxy and Prebuilt Playbooks | InMotion Hosting","og_description":"Learn about getting started with Ansible Galaxy. You will learn what's needed to install it, how to install roles and use the roles.","og_url":"https:\/\/www.inmotionhosting.com\/support\/edu\/ansible\/getting-started-with-ansible-galaxy\/","og_site_name":"InMotion Hosting Support Center","article_publisher":"https:\/\/www.facebook.com\/inmotionhosting\/","article_published_time":"2020-04-01T14:55:25+00:00","article_modified_time":"2023-08-22T18:28:32+00:00","author":"InMotion Hosting Contributor","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/InMotionHosting","twitter_site":"@InMotionHosting","twitter_misc":{"Written by":"InMotion Hosting Contributor","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/ansible\/getting-started-with-ansible-galaxy\/#article","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/ansible\/getting-started-with-ansible-galaxy\/"},"author":{"name":"InMotion Hosting Contributor","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/5fbfcaed32a2672fb83ab312f5b7237b"},"headline":"Ansible Galaxy and Prebuilt Playbooks","datePublished":"2020-04-01T14:55:25+00:00","dateModified":"2023-08-22T18:28:32+00:00","mainEntityOfPage":{"@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/ansible\/getting-started-with-ansible-galaxy\/"},"wordCount":234,"commentCount":0,"publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"articleSection":["Ansible Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.inmotionhosting.com\/support\/edu\/ansible\/getting-started-with-ansible-galaxy\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/ansible\/getting-started-with-ansible-galaxy\/","url":"https:\/\/www.inmotionhosting.com\/support\/edu\/ansible\/getting-started-with-ansible-galaxy\/","name":"Ansible Galaxy and Prebuilt Playbooks | InMotion Hosting","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#website"},"datePublished":"2020-04-01T14:55:25+00:00","dateModified":"2023-08-22T18:28:32+00:00","description":"Learn about getting started with Ansible Galaxy. You will learn what's needed to install it, how to install roles and use the roles.","breadcrumb":{"@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/ansible\/getting-started-with-ansible-galaxy\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.inmotionhosting.com\/support\/edu\/ansible\/getting-started-with-ansible-galaxy\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/ansible\/getting-started-with-ansible-galaxy\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.inmotionhosting.com\/support\/"},{"@type":"ListItem","position":2,"name":"Ansible Galaxy and Prebuilt Playbooks"}]},{"@type":"WebSite","@id":"https:\/\/www.inmotionhosting.com\/support\/#website","url":"https:\/\/www.inmotionhosting.com\/support\/","name":"InMotion Hosting Support Center","description":"Web Hosting Support &amp; Tutorials","publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.inmotionhosting.com\/support\/#organization","name":"InMotion Hosting","url":"https:\/\/www.inmotionhosting.com\/support\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/","url":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","contentUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","width":696,"height":696,"caption":"InMotion Hosting"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/inmotionhosting\/","https:\/\/x.com\/InMotionHosting"]},{"@type":"Person","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/5fbfcaed32a2672fb83ab312f5b7237b","name":"InMotion Hosting Contributor","description":"InMotion Hosting contributors are highly knowledgeable individuals who create relevant content on new trends and troubleshooting techniques to help you achieve your online goals!","sameAs":["https:\/\/www.linkedin.com\/company\/inmotion-hosting\/","https:\/\/x.com\/https:\/\/twitter.com\/InMotionHosting"],"url":"https:\/\/www.inmotionhosting.com\/support\/author\/john-paul\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"primary_category":{"id":4349,"name":"Ansible Tutorials","slug":"ansible","link":"https:\/\/www.inmotionhosting.com\/support\/edu\/ansible\/"},"_links":{"self":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/54663","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/comments?post=54663"}],"version-history":[{"count":8,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/54663\/revisions"}],"predecessor-version":[{"id":106209,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/54663\/revisions\/106209"}],"wp:attachment":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/media?parent=54663"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/categories?post=54663"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/tags?post=54663"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}