Creating a Ansible Service
Last updated
Last updated
Ansible is the main pillar for the automation and playbooks are its essential part. Till now, we have seen the enabling of Ansible in ManageIQ; to know the entire picture, lets walk through it.
In our case, we will be working on creation of a external network. We can choose any functionality and write a playbook for it.
As till now, you have done with the integration and enabling of Embedded Ansible. Now it is time for the actual working for the end user view set.
Moving ahead, you need to navigate from Automation → Automate → Customization.
You will land on page where you need to import the service dialog.
Select the dialog file from the playbook in the Choose file field.
Click on Upload button to import the dialog file.
You will get a list of service dialogs.
Select the dialog you wish to add from the playbook.
Commit the changes and go ahead.
You can view the service dialog in graphical view in the Service Dialogs section. You can see the list of service dialogs here and you can go through it by just on a click.
In our case, this service is for creation of external network that would collect the details from the user like network name, OpenStack host, its credentials and SSL options.
Next, it is required to create a catalog. For this, follow these steps
Navigate to Services → Catalogs.
Go to catalogs section.
Go through Configurations → Add New Catalog.
Give a appropriate name to the catalog.
Click the Add button to save the changes.
After the creation of catalog you need to add items to this catalog. For that,
Select the Catalog Items section in Services → Catalogs.
Here, you can see a list of catalogs created.
Select a catalog you want to work on.
Walk through Configuration → Add New Catalog Item.
Select Ansible playbook as a catalog item type from the dropdown menu.
Add a appropriate name to the catalog item what ever you think is good.
Give a description to this catalog item.
Enable the option of displaying the item in catalog. By default, it is disabled.
Select the catalog you wish to work on and have been added before as we have seen it previously.
Select the repo you want your catalog item to run on. We have already added this repo in chapter_3.
Select the playbook you need your user to avail the facility. In our case, we are working on network playbook.
Give proper ManageIQ Credentials from the drop down menu.
Select a proper Cloud Type. By default nothing is selected.
Host is to be selected. Localhost is the default choice.
Log out on error. This is by default.
As we have already added the dialog, we will choose existing dialog.
Select the added service dialog for the catalog item.
Select the Add button to save the changes.
This will show you the details about the catalog. You can view the brief summary of the catalog right from its creation, number of playbooks, etc on just click.
So now, you are almost done with everything like Dialog, Creating a catalog, Catalog item and now it is time to order our service. For this,
Travel to Service Catalog section by Services → Catalogs. In this section you can see the list of services that are ready to order.
In our case Create External Network service catalog is ready to order.
Click on the Order button and go ahead.
You will land on the dialog page that we have already added. A user has to fill in all the details for ordering a service.
Fill in the appropriate name for the network.
Select a OpenStack host from the drop down list.
Fill in the required credentials. This is done by the machine itself.
Select SSL settings for the network you are creating. By default, it is false.
Click the Submit button to proceed your request.
You could see the task for the ordered service in the Requests section with all the details like request id, requester, type of request, state of order, creation date etc.
We faced the issue related the Generic Server Error. We are still working on it. The error is filed at ManageIQ as well.