{"id":15644,"date":"2017-01-04T12:15:06","date_gmt":"2017-01-04T10:15:06","guid":{"rendered":"http:\/\/www.webcodegeeks.com\/?p=15644"},"modified":"2017-01-02T15:37:29","modified_gmt":"2017-01-02T13:37:29","slug":"packer-ansible-docker-part-2-using-ansible-galaxy","status":"publish","type":"post","link":"https:\/\/www.webcodegeeks.com\/devops\/packer-ansible-docker-part-2-using-ansible-galaxy\/","title":{"rendered":"Packer, Ansible and Docker Part 2: Using Ansible Galaxy"},"content":{"rendered":"<p><a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/blog.james-carr.org\/build-docker-images-with-packer-and-ansible-3f40b734ef4f#.ws6p3uejo\" target=\"_blank\" data-href=\"https:\/\/blog.james-carr.org\/build-docker-images-with-packer-and-ansible-3f40b734ef4f#.ws6p3uejo\">Previously<\/a> we setup packer, docker and ansible to build a very simple docker image that simply placed a file under <code class=\"markup--code markup--p-code\">\/root<\/code> with some content, a very simple start. Today we\u2019ll go further and explore using ansible roles and making some pieces a bit more dynamic.<\/p>\n<h2>A Real World\u00a0Example<\/h2>\n<p>In this tutorial, we\u2019ll build a docker image that has R<a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/redis.io\/\" target=\"_blank\" data-href=\"https:\/\/redis.io\/\">edis<\/a> installed. While we could go through the steps of adding an apt repository, installing and configuring Redis ourselves why not go strong and take advantage of the fact that someone else has already done this? Enter <code class=\"markup--code markup--p-code\"><a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/galaxy.ansible.com\/\" target=\"_blank\" data-href=\"https:\/\/galaxy.ansible.com\/\">ansible-galaxy<\/a><\/code>.<\/p>\n<h2>Using Ansible\u00a0Galaxy<\/h2>\n<p>Simply put, ansible galaxy is pretty much like any package manager for your favorite language like pip for python or npm for node. You can install packages stand-alone by running something like <code class=\"markup--code markup--p-code\">ansible-galaxy install geerlinguy.redis<\/code> or you can define a <a class=\"markup--anchor markup--p-anchor\" href=\"http:\/\/docs.ansible.com\/ansible\/galaxy.html#installing-multiple-roles-from-a-file\" target=\"_blank\" data-href=\"http:\/\/docs.ansible.com\/ansible\/galaxy.html#installing-multiple-roles-from-a-file\">requirements file<\/a> just like in python to specify multiple dependencies.<\/p>\n<h3>Finding the Right\u00a0Role<\/h3>\n<p>If we do a search we\u2019ll soon discover that there are 150 or so odd redis roles out there\u2026 which do we use? Usually we\u2019ll want to temper our choice to the one with the most downloads. A very quick method I use is to just google <code class=\"markup--code markup--p-code\">ansible-galaxy &lt;service&gt;<\/code> and run with the first result. Thankfully the search for <code class=\"markup--code markup--p-code\">ansible-galaxy redis<\/code> returns <code class=\"markup--code markup--p-code\"><a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/galaxy.ansible.com\/geerlingguy\/redis\/\" target=\"_blank\" data-href=\"https:\/\/galaxy.ansible.com\/geerlingguy\/redis\/\">geerlingguy.redis<\/a><\/code> which is by a guy I know puts out some pretty high quality roles. But if I didn\u2019t know that, the number of downloads are a good indicator!<br \/>\n<a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/01\/2017-01-02_15-13-37.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-15645\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/01\/2017-01-02_15-13-37.jpg\" alt=\"\" width=\"446\" height=\"65\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/01\/2017-01-02_15-13-37.jpg 446w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/01\/2017-01-02_15-13-37-300x44.jpg 300w\" sizes=\"(max-width: 446px) 100vw, 446px\" \/><\/a><\/p>\n<h3>Adding our Requirements File<\/h3>\n<p>Our <code class=\"markup--code markup--p-code\">requirements.yml<\/code> file is off to a simple start.<\/p>\n<pre class=\"brush:bash\">---\r\n- src: geerlingguy.redis\r\n  version: 1.1.5<\/pre>\n<p>While the <code class=\"markup--code markup--p-code\">ansible-local<\/code> provisioner lets you define a <code class=\"markup--code markup--p-code\">galaxy_file<\/code> and installs roles for you the <code class=\"markup--code markup--p-code\">ansible-remote<\/code> provisioner (which we\u2019re using) does not. So we\u2019ll need to install the roles and specify the directory in they\u2019ll be installed in. While <code class=\"markup--code markup--p-code\">roles<\/code> is typically a good directory name I prefer to store my galaxy related roles in a separate directory and leave <code class=\"markup--code markup--p-code\">roles<\/code> for my own roles (which we\u2019ll cover in a later blog post). For today, let\u2019s use <code class=\"markup--code markup--p-code\">galaxy<\/code>for roles installed from ansible-galaxy. You can specify the target path with the <code class=\"markup--code markup--p-code\">-p<\/code> option below.<\/p>\n<pre class=\"brush:bash\">$ ansible-galaxy install -p galaxy -r requirements.yml<\/pre>\n<p>This is also a good time to update our playbook to use the role.<\/p>\n<pre class=\"brush:bash\">---\r\n- name: A demo to run ansible in a docker container\r\n  hosts: all\r\n  tasks:\r\n    - name: Add a file to root's home dir\r\n      copy:\r\n        dest: \/root\/foo\r\n        content: Hello World!\r\n        owner: root\r\n  roles:\r\n    - geerlingguy.redis<\/pre>\n<p>Finally, we need to tell ansible where our role directories are. We can do this by defining the <code class=\"markup--code markup--p-code\"><a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/github.com\/ansible\/ansible\/blob\/2a5a2773c8c145a167c90156d573cf8a1fa0c7f1\/lib\/ansible\/constants.py#L198\" target=\"_blank\" data-href=\"https:\/\/github.com\/ansible\/ansible\/blob\/2a5a2773c8c145a167c90156d573cf8a1fa0c7f1\/lib\/ansible\/constants.py#L198\">ANSIBLE_ROLES_PATH<\/a><\/code> environment variable. So we update our <code class=\"markup--code markup--p-code\">template.json<\/code> to the below content with that added.<\/p>\n<pre class=\"brush:java\">{\r\n  \"variables\": {\r\n    \"ansible_host\": \"default\",\r\n    \"ansible_connection\": \"docker\",\r\n    \"ansible_roles_path\": \"galaxy\"\r\n  },\r\n  \"builders\": [{\r\n    \"type\": \"docker\",\r\n    \"image\": \"ubuntu:16.04\",\r\n    \"commit\": \"true\",\r\n    \"run_command\": [ \"-d\", \"-i\", \"-t\", \"--name\", \"{{user `ansible_host`}}\", \"{{.Image}}\", \"\/bin\/bash\" ]\r\n  }],\r\n  \"provisioners\": [\r\n    {\r\n      \"type\": \"shell\",\r\n      \"inline\": [\r\n        \"apt-get update\",\r\n        \"apt-get install python -yq\"\r\n      ]\r\n    },\r\n    {\r\n      \"type\": \"ansible\",\r\n      \"ansible_env_vars\": [\r\n        \"ANSIBLE_ROLES_PATH={{user `ansible_roles_path` }}\"\r\n      ],\r\n      \"user\": \"root\",\r\n      \"playbook_file\": \".\/playbook.yml\",\r\n      \"extra_arguments\": [\r\n        \"--extra-vars\",\r\n        \"ansible_host={{user `ansible_host`}} ansible_connection={{user `ansible_connection`}}\"\r\n      ]\r\n    }\r\n  ],\r\n  \"post-processors\": [\r\n    [\r\n      {\r\n        \"type\": \"docker-tag\",\r\n        \"repository\": \"jamescarr\/demo\",\r\n        \"tag\": \"0.1\"\r\n      }\r\n    ]\r\n  ]\r\n}<\/pre>\n<p>With all of these changes made, let\u2019s run packer again.<\/p>\n<pre class=\"brush:java\">$ packer build template.json<\/pre>\n<p>If all goes well, we\u2019ll see the tasks to install redis get executed.<\/p>\n<p><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/01\/1-X7gR4j-Wq0z2D1z3fsV-Fg.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-15646\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/01\/1-X7gR4j-Wq0z2D1z3fsV-Fg.png\" alt=\"\" width=\"800\" height=\"666\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/01\/1-X7gR4j-Wq0z2D1z3fsV-Fg.png 800w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/01\/1-X7gR4j-Wq0z2D1z3fsV-Fg-300x250.png 300w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/01\/1-X7gR4j-Wq0z2D1z3fsV-Fg-768x639.png 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a><\/p>\n<p>And if we run our container we can see redis is indeed installed!<\/p>\n<pre class=\"brush:bash\">$ docker run -it jamescarr\/demo:0.1 bash<\/pre>\n<p><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/01\/1-VcVUOxuIE9zcIUJEviI16g.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-15647\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/01\/1-VcVUOxuIE9zcIUJEviI16g.png\" alt=\"\" width=\"676\" height=\"374\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/01\/1-VcVUOxuIE9zcIUJEviI16g.png 676w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/01\/1-VcVUOxuIE9zcIUJEviI16g-300x166.png 300w\" sizes=\"(max-width: 676px) 100vw, 676px\" \/><\/a><br \/>\nFor reference, you can see the project in its entirety at <a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/github.com\/jamescarr\/pad-tutorial\/tree\/part-two\" target=\"_blank\" rel=\"nofollow\" data-href=\"https:\/\/github.com\/jamescarr\/pad-tutorial\/tree\/part-two\">https:\/\/github.com\/jamescarr\/pad-tutorial\/tree\/part-two<\/a>.<br \/>\nThis is pretty nifty stuff\u2026 no more <code class=\"markup--code markup--p-code\">Dockerfiles<\/code> masquerading as glorified bash scripts. How about we take this further and use the same docker template to build out multiple different types of docker images?<\/p>\n<h2>Next Up<\/h2>\n<p>Tomorrow I\u2019ll write up part three and we\u2019ll explore making this template more dynamic and utilize our own roles to layout specific tasks.<\/p>\n<div class=\"attribution\">\n<table>\n<tbody>\n<tr>\n<td><span class=\"reference\">Reference: <\/span><\/td>\n<td><a href=\"https:\/\/blog.james-carr.org\/packer-ansible-and-docker-part-2-using-roles-363cbf5dcc7d\">Packer, Ansible and Docker Part 2: Using Ansible Galaxy<\/a> from our <a href=\"http:\/\/www.webcodegeeks.com\/join-us\/wcg\/\">WCG partner<\/a>\u00a0James Carr at the <a href=\"http:\/\/blog.james-carr.org\/\">James Carr<\/a> blog.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Previously we setup packer, docker and ansible to build a very simple docker image that simply placed a file under \/root with some content, a very simple start. Today we\u2019ll go further and explore using ansible roles and making some pieces a bit more dynamic. A Real World\u00a0Example In this tutorial, we\u2019ll build a docker &hellip;<\/p>\n","protected":false},"author":209,"featured_media":10356,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[422,217,421],"class_list":["post-15644","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-devops","tag-ansible","tag-docker","tag-packer"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Packer, Ansible and Docker Part 2: Using Ansible Galaxy - Web Code Geeks - 2026<\/title>\n<meta name=\"description\" content=\"Previously we setup packer, docker and ansible to build a very simple docker image that simply placed a file under \/root with some content, a very simple\" \/>\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.webcodegeeks.com\/devops\/packer-ansible-docker-part-2-using-ansible-galaxy\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Packer, Ansible and Docker Part 2: Using Ansible Galaxy - Web Code Geeks - 2026\" \/>\n<meta property=\"og:description\" content=\"Previously we setup packer, docker and ansible to build a very simple docker image that simply placed a file under \/root with some content, a very simple\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webcodegeeks.com\/devops\/packer-ansible-docker-part-2-using-ansible-galaxy\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webcodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2017-01-04T10:15:06+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"James Carr\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webcodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@webcodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"James Carr\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.webcodegeeks.com\/devops\/packer-ansible-docker-part-2-using-ansible-galaxy\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/devops\/packer-ansible-docker-part-2-using-ansible-galaxy\/\"},\"author\":{\"name\":\"James Carr\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/3fee9c530d4d22d6ac8ba305fb88e575\"},\"headline\":\"Packer, Ansible and Docker Part 2: Using Ansible Galaxy\",\"datePublished\":\"2017-01-04T10:15:06+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/devops\/packer-ansible-docker-part-2-using-ansible-galaxy\/\"},\"wordCount\":532,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/devops\/packer-ansible-docker-part-2-using-ansible-galaxy\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg\",\"keywords\":[\"Ansible\",\"Docker\",\"Packer\"],\"articleSection\":[\"DevOps\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.webcodegeeks.com\/devops\/packer-ansible-docker-part-2-using-ansible-galaxy\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.webcodegeeks.com\/devops\/packer-ansible-docker-part-2-using-ansible-galaxy\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/devops\/packer-ansible-docker-part-2-using-ansible-galaxy\/\",\"name\":\"Packer, Ansible and Docker Part 2: Using Ansible Galaxy - Web Code Geeks - 2026\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/devops\/packer-ansible-docker-part-2-using-ansible-galaxy\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/devops\/packer-ansible-docker-part-2-using-ansible-galaxy\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg\",\"datePublished\":\"2017-01-04T10:15:06+00:00\",\"description\":\"Previously we setup packer, docker and ansible to build a very simple docker image that simply placed a file under \/root with some content, a very simple\",\"breadcrumb\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/devops\/packer-ansible-docker-part-2-using-ansible-galaxy\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.webcodegeeks.com\/devops\/packer-ansible-docker-part-2-using-ansible-galaxy\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/devops\/packer-ansible-docker-part-2-using-ansible-galaxy\/#primaryimage\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.webcodegeeks.com\/devops\/packer-ansible-docker-part-2-using-ansible-galaxy\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.webcodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"DevOps\",\"item\":\"https:\/\/www.webcodegeeks.com\/category\/devops\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Packer, Ansible and Docker Part 2: Using Ansible Galaxy\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"name\":\"Web Code Geeks\",\"description\":\"Web Developers Resource Center\",\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.webcodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webcodegeeks\",\"https:\/\/x.com\/webcodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/3fee9c530d4d22d6ac8ba305fb88e575\",\"name\":\"James Carr\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/751c55f22a64fa5ac630c3bddaf1a4f4e11c442aaa9fc308004564cdca64b900?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/751c55f22a64fa5ac630c3bddaf1a4f4e11c442aaa9fc308004564cdca64b900?s=96&d=mm&r=g\",\"caption\":\"James Carr\"},\"sameAs\":[\"http:\/\/blog.james-carr.org\/\"],\"url\":\"https:\/\/www.webcodegeeks.com\/author\/james-carr\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Packer, Ansible and Docker Part 2: Using Ansible Galaxy - Web Code Geeks - 2026","description":"Previously we setup packer, docker and ansible to build a very simple docker image that simply placed a file under \/root with some content, a very simple","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.webcodegeeks.com\/devops\/packer-ansible-docker-part-2-using-ansible-galaxy\/","og_locale":"en_US","og_type":"article","og_title":"Packer, Ansible and Docker Part 2: Using Ansible Galaxy - Web Code Geeks - 2026","og_description":"Previously we setup packer, docker and ansible to build a very simple docker image that simply placed a file under \/root with some content, a very simple","og_url":"https:\/\/www.webcodegeeks.com\/devops\/packer-ansible-docker-part-2-using-ansible-galaxy\/","og_site_name":"Web Code Geeks","article_publisher":"https:\/\/www.facebook.com\/webcodegeeks","article_published_time":"2017-01-04T10:15:06+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg","type":"image\/jpeg"}],"author":"James Carr","twitter_card":"summary_large_image","twitter_creator":"@webcodegeeks","twitter_site":"@webcodegeeks","twitter_misc":{"Written by":"James Carr","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.webcodegeeks.com\/devops\/packer-ansible-docker-part-2-using-ansible-galaxy\/#article","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/devops\/packer-ansible-docker-part-2-using-ansible-galaxy\/"},"author":{"name":"James Carr","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/3fee9c530d4d22d6ac8ba305fb88e575"},"headline":"Packer, Ansible and Docker Part 2: Using Ansible Galaxy","datePublished":"2017-01-04T10:15:06+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/devops\/packer-ansible-docker-part-2-using-ansible-galaxy\/"},"wordCount":532,"commentCount":0,"publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/devops\/packer-ansible-docker-part-2-using-ansible-galaxy\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg","keywords":["Ansible","Docker","Packer"],"articleSection":["DevOps"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.webcodegeeks.com\/devops\/packer-ansible-docker-part-2-using-ansible-galaxy\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.webcodegeeks.com\/devops\/packer-ansible-docker-part-2-using-ansible-galaxy\/","url":"https:\/\/www.webcodegeeks.com\/devops\/packer-ansible-docker-part-2-using-ansible-galaxy\/","name":"Packer, Ansible and Docker Part 2: Using Ansible Galaxy - Web Code Geeks - 2026","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/devops\/packer-ansible-docker-part-2-using-ansible-galaxy\/#primaryimage"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/devops\/packer-ansible-docker-part-2-using-ansible-galaxy\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg","datePublished":"2017-01-04T10:15:06+00:00","description":"Previously we setup packer, docker and ansible to build a very simple docker image that simply placed a file under \/root with some content, a very simple","breadcrumb":{"@id":"https:\/\/www.webcodegeeks.com\/devops\/packer-ansible-docker-part-2-using-ansible-galaxy\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webcodegeeks.com\/devops\/packer-ansible-docker-part-2-using-ansible-galaxy\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/devops\/packer-ansible-docker-part-2-using-ansible-galaxy\/#primaryimage","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.webcodegeeks.com\/devops\/packer-ansible-docker-part-2-using-ansible-galaxy\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.webcodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"DevOps","item":"https:\/\/www.webcodegeeks.com\/category\/devops\/"},{"@type":"ListItem","position":3,"name":"Packer, Ansible and Docker Part 2: Using Ansible Galaxy"}]},{"@type":"WebSite","@id":"https:\/\/www.webcodegeeks.com\/#website","url":"https:\/\/www.webcodegeeks.com\/","name":"Web Code Geeks","description":"Web Developers Resource Center","publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.webcodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.webcodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.webcodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webcodegeeks","https:\/\/x.com\/webcodegeeks"]},{"@type":"Person","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/3fee9c530d4d22d6ac8ba305fb88e575","name":"James Carr","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/751c55f22a64fa5ac630c3bddaf1a4f4e11c442aaa9fc308004564cdca64b900?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/751c55f22a64fa5ac630c3bddaf1a4f4e11c442aaa9fc308004564cdca64b900?s=96&d=mm&r=g","caption":"James Carr"},"sameAs":["http:\/\/blog.james-carr.org\/"],"url":"https:\/\/www.webcodegeeks.com\/author\/james-carr\/"}]}},"_links":{"self":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/15644","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/users\/209"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/comments?post=15644"}],"version-history":[{"count":0,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/15644\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media\/10356"}],"wp:attachment":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media?parent=15644"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/categories?post=15644"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/tags?post=15644"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}