{"id":2057,"date":"2017-06-01T09:50:50","date_gmt":"2017-06-01T13:50:50","guid":{"rendered":"http:\/\/blog.domb.net\/?p=2057"},"modified":"2017-06-01T14:23:29","modified_gmt":"2017-06-01T18:23:29","slug":"cloudforms-4-5-rhv-management-part-1","status":"publish","type":"post","link":"https:\/\/blog.domb.net\/?p=2057","title":{"rendered":"CloudForms 4.5 RHV 4.1 Management by Ansible Automation Inside (Part 1 Create Service Dialog)"},"content":{"rendered":"<p>This post will explain what steps you need to go through to enable the ansible management of RHV on the first release of CFME 4.5. I assume that you&#8217;ve already enabled the Embedded Ansible role in Configuration &#8211; Server Control (enabling ansible automation inside can take up to 7-10 minutes) .<\/p>\n<p>CloudForms 4.5 comes with the ansible version of 2.2.1. For the RHV \/ ovirt modules we need the 2.3 version. As both version run python 2.7 an upgrade of the package ansible will not pull in any dependency and will not add any harm to the system.<\/p>\n<pre class=\"lang:default decode:true\">[root@host204 ~]# rpm -ivh https:\/\/dl.fedoraproject.org\/pub\/epel\/7\/x86_64\/e\/epel-release-7-9.noarch.rpm<\/pre>\n<p>Then update ansible<\/p>\n<pre class=\"lang:default decode:true\">[root@host204 ~]# yum update ansible -y<\/pre>\n<p>Now\u00a0we need to get the\u00a0python-ovirt-engine-sdk4-4.1.3-1.el7ev.x86_64.rpm as this package is not on the cloudforms appliance yet for rhv 4.1. Please make sure you download it from the redhat portal.<\/p>\n<pre class=\"lang:default decode:true\">[root@host204 ~]# rpm -ivh python-ovirt-engine-sdk4-4.1.3-1.el7ev.x86_64.rpm<\/pre>\n<p>Once done you need to create a folder on the CFME 4.5 appliance so that ansible inside can read files on the filesystem. Open the file \/etc\/tower\/settings.py and add the following content<\/p>\n<pre class=\"lang:default decode:true \">AWX_PROOT_SHOW_PATHS = ['\/tmp\/readablebytower']<\/pre>\n<p>I need this directory for my playbooks as I\u00a0store the ovirt-ca.pem there which is needed for the authentication.<\/p>\n<p>Restart ansible automation inside to update the configs.<\/p>\n<pre class=\"lang:default decode:true\">[root@host204 ~]# ansible-tower-service restart<\/pre>\n<p>In CloudForms go to Automation &#8211; Ansible &#8211; Credentials and add the following machine credential. You only need to fill in the Name and Vault password as you will store the RHV creds in the vault. That is the power of ansible. Even if we don&#8217;t have the &#8220;credentials&#8221; in the UI you can pretty much use this\u00a0method for any provider until we added in the UI:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2059\" src=\"http:\/\/blog.domb.net\/wp-content\/uploads\/Selection_183.png\" alt=\"\" width=\"1457\" height=\"601\" srcset=\"https:\/\/blog.domb.net\/wp-content\/uploads\/Selection_183.png 1457w, https:\/\/blog.domb.net\/wp-content\/uploads\/Selection_183-300x124.png 300w, https:\/\/blog.domb.net\/wp-content\/uploads\/Selection_183-768x317.png 768w, https:\/\/blog.domb.net\/wp-content\/uploads\/Selection_183-1024x422.png 1024w\" sizes=\"auto, (max-width: 1457px) 100vw, 1457px\" \/>Then go to Automation &#8211; Ansible &#8211; Repositories and git clone the following repo (this is for you to get some playbooks) or clone yours:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2060\" src=\"http:\/\/blog.domb.net\/wp-content\/uploads\/Selection_184.png\" alt=\"\" width=\"1484\" height=\"530\" srcset=\"https:\/\/blog.domb.net\/wp-content\/uploads\/Selection_184.png 1484w, https:\/\/blog.domb.net\/wp-content\/uploads\/Selection_184-300x107.png 300w, https:\/\/blog.domb.net\/wp-content\/uploads\/Selection_184-768x274.png 768w, https:\/\/blog.domb.net\/wp-content\/uploads\/Selection_184-1024x366.png 1024w\" sizes=\"auto, (max-width: 1484px) 100vw, 1484px\" \/><\/p>\n<p>If you are successful with adding the repo you now see all playbooks under Automation &#8211; Ansible &#8211; Playbooks:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2061\" src=\"http:\/\/blog.domb.net\/wp-content\/uploads\/Selection_185.png\" alt=\"\" width=\"1133\" height=\"282\" srcset=\"https:\/\/blog.domb.net\/wp-content\/uploads\/Selection_185.png 1133w, https:\/\/blog.domb.net\/wp-content\/uploads\/Selection_185-300x75.png 300w, https:\/\/blog.domb.net\/wp-content\/uploads\/Selection_185-768x191.png 768w, https:\/\/blog.domb.net\/wp-content\/uploads\/Selection_185-1024x255.png 1024w\" sizes=\"auto, (max-width: 1133px) 100vw, 1133px\" \/><\/p>\n<p>From there you can go to Services &#8211; \u00a0Catalogs and create a new catalog. Once done go to Catalog items where you can choose to create a new item from the ansible playbook. You can either let it generate a new service dialog or you can use one you&#8217;ve created.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2062\" src=\"http:\/\/blog.domb.net\/wp-content\/uploads\/Selection_186.png\" alt=\"\" width=\"1220\" height=\"716\" srcset=\"https:\/\/blog.domb.net\/wp-content\/uploads\/Selection_186.png 1220w, https:\/\/blog.domb.net\/wp-content\/uploads\/Selection_186-300x176.png 300w, https:\/\/blog.domb.net\/wp-content\/uploads\/Selection_186-768x451.png 768w, https:\/\/blog.domb.net\/wp-content\/uploads\/Selection_186-1024x601.png 1024w\" sizes=\"auto, (max-width: 1220px) 100vw, 1220px\" \/><\/p>\n<p>Now that we are done go order the item under Services &#8211; Service Catalogs &#8211; CatalogName &#8211; Item<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2063\" src=\"http:\/\/blog.domb.net\/wp-content\/uploads\/Selection_187.png\" alt=\"\" width=\"1140\" height=\"397\" srcset=\"https:\/\/blog.domb.net\/wp-content\/uploads\/Selection_187.png 1140w, https:\/\/blog.domb.net\/wp-content\/uploads\/Selection_187-300x104.png 300w, https:\/\/blog.domb.net\/wp-content\/uploads\/Selection_187-768x267.png 768w, https:\/\/blog.domb.net\/wp-content\/uploads\/Selection_187-1024x357.png 1024w\" sizes=\"auto, (max-width: 1140px) 100vw, 1140px\" \/><\/p>\n<p>The job output\u00a0can either be checked in the self service portal or in \/var\/lib\/awx\/job_status\/&#8230;. on the appliance which runs ansbile.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2064\" src=\"http:\/\/blog.domb.net\/wp-content\/uploads\/Selection_188.png\" alt=\"\" width=\"791\" height=\"678\" srcset=\"https:\/\/blog.domb.net\/wp-content\/uploads\/Selection_188.png 791w, https:\/\/blog.domb.net\/wp-content\/uploads\/Selection_188-300x257.png 300w, https:\/\/blog.domb.net\/wp-content\/uploads\/Selection_188-768x658.png 768w\" sizes=\"auto, (max-width: 791px) 100vw, 791px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This post will explain what steps you need to go through to enable the ansible management of RHV on the first release of CFME 4.5. I assume that you&#8217;ve already enabled the Embedded Ansible role in Configuration &#8211; Server Control (enabling ansible automation inside can take up to 7-10 minutes) . CloudForms 4.5 comes with&#8230;<\/p>\n","protected":false},"author":2,"featured_media":2048,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_themeisle_gutenberg_block_has_review":false,"footnotes":""},"categories":[64,37,4],"tags":[67,111,110,29],"class_list":["post-2057","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ansible","category-cloudforms","category-virtualization","tag-ansible","tag-ansible-automation-inside","tag-ansible-inside","tag-cloudforms"],"_links":{"self":[{"href":"https:\/\/blog.domb.net\/index.php?rest_route=\/wp\/v2\/posts\/2057","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.domb.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.domb.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.domb.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.domb.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2057"}],"version-history":[{"count":15,"href":"https:\/\/blog.domb.net\/index.php?rest_route=\/wp\/v2\/posts\/2057\/revisions"}],"predecessor-version":[{"id":2087,"href":"https:\/\/blog.domb.net\/index.php?rest_route=\/wp\/v2\/posts\/2057\/revisions\/2087"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.domb.net\/index.php?rest_route=\/wp\/v2\/media\/2048"}],"wp:attachment":[{"href":"https:\/\/blog.domb.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2057"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.domb.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2057"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.domb.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2057"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}