{"id":24651,"date":"2023-04-18T13:37:38","date_gmt":"2023-04-18T11:37:38","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/?p=24651"},"modified":"2025-01-14T13:47:38","modified_gmt":"2025-01-14T12:47:38","slug":"yak-and-ansible-collection-integration","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/yak-and-ansible-collection-integration\/","title":{"rendered":"YaK and Ansible Collection Integration"},"content":{"rendered":"\n<p>In this blog, I will show you how easy it is to use an existing ansible collection with <a href=\"https:\/\/www.dbi-services.com\/products\/yak\/\" target=\"_blank\" rel=\"noreferrer noopener\">YaK<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Ansible Galaxy<\/h2>\n\n\n\n<p>Ansible Galaxy is a public repository of Ansible roles. For the sake of this demonstration, I will use <a href=\"https:\/\/galaxy.ansible.com\/middleware_automation\/wildfly\" target=\"_blank\" rel=\"noreferrer noopener\">middleware_automation.wildfly<\/a> collection. To install it, in my yakbeta container:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n$ ansible-galaxy collection install middleware_automation.wildfly\nStarting galaxy collection install process\n&#x5B;WARNING]: Collection at &#039;\/workspace\/yak\/collections\/ansible_collections\/yak\/misc&#039; does not have a MANIFEST.json file, nor has it galaxy.yml: cannot detect version.\nProcess install dependency map\nStarting collection install process\nDownloading https:\/\/galaxy.ansible.com\/download\/middleware_automation-wildfly-1.3.1.tar.gz to \/workspace\/.ansible\/tmp\/ansible-local-33e3zino9p\/tmp9wz1syaj\/middleware_automation-wildfly-1.3.1-vcr58mod\nInstalling &#039;middleware_automation.wildfly:1.3.1&#039; to &#039;\/workspace\/yak\/collections\/ansible_collections\/middleware_automation\/wildfly&#039;\nDownloading https:\/\/galaxy.ansible.com\/download\/middleware_automation-redhat_csp_download-1.2.2.tar.gz to \/workspace\/.ansible\/tmp\/ansible-local-33e3zino9p\/tmp9wz1syaj\/middleware_automation-redhat_csp_download-1.2.2-hx0wj5oi\nmiddleware_automation.wildfly:1.3.1 was installed successfully\nInstalling &#039;middleware_automation.redhat_csp_download:1.2.2&#039; to &#039;\/workspace\/yak\/collections\/ansible_collections\/middleware_automation\/redhat_csp_download&#039;\nmiddleware_automation.redhat_csp_download:1.2.2 was installed successfully\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\">Prepare YaK<\/h2>\n\n\n\n<p>With the beta version, I have to set <code>YAK_CORE_COMPONENT<\/code> environment variable:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nexport YAK_CORE_COMPONENT=WILDFLY\n<\/pre><\/div>\n\n\n<p>This will indicate which component instantiation to use in <code>.\/configuration\/components\/<\/code> folder. WILDFLY subdirectory will solely contains a variables.yml with following content:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: yaml; title: ; notranslate\" title=\"\">\ncomponent_type: middleware_webserver\/WildFly\n\nyak_manifest_middleware_webserver:\n  - on_premises\/srv-linux-ols-1\n<\/pre><\/div>\n\n\n<p>Note the <code>component_type<\/code> which is defined even if it will not be used in our case.<\/p>\n\n\n\n<p>on_premises\/srv-linux-ols-1 is the pointer to a server in the YaK infrastructure definition(i.e. <code>.\/configuration\/infrastructure\/yak_dev_infrastructure\/on_premises\/<\/code>).<\/p>\n\n\n\n<p>Lastly, we can check that inventory is right with <code>aig<\/code> (a command alias for <code>ansible-inventory --graph<\/code>):<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nyak@4dce49535dd1:~\/yak$ aig\n@all:\n  |--@aws:\n  |--@azure:\n  |--@middleware_webserver:\n  |  |--on_premises\/srv-linux-wls-ols-1\n  |--@oci:\n  |--@on_premises:\n  |  |--on_premises\/srv-linux-wls-ols-1\n  |--@ungrouped:\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\">Deployment<\/h2>\n\n\n\n<p>If we don&#8217;t want to customize any settings, calling a role is as easy as this command:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nansible-playbook middleware_automation.wildfly.playbook\n<\/pre><\/div>\n\n\n<p>Output is long, so I am showing only few lines of the beginning:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;WARNING]: running playbook inside collection middleware_automation.wildfly\n\nPLAY &#x5B;Converge] **************************************************************************************************************************************************************************************************************\nTuesday 18 April 2023  11:12:12 +0000 (0:00:00.064)       0:00:00.064 *********\n &#x5B;started TASK: Gathering Facts on on_premises\/srv-linux-wls-ols-1]\n\nTASK &#x5B;Gathering Facts] *******************************************************************************************************************************************************************************************************\n&#x5B;WARNING]: Platform linux on host on_premises\/srv-linux-wls-ols-1 is using the discovered Python interpreter at \/usr\/bin\/python3.6, but future installation of another Python interpreter could change the meaning of that\npath. See https:\/\/docs.ansible.com\/ansible-core\/2.14\/reference_appendices\/interpreter_discovery.html for more information.\nok: &#x5B;on_premises\/srv-linux-wls-ols-1]\nTuesday 18 April 2023  11:12:15 +0000 (0:00:03.323)       0:00:03.388 *********\n &#x5B;started TASK: middleware_automation.wildfly.wildfly_install : Validating arguments against arg spec &#039;main&#039; on on_premises\/srv-linux-wls-ols-1]\n\nTASK &#x5B;middleware_automation.wildfly.wildfly_install : Validating arguments against arg spec &#039;main&#039;] **************************************************************************************************************************\nok: &#x5B;on_premises\/srv-linux-wls-ols-1]\nTuesday 18 April 2023  11:12:15 +0000 (0:00:00.067)       0:00:03.456 *********\n &#x5B;started TASK: middleware_automation.wildfly.wildfly_install : Ensures prerequirements are fullfilled. on on_premises\/srv-linux-wls-ols-1]\n\nTASK &#x5B;middleware_automation.wildfly.wildfly_install : Ensures prerequirements are fullfilled.] *******************************************************************************************************************************\nincluded: \/workspace\/yak\/collections\/ansible_collections\/middleware_automation\/wildfly\/roles\/wildfly_install\/tasks\/prereqs.yml for on_premises\/srv-linux-wls-ols-1\nTuesday 18 April 2023  11:12:16 +0000 (0:00:00.109)       0:00:03.566 *********\n...\n<\/pre><\/div>\n\n\n<p>After a few minutes, playbook completes. Let&#8217;s try to reach the administration console.<\/p>\n\n\n\n<p>Unfortunately, URL is not reachable. After some investigations, I noticed that the port is not opened in firewall.<\/p>\n\n\n\n<p>Once the port is opened, I am getting login\/password window. Sadly, I don&#8217;t know it. I tried to look in the Ansible code of the role, but <code>add-user.sh<\/code> is never used which means I have to run it.<\/p>\n\n\n\n<p>After that, I can login into the administration console.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">To Summarize<\/h2>\n\n\n\n<p>As we have seen using an existing collection a taking advantage of YaK inventory is very easy and consists of only following steps:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Collection installation<\/li>\n\n\n\n<li>Set component environment variable<\/li>\n\n\n\n<li>Call playbook<\/li>\n<\/ol>\n\n\n\n<p>Regarding <a href=\"https:\/\/galaxy.ansible.com\/middleware_automation\/wildfly\" target=\"_blank\" rel=\"noreferrer noopener\">middleware_automation.wildfly<\/a> role itself, I see this as a good role. Nevertheless, I prefer our in-house developed component which, not only, includes firewall configuration and admin user creation, but also dbi services best practices.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this blog, I will show you how easy it is to use an existing ansible collection with YaK. Ansible Galaxy Ansible Galaxy is a public repository of Ansible roles. For the sake of this demonstration, I will use middleware_automation.wildfly collection. To install it, in my yakbeta container: Prepare YaK With the beta version, I [&hellip;]<\/p>\n","protected":false},"author":40,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[197,2721],"tags":[2716,150,1100],"type_dbi":[],"class_list":["post-24651","post","type-post","status-publish","format-standard","hentry","category-application-integration-middleware","category-yak","tag-yak","tag-ansible","tag-wildfly"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.2 (Yoast SEO v27.2) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>YaK and Ansible Collection Integration - dbi Blog<\/title>\n<meta name=\"description\" content=\"Let&#039;s integrate a ansible collection from ansible galaxy with YaK inventory\" \/>\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.dbi-services.com\/blog\/yak-and-ansible-collection-integration\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"YaK and Ansible Collection Integration\" \/>\n<meta property=\"og:description\" content=\"Let&#039;s integrate a ansible collection from ansible galaxy with YaK inventory\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/yak-and-ansible-collection-integration\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi Blog\" \/>\n<meta property=\"article:published_time\" content=\"2023-04-18T11:37:38+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-01-14T12:47:38+00:00\" \/>\n<meta name=\"author\" content=\"Middleware Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Middleware Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/yak-and-ansible-collection-integration\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/yak-and-ansible-collection-integration\/\"},\"author\":{\"name\":\"Middleware Team\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d8563acfc6e604cce6507f45bac0ea1\"},\"headline\":\"YaK and Ansible Collection Integration\",\"datePublished\":\"2023-04-18T11:37:38+00:00\",\"dateModified\":\"2025-01-14T12:47:38+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/yak-and-ansible-collection-integration\/\"},\"wordCount\":313,\"commentCount\":0,\"keywords\":[\"#yak\",\"Ansible\",\"WildFly\"],\"articleSection\":[\"Application integration &amp; Middleware\",\"YaK\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/yak-and-ansible-collection-integration\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/yak-and-ansible-collection-integration\/\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/yak-and-ansible-collection-integration\/\",\"name\":\"YaK and Ansible Collection Integration - dbi Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\"},\"datePublished\":\"2023-04-18T11:37:38+00:00\",\"dateModified\":\"2025-01-14T12:47:38+00:00\",\"author\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d8563acfc6e604cce6507f45bac0ea1\"},\"description\":\"Let's integrate a ansible collection from ansible galaxy with YaK inventory\",\"breadcrumb\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/yak-and-ansible-collection-integration\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/yak-and-ansible-collection-integration\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/yak-and-ansible-collection-integration\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\/\/www.dbi-services.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"YaK and Ansible Collection Integration\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/\",\"name\":\"dbi Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d8563acfc6e604cce6507f45bac0ea1\",\"name\":\"Middleware Team\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/ddcae7ba0f9d1a0e7ae707f0e689e4a9c95bb48ec49c8e6d9cc86d43f4121cb6?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/ddcae7ba0f9d1a0e7ae707f0e689e4a9c95bb48ec49c8e6d9cc86d43f4121cb6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/ddcae7ba0f9d1a0e7ae707f0e689e4a9c95bb48ec49c8e6d9cc86d43f4121cb6?s=96&d=mm&r=g\",\"caption\":\"Middleware Team\"},\"url\":\"https:\/\/www.dbi-services.com\/blog\/author\/middleware-team\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"YaK and Ansible Collection Integration - dbi Blog","description":"Let's integrate a ansible collection from ansible galaxy with YaK inventory","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.dbi-services.com\/blog\/yak-and-ansible-collection-integration\/","og_locale":"en_US","og_type":"article","og_title":"YaK and Ansible Collection Integration","og_description":"Let's integrate a ansible collection from ansible galaxy with YaK inventory","og_url":"https:\/\/www.dbi-services.com\/blog\/yak-and-ansible-collection-integration\/","og_site_name":"dbi Blog","article_published_time":"2023-04-18T11:37:38+00:00","article_modified_time":"2025-01-14T12:47:38+00:00","author":"Middleware Team","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Middleware Team","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/yak-and-ansible-collection-integration\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/yak-and-ansible-collection-integration\/"},"author":{"name":"Middleware Team","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d8563acfc6e604cce6507f45bac0ea1"},"headline":"YaK and Ansible Collection Integration","datePublished":"2023-04-18T11:37:38+00:00","dateModified":"2025-01-14T12:47:38+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/yak-and-ansible-collection-integration\/"},"wordCount":313,"commentCount":0,"keywords":["#yak","Ansible","WildFly"],"articleSection":["Application integration &amp; Middleware","YaK"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/yak-and-ansible-collection-integration\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/yak-and-ansible-collection-integration\/","url":"https:\/\/www.dbi-services.com\/blog\/yak-and-ansible-collection-integration\/","name":"YaK and Ansible Collection Integration - dbi Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"datePublished":"2023-04-18T11:37:38+00:00","dateModified":"2025-01-14T12:47:38+00:00","author":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d8563acfc6e604cce6507f45bac0ea1"},"description":"Let's integrate a ansible collection from ansible galaxy with YaK inventory","breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/yak-and-ansible-collection-integration\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/yak-and-ansible-collection-integration\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/yak-and-ansible-collection-integration\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"YaK and Ansible Collection Integration"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d8563acfc6e604cce6507f45bac0ea1","name":"Middleware Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/ddcae7ba0f9d1a0e7ae707f0e689e4a9c95bb48ec49c8e6d9cc86d43f4121cb6?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/ddcae7ba0f9d1a0e7ae707f0e689e4a9c95bb48ec49c8e6d9cc86d43f4121cb6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ddcae7ba0f9d1a0e7ae707f0e689e4a9c95bb48ec49c8e6d9cc86d43f4121cb6?s=96&d=mm&r=g","caption":"Middleware Team"},"url":"https:\/\/www.dbi-services.com\/blog\/author\/middleware-team\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/24651","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/40"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=24651"}],"version-history":[{"count":9,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/24651\/revisions"}],"predecessor-version":[{"id":24671,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/24651\/revisions\/24671"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=24651"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=24651"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=24651"},{"taxonomy":"type","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/type_dbi?post=24651"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}