{"id":1594,"date":"2016-09-20T22:39:42","date_gmt":"2016-09-21T02:39:42","guid":{"rendered":"http:\/\/blog.domb.net\/?p=1594"},"modified":"2017-05-18T11:45:54","modified_gmt":"2017-05-18T15:45:54","slug":"register-hosts-to-satellite6-via-cloudforms-and-ansible-tower-part-2","status":"publish","type":"post","link":"https:\/\/blog.domb.net\/?p=1594","title":{"rendered":"Register hosts to Satellite6 via CloudForms and Ansible Tower part 2"},"content":{"rendered":"<p>This post will show you how to add Ansible Tower as a provider in CloudForms, discover and create a catalog item out of a job template we\u2019ve created and order the catalog item via self service portal.<\/p>\n<p>If you followed part 1 you now have a fully functional Ansible Tower which we can add as a provider to Red Hat CloudForms.<\/p>\n<p><strong>Step 1<\/strong> Login to CloudForms<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.domb.net\/wp-content\/uploads\/logincfme.png\" alt=\"logincfme\" width=\"927\" height=\"262\" class=\"alignnone size-full wp-image-1595\" srcset=\"https:\/\/blog.domb.net\/wp-content\/uploads\/logincfme.png 927w, https:\/\/blog.domb.net\/wp-content\/uploads\/logincfme-300x85.png 300w, https:\/\/blog.domb.net\/wp-content\/uploads\/logincfme-768x217.png 768w\" sizes=\"auto, (max-width: 927px) 100vw, 927px\" \/><\/p>\n<p><strong>Step 2<\/strong> Go to Configuration -&gt; Configuration Management<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.domb.net\/wp-content\/uploads\/configurationmanagement.png\" alt=\"configurationmanagement\" width=\"202\" height=\"89\" class=\"alignnone size-full wp-image-1596\" \/><\/p>\n<p><strong>Step 3<\/strong> Click on Configuration and add a new provider<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.domb.net\/wp-content\/uploads\/addnewprovider.png\" alt=\"addnewprovider\" width=\"265\" height=\"102\" class=\"alignnone size-full wp-image-1597\" \/><\/p>\n<p><strong>Step 4<\/strong> Fill in the following values (of course it needs to match your environment)<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.domb.net\/wp-content\/uploads\/addtowerprov.png\" alt=\"addtowerprov\" width=\"484\" height=\"525\" class=\"alignnone size-full wp-image-1598\" srcset=\"https:\/\/blog.domb.net\/wp-content\/uploads\/addtowerprov.png 484w, https:\/\/blog.domb.net\/wp-content\/uploads\/addtowerprov-277x300.png 277w\" sizes=\"auto, (max-width: 484px) 100vw, 484px\" \/><br \/>\nNow validate your credentials<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.domb.net\/wp-content\/uploads\/validate.png\" alt=\"validate\" width=\"58\" height=\"22\" class=\"alignnone size-full wp-image-1599\" \/><br \/>\nand hit add<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.domb.net\/wp-content\/uploads\/addcfme.png\" alt=\"addcfme\" width=\"48\" height=\"51\" class=\"alignnone size-full wp-image-1600\" \/><\/p>\n<p><strong>Step 5 <\/strong> After Adding the provider you will see that CloudForms will discover the created job template from Ansible Tower<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.domb.net\/wp-content\/uploads\/towerjobs.png\" alt=\"towerjobs\" width=\"947\" height=\"302\" class=\"alignnone size-full wp-image-1601\" srcset=\"https:\/\/blog.domb.net\/wp-content\/uploads\/towerjobs.png 947w, https:\/\/blog.domb.net\/wp-content\/uploads\/towerjobs-300x96.png 300w, https:\/\/blog.domb.net\/wp-content\/uploads\/towerjobs-768x245.png 768w\" sizes=\"auto, (max-width: 947px) 100vw, 947px\" \/><\/p>\n<p><strong>Step 6<\/strong> Click on the sat6register job template<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.domb.net\/wp-content\/uploads\/Screen-Shot-2016-09-20-at-5.23.34-PM.png\" alt=\"screen-shot-2016-09-20-at-5-23-34-pm\" width=\"916\" height=\"310\" class=\"alignnone size-full wp-image-1606\" srcset=\"https:\/\/blog.domb.net\/wp-content\/uploads\/Screen-Shot-2016-09-20-at-5.23.34-PM.png 916w, https:\/\/blog.domb.net\/wp-content\/uploads\/Screen-Shot-2016-09-20-at-5.23.34-PM-300x102.png 300w, https:\/\/blog.domb.net\/wp-content\/uploads\/Screen-Shot-2016-09-20-at-5.23.34-PM-768x260.png 768w\" sizes=\"auto, (max-width: 916px) 100vw, 916px\" \/><br \/>\nThen click configuration -&gt; Create Service Dialog from this Job Template<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.domb.net\/wp-content\/uploads\/createdialogfromtemplate.png\" alt=\"createdialogfromtemplate\" width=\"310\" height=\"65\" class=\"alignnone size-full wp-image-1604\" srcset=\"https:\/\/blog.domb.net\/wp-content\/uploads\/createdialogfromtemplate.png 310w, https:\/\/blog.domb.net\/wp-content\/uploads\/createdialogfromtemplate-300x63.png 300w\" sizes=\"auto, (max-width: 310px) 100vw, 310px\" \/><\/p>\n<p>In my case I did name the template <strong>reghosts_to_sat6<\/strong><br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.domb.net\/wp-content\/uploads\/Screen-Shot-2016-09-20-at-5.29.05-PM.png\" alt=\"screen-shot-2016-09-20-at-5-29-05-pm\" width=\"1140\" height=\"244\" class=\"alignnone size-full wp-image-1610\" srcset=\"https:\/\/blog.domb.net\/wp-content\/uploads\/Screen-Shot-2016-09-20-at-5.29.05-PM.png 1140w, https:\/\/blog.domb.net\/wp-content\/uploads\/Screen-Shot-2016-09-20-at-5.29.05-PM-300x64.png 300w, https:\/\/blog.domb.net\/wp-content\/uploads\/Screen-Shot-2016-09-20-at-5.29.05-PM-768x164.png 768w, https:\/\/blog.domb.net\/wp-content\/uploads\/Screen-Shot-2016-09-20-at-5.29.05-PM-1024x219.png 1024w\" sizes=\"auto, (max-width: 1140px) 100vw, 1140px\" \/><br \/>\nClick the save button on the bottom right<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.domb.net\/wp-content\/uploads\/Screen-Shot-2016-09-20-at-5.30.44-PM.png\" alt=\"screen-shot-2016-09-20-at-5-30-44-pm\" width=\"46\" height=\"28\" class=\"alignnone size-full wp-image-1612\" \/><\/p>\n<p><strong>Step 7<\/strong> Now its time to look at the actual service dialog which got created from the Ansible Job Template<br \/>\nGot to Automate -&gt; Customization -&gt; Service Dialogs and click on your service dialog. You will see a dialog which pretty much looks like this<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.domb.net\/wp-content\/uploads\/Selection_025.png\" alt=\"selection_025\" width=\"1120\" height=\"504\" class=\"alignnone size-full wp-image-1691\" srcset=\"https:\/\/blog.domb.net\/wp-content\/uploads\/Selection_025.png 1120w, https:\/\/blog.domb.net\/wp-content\/uploads\/Selection_025-300x135.png 300w, https:\/\/blog.domb.net\/wp-content\/uploads\/Selection_025-768x346.png 768w, https:\/\/blog.domb.net\/wp-content\/uploads\/Selection_025-1024x461.png 1024w\" sizes=\"auto, (max-width: 1120px) 100vw, 1120px\" \/><br \/>\nIf you want to be able to edit the fields you have to <strong>uncheck<\/strong> the readonly box for each field. Per default they are set readonly!<\/p>\n<p><strong>Step 8 <\/strong> Believe it or not but this is a fully functional service dialog which can be added to a catalog in CloudForms. <strong>Part 4<\/strong> of the series which I will release next week will show you how you can make some of these fields <strong>dynamic<\/strong>. <\/p>\n<p><strong>Step 9 <\/strong> Create a catalog. Go to Services -&gt; Catalogs -&gt; Catalogs and click on Configuration -&gt; Create new catalog<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.domb.net\/wp-content\/uploads\/Screen-Shot-2016-09-20-at-5.39.52-PM.png\" alt=\"screen-shot-2016-09-20-at-5-39-52-pm\" width=\"333\" height=\"70\" class=\"alignnone size-full wp-image-1617\" srcset=\"https:\/\/blog.domb.net\/wp-content\/uploads\/Screen-Shot-2016-09-20-at-5.39.52-PM.png 333w, https:\/\/blog.domb.net\/wp-content\/uploads\/Screen-Shot-2016-09-20-at-5.39.52-PM-300x63.png 300w\" sizes=\"auto, (max-width: 333px) 100vw, 333px\" \/><br \/>\nName the catalog however you like and add it<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.domb.net\/wp-content\/uploads\/Screen-Shot-2016-09-20-at-5.40.50-PM.png\" alt=\"screen-shot-2016-09-20-at-5-40-50-pm\" width=\"766\" height=\"201\" class=\"alignnone size-full wp-image-1618\" srcset=\"https:\/\/blog.domb.net\/wp-content\/uploads\/Screen-Shot-2016-09-20-at-5.40.50-PM.png 766w, https:\/\/blog.domb.net\/wp-content\/uploads\/Screen-Shot-2016-09-20-at-5.40.50-PM-300x79.png 300w\" sizes=\"auto, (max-width: 766px) 100vw, 766px\" \/><\/p>\n<p><strong>Step 10<\/strong> Lets add the service dialog to the ansible catalog. Click on Services -&gt; Catalogs -&gt; Catalog items -&gt; ansible -&gt; Configuration -&gt; Create new catalog item<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.domb.net\/wp-content\/uploads\/Screen-Shot-2016-09-20-at-5.43.01-PM.png\" alt=\"screen-shot-2016-09-20-at-5-43-01-pm\" width=\"216\" height=\"94\" class=\"alignnone size-full wp-image-1619\" \/><br \/>\nAs a catalog item type choose AnsibleTower<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.domb.net\/wp-content\/uploads\/Screen-Shot-2016-09-20-at-5.43.59-PM.png\" alt=\"screen-shot-2016-09-20-at-5-43-59-pm\" width=\"382\" height=\"333\" class=\"alignnone size-full wp-image-1620\" srcset=\"https:\/\/blog.domb.net\/wp-content\/uploads\/Screen-Shot-2016-09-20-at-5.43.59-PM.png 382w, https:\/\/blog.domb.net\/wp-content\/uploads\/Screen-Shot-2016-09-20-at-5.43.59-PM-300x262.png 300w\" sizes=\"auto, (max-width: 382px) 100vw, 382px\" \/><br \/>\nAdd the following values to the catalog item and click add<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.domb.net\/wp-content\/uploads\/Screen-Shot-2016-09-20-at-5.45.32-PM.png\" alt=\"screen-shot-2016-09-20-at-5-45-32-pm\" width=\"778\" height=\"414\" class=\"alignnone size-full wp-image-1621\" srcset=\"https:\/\/blog.domb.net\/wp-content\/uploads\/Screen-Shot-2016-09-20-at-5.45.32-PM.png 778w, https:\/\/blog.domb.net\/wp-content\/uploads\/Screen-Shot-2016-09-20-at-5.45.32-PM-300x160.png 300w, https:\/\/blog.domb.net\/wp-content\/uploads\/Screen-Shot-2016-09-20-at-5.45.32-PM-768x409.png 768w\" sizes=\"auto, (max-width: 778px) 100vw, 778px\" \/><\/p>\n<p><strong>Step 11<\/strong> Lets add some color to the catalog item and add an ansible <a href=\"https:\/\/www.google.com\/url?sa=i&amp;rct=j&amp;q=&amp;esrc=s&amp;source=images&amp;cd=&amp;cad=rja&amp;uact=8&amp;ved=0ahUKEwiozeCa9p7PAhXBWz4KHRUrBJwQjRwIBw&amp;url=https%3A%2F%2Fcommons.wikimedia.org%2Fwiki%2FFile%3AAnsible_Logo.png&amp;psig=AFQjCNHpEhjFPwb8xMp4lFJ9FZl6hNmWFg&amp;ust=1474494502240551\" target=\"_blank\">logo<\/a>. Click on the newly created catalog item and upload the ansible logo.<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.domb.net\/wp-content\/uploads\/Selection_044.png\" alt=\"selection_044\" width=\"815\" height=\"468\" class=\"alignnone size-full wp-image-1729\" srcset=\"https:\/\/blog.domb.net\/wp-content\/uploads\/Selection_044.png 815w, https:\/\/blog.domb.net\/wp-content\/uploads\/Selection_044-300x172.png 300w, https:\/\/blog.domb.net\/wp-content\/uploads\/Selection_044-768x441.png 768w\" sizes=\"auto, (max-width: 815px) 100vw, 815px\" \/><\/p>\n<p><strong>Step 12 <\/strong>login to the self service ui, you will find that under https:\/\/cloudformsfqdn\/self_service<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.domb.net\/wp-content\/uploads\/logincfme.png\" alt=\"logincfme\" width=\"927\" height=\"262\" class=\"alignnone size-full wp-image-1595\" srcset=\"https:\/\/blog.domb.net\/wp-content\/uploads\/logincfme.png 927w, https:\/\/blog.domb.net\/wp-content\/uploads\/logincfme-300x85.png 300w, https:\/\/blog.domb.net\/wp-content\/uploads\/logincfme-768x217.png 768w\" sizes=\"auto, (max-width: 927px) 100vw, 927px\" \/><br \/>\nOnce logged in click on Service Catalog and you will see your ansible catalog item<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.domb.net\/wp-content\/uploads\/Screen-Shot-2016-09-20-at-5.54.49-PM.png\" alt=\"screen-shot-2016-09-20-at-5-54-49-pm\" width=\"713\" height=\"473\" class=\"alignnone size-full wp-image-1625\" srcset=\"https:\/\/blog.domb.net\/wp-content\/uploads\/Screen-Shot-2016-09-20-at-5.54.49-PM.png 713w, https:\/\/blog.domb.net\/wp-content\/uploads\/Screen-Shot-2016-09-20-at-5.54.49-PM-300x199.png 300w\" sizes=\"auto, (max-width: 713px) 100vw, 713px\" \/><\/p>\n<p><strong>Step 13<\/strong> Click on the ansible catalog item and fill out the values. The limit is the host or hosts separated by &#8220;:&#8221; which you would like to register to Satellite6. The limit cannot be left empty and the host must exist in the Ansible Tower inventory unless you chose the tower inventory to update on launch of a job.<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.domb.net\/wp-content\/uploads\/Screen-Shot-2016-09-20-at-5.55.54-PM.png\" alt=\"screen-shot-2016-09-20-at-5-55-54-pm\" width=\"699\" height=\"520\" class=\"alignnone size-full wp-image-1626\" srcset=\"https:\/\/blog.domb.net\/wp-content\/uploads\/Screen-Shot-2016-09-20-at-5.55.54-PM.png 699w, https:\/\/blog.domb.net\/wp-content\/uploads\/Screen-Shot-2016-09-20-at-5.55.54-PM-300x223.png 300w\" sizes=\"auto, (max-width: 699px) 100vw, 699px\" \/><br \/>\nIf you have entered all the correct values you can go ahead, add the item to the shopping cart<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.domb.net\/wp-content\/uploads\/Screen-Shot-2016-09-20-at-5.59.20-PM.png\" alt=\"screen-shot-2016-09-20-at-5-59-20-pm\" width=\"151\" height=\"35\" class=\"alignnone size-full wp-image-1629\" srcset=\"https:\/\/blog.domb.net\/wp-content\/uploads\/Screen-Shot-2016-09-20-at-5.59.20-PM.png 151w, https:\/\/blog.domb.net\/wp-content\/uploads\/Screen-Shot-2016-09-20-at-5.59.20-PM-150x35.png 150w\" sizes=\"auto, (max-width: 151px) 100vw, 151px\" \/><br \/>\nYou can now click on the shopping cart on the top right and order the item<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.domb.net\/wp-content\/uploads\/Screen-Shot-2016-09-20-at-5.59.31-PM.png\" alt=\"screen-shot-2016-09-20-at-5-59-31-pm\" width=\"908\" height=\"213\" class=\"alignnone size-full wp-image-1630\" srcset=\"https:\/\/blog.domb.net\/wp-content\/uploads\/Screen-Shot-2016-09-20-at-5.59.31-PM.png 908w, https:\/\/blog.domb.net\/wp-content\/uploads\/Screen-Shot-2016-09-20-at-5.59.31-PM-300x70.png 300w, https:\/\/blog.domb.net\/wp-content\/uploads\/Screen-Shot-2016-09-20-at-5.59.31-PM-768x180.png 768w\" sizes=\"auto, (max-width: 908px) 100vw, 908px\" \/><\/p>\n<p>As this item was launched as a service you can follow the work flow under Services-&gt;Requests. Once the statemachine steps gets to launch_job you will see the job popping up in the Ansible Tower Console. <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.domb.net\/wp-content\/uploads\/Selection_024.png\" alt=\"selection_024\" width=\"1808\" height=\"120\" class=\"alignnone size-full wp-image-1689\" srcset=\"https:\/\/blog.domb.net\/wp-content\/uploads\/Selection_024.png 1808w, https:\/\/blog.domb.net\/wp-content\/uploads\/Selection_024-300x20.png 300w, https:\/\/blog.domb.net\/wp-content\/uploads\/Selection_024-768x51.png 768w, https:\/\/blog.domb.net\/wp-content\/uploads\/Selection_024-1024x68.png 1024w\" sizes=\"auto, (max-width: 1808px) 100vw, 1808px\" \/><\/p>\n<p>After few second, the job is executed and registers the host with the Red Hat Satellite 6 server. The completion of the job can be validated in CloudForms under Services -&gt; Requests or in the Satellite 6 UI. <\/p>\n<p>The next part (part 3) of the blog series which I will release next week will show you how you can add that dialog as a button under vm instances.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This post will show you how to add Ansible Tower as a provider in CloudForms, discover and create a catalog item out of a job template we\u2019ve created and order the catalog item via self service portal. If you followed part 1 you now have a fully functional Ansible Tower which we can add as&#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,6],"tags":[67,29,8,68],"class_list":["post-1594","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ansible","category-cloudforms","category-puppet","tag-ansible","tag-cloudforms","tag-puppet-2","tag-satellite6"],"_links":{"self":[{"href":"https:\/\/blog.domb.net\/index.php?rest_route=\/wp\/v2\/posts\/1594","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=1594"}],"version-history":[{"count":30,"href":"https:\/\/blog.domb.net\/index.php?rest_route=\/wp\/v2\/posts\/1594\/revisions"}],"predecessor-version":[{"id":1792,"href":"https:\/\/blog.domb.net\/index.php?rest_route=\/wp\/v2\/posts\/1594\/revisions\/1792"}],"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=1594"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.domb.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1594"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.domb.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1594"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}