hewlettpackard / squest Goto Github PK
View Code? Open in Web Editor NEWService request portal on top of Ansible Tower/AWX
Home Page: https://hewlettpackard.github.io/squest/latest
License: Apache License 2.0
Service request portal on top of Ansible Tower/AWX
Home Page: https://hewlettpackard.github.io/squest/latest
License: Apache License 2.0
So it can be used when dev and for integration test
I am new to django and wanted to ask if it's possible to show only some services for a logged in user and not all services in the catalog view.
Regards,
Stephan
The resource tracking feature is in progress.
We have so far:
We need to add a view that give a visual map of resource group with link on attributes of a resource pool.
The idea is to generate a page with graphviz.
Example of code with dot language (can be tested in the online editor here)
digraph {
node [shape=plaintext]
rg1 [label=
<
<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0">
<TR>
<TD COLSPAN="12">Resource Group</TD>
</TR>
<TR>
<TD COLSPAN="6">Name</TD>
<TD COLSPAN="6">Server</TD>
</TR>
<TR>
<TD COLSPAN="6">Resource</TD>
<TD COLSPAN="6">34</TD>
</TR>
<TR>
<TD COLSPAN="12">Attributes</TD>
</TR>
<TR>
<TD COLSPAN="6">Name</TD>
<TD COLSPAN="6">Total</TD>
</TR>
<TR>
<TD PORT="rg1_vCPU" COLSPAN="6">vCPU</TD>
<TD COLSPAN="6">60</TD>
</TR>
<TR>
<TD PORT="rg1_memory" COLSPAN="6">Memory</TD>
<TD COLSPAN="6">34</TD>
</TR>
</TABLE>
>
];
node [shape=plaintext]
rp1 [label=
<
<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0">
<TR>
<TD COLSPAN="12">Resource Pool</TD>
</TR>
<TR>
<TD COLSPAN="6">Name</TD>
<TD COLSPAN="6">vCenter</TD>
</TR>
<TR>
<TD COLSPAN="12">Attributes</TD>
</TR>
<TR>
<TD COLSPAN="3">name</TD>
<TD COLSPAN="3">Produced</TD>
<TD COLSPAN="3">Consumed</TD>
<TD COLSPAN="3">Available</TD>
</TR>
<TR>
<TD PORT="rp1_vCPU" COLSPAN="3">vCPU</TD>
<TD COLSPAN="3">40</TD>
<TD COLSPAN="3">30</TD>
<TD COLSPAN="3">10</TD>
</TR>
<TR>
<TD PORT="rp1_memory" COLSPAN="3">Memory</TD>
<TD COLSPAN="3">100</TD>
<TD COLSPAN="3">20</TD>
<TD COLSPAN="3">80</TD>
</TR>
</TABLE>
>
];
rg2 [label=
<
<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0">
<TR>
<TD COLSPAN="12">Resource Group</TD>
</TR>
<TR>
<TD COLSPAN="6">Name</TD>
<TD COLSPAN="6">VM</TD>
</TR>
<TR>
<TD COLSPAN="6">Resource</TD>
<TD COLSPAN="6">34</TD>
</TR>
<TR>
<TD COLSPAN="12">Attributes</TD>
</TR>
<TR>
<TD COLSPAN="6">Name</TD>
<TD COLSPAN="6">Total</TD>
</TR>
<TR>
<TD PORT="rg2_vCPU" COLSPAN="6">vCPU</TD>
<TD COLSPAN="6">60</TD>
</TR>
<TR>
<TD PORT="rg2_memory" COLSPAN="6">Memory</TD>
<TD COLSPAN="6">34</TD>
</TR>
</TABLE>
>
];
node [shape=plaintext]
rg3 [label=
<
<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0">
<TR>
<TD COLSPAN="12">Resource Group</TD>
</TR>
<TR>
<TD COLSPAN="3">Name</TD>
<TD COLSPAN="3">Resources</TD>
<TD COLSPAN="3">vCPU</TD>
<TD COLSPAN="3">Memory</TD>
</TR>
<TR>
<TD COLSPAN="3">vCenter</TD>
<TD COLSPAN="3">23</TD>
<TD COLSPAN="3">30</TD>
<TD COLSPAN="3">45</TD>
</TR>
</TABLE>
>
];
rg1:rg1_vCPU -> rp1:rp1_vCPU [color = green]
rg1:rg1_memory -> rp1:rp1_memory [color = green]
rp1:rp1_vCPU -> rg2:rg2_vCPU [color = red]
rp1:rp1_memory -> rg2:rg2_memory [color = red]
}
Todo:
Admin can create an announcement message with start and end date to notify users of an incoming maintenance
Add resource tracking doc to mkdoc
As an admin
I can define a template of a resource group that can be copied to become a resource group.
E.g: define a "physical server" with CPU, Memory, Disk
Now:
80 physical server CPU ---> 80 vCPU in a vCenter pool
With ratio set to 2:
80 physical server CPU ---> 160 vCPU in a vCenter pool
Bug appear after processing a request with the "Demo job template"
Environment:
Request Method: POST
Request URL: http://127.0.0.1:8000/admin/request/10/process/
Django Version: 3.1.7
Python Version: 3.8.10
Installed Applications:
['django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'rest_framework',
'fontawesome-free',
'django_celery_results',
'django_celery_beat',
'guardian',
'django_node_assets',
'django_filters',
'drf_yasg',
'service_catalog',
'resource_tracker']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware']
Traceback (most recent call last):
File "/home/anthony/.cache/pypoetry/virtualenvs/tower-service-catalog--Kn3-9f8-py3.8/lib/python3.8/site-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/home/anthony/.cache/pypoetry/virtualenvs/tower-service-catalog--Kn3-9f8-py3.8/lib/python3.8/site-packages/django/core/handlers/base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/anthony/.cache/pypoetry/virtualenvs/tower-service-catalog--Kn3-9f8-py3.8/lib/python3.8/site-packages/django/contrib/auth/decorators.py", line 21, in _wrapped_view
return view_func(request, *args, **kwargs)
File "/home/anthony/HPE/squest/service_catalog/views/admin/request.py", line 162, in admin_request_process
target_request.perform_processing()
File "/home/anthony/.cache/pypoetry/virtualenvs/tower-service-catalog--Kn3-9f8-py3.8/lib/python3.8/site-packages/django_fsm/__init__.py", line 520, in _change_state
return fsm_meta.field.change_state(instance, func, *args, **kwargs)
File "/home/anthony/.cache/pypoetry/virtualenvs/tower-service-catalog--Kn3-9f8-py3.8/lib/python3.8/site-packages/django_fsm/__init__.py", line 326, in change_state
result = method(instance, *args, **kwargs)
File "/home/anthony/HPE/squest/service_catalog/models/request.py", line 105, in perform_processing
tower_job_id = self.operation.job_template.execute(extra_vars=tower_extra_vars)
File "/home/anthony/HPE/squest/service_catalog/models/job_templates.py", line 22, in execute
return tower_job_run.id
Exception Type: AttributeError at /admin/request/10/process/
Exception Value: 'NoneType' object has no attribute 'id'
In your video I can see that the end user doesn't see all survey fields from tower. There is one dropdown at the top that the admin can see. How can I achive this?
Regards,
Stephan
I tried different settings in ldap_config.py and also read the django docs and double check the config.
But every time I receive "AUTH_LDAP_USER_SEARCH must be an LDAPSearch instance". Can you check this? Manually running a ldapsearch on command line works fine.
Regards,
Stephan
So far Squest only manage integer attribute. We need to be able to add string like a comment.
As a USER of the portal
I want to READ my profile info
Example of info:
From this page we will be able to create as well token (related to #25 )
We have a failure during the Docker image build
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/libu/libuv1/libuv1-dev_1.34.2-1ubuntu1.1_amd64.deb 404 Not Found [IP: 52.250.76.244 80]
This package has been replaced by libuv1-dev_1.34.2-1ubuntu1.3_amd64.deb
.
Possible workaround
Need to be done for the first release
https://squidfunk.github.io/mkdocs-material/setup/setting-up-versioning/
As an admin I can:
CRUD on Groups
add/delete a user to a group
Create Billing Group model
CRUD on Billing Group
add / delete user from Billing Group
instance linked to billing group
Spec:
Foreign key on Instance to BillingGroup
User --> 1,n -- 0,n BillingGroup (create default billing group: fixtures)
manage the billing group of instance with survey field
When user create instance
if one billingroup
then instance billing == billingroup
else
need to select billingroup
Tests to do:
We must add a favicon.
I have configured a service for the service catalog and the mail notifications "from" address is different:
SUBMITTED: from user that requested the service
ACCEPTED: from "admin mail address"
PROCESSING: from "admin mail address"
COMPLETED: from "squest@SQUEST_HOST"
Works as expected? I would expect that "from" should be always squest@SQUEST_HOST
How can I use day 2 operations? Do I need special extra_vars in ansible tower or in the playbook (for create/update/delete)?
As a user I need to be able to create an API token that can be used in a playbook to update instance spec.
Create a production deployment
The first version can be done with docker compose.
Implementation example: https://github.com/netbox-community/netbox-docker
Feature:
Pure bootstrap: https://getbootstrap.com/docs/4.0/components/breadcrumb/
Maybe a lib can do the trick: https://django-bootstrap-breadcrumbs.readthedocs.io/en/latest/
Or just a snippet: https://www.bedjango.com/blog/snippet-breadcrumbs/
To be tested, compared and implemented.
if RP --> attribute RG ---> Resource ---> Instance ---> Billing group THEN new category with Organization name
The sync job template button does not update the number of job template once the ajax request is complete.
We need to refresh the page.
So far Squest only support job templates.
It would be interesting to support as well workflows.
Images are not compulsory when adding a new service but sQuest crash when we list services
As a end user I need a page that explain me how to use the service I ordered
How to reproduce:
Traceback:
Traceback (most recent call last):
File "/home/nico/.cache/pypoetry/virtualenvs/tower-service-catalog-X_7Nmek_-py3.8/lib/python3.8/site-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/home/nico/.cache/pypoetry/virtualenvs/tower-service-catalog-X_7Nmek_-py3.8/lib/python3.8/site-packages/django/core/handlers/base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/nico/.cache/pypoetry/virtualenvs/tower-service-catalog-X_7Nmek_-py3.8/lib/python3.8/site-packages/django/contrib/auth/decorators.py", line 21, in _wrapped_view
return view_func(request, *args, **kwargs)
File "/home/nico/Documents/squest/service_catalog/views/admin/catalog.py", line 20, in add_service
if form.is_valid():
File "/home/nico/.cache/pypoetry/virtualenvs/tower-service-catalog-X_7Nmek_-py3.8/lib/python3.8/site-packages/django/forms/forms.py", line 177, in is_valid
return self.is_bound and not self.errors
File "/home/nico/.cache/pypoetry/virtualenvs/tower-service-catalog-X_7Nmek_-py3.8/lib/python3.8/site-packages/django/forms/forms.py", line 172, in errors
self.full_clean()
File "/home/nico/.cache/pypoetry/virtualenvs/tower-service-catalog-X_7Nmek_-py3.8/lib/python3.8/site-packages/django/forms/forms.py", line 374, in full_clean
self._clean_fields()
File "/home/nico/.cache/pypoetry/virtualenvs/tower-service-catalog-X_7Nmek_-py3.8/lib/python3.8/site-packages/django/forms/forms.py", line 392, in _clean_fields
value = field.clean(value)
File "/home/nico/.cache/pypoetry/virtualenvs/tower-service-catalog-X_7Nmek_-py3.8/lib/python3.8/site-packages/django/forms/fields.py", line 149, in clean
value = self.to_python(value)
File "/home/nico/.cache/pypoetry/virtualenvs/tower-service-catalog-X_7Nmek_-py3.8/lib/python3.8/site-packages/django/forms/models.py", line 1274, in to_python
value = self.queryset.get(**{key: value})
File "/home/nico/.cache/pypoetry/virtualenvs/tower-service-catalog-X_7Nmek_-py3.8/lib/python3.8/site-packages/django/db/models/query.py", line 433, in get
raise self.model.MultipleObjectsReturned(
service_catalog.models.job_templates.JobTemplate.MultipleObjectsReturned: get() returned more than one JobTemplate -- it returned 2!
ERROR 2021-07-13 13:00:37,743 log Internal Server Error: /settings/catalog/service/add_service/
Traceback (most recent call last):
File "/home/nico/.cache/pypoetry/virtualenvs/tower-service-catalog-X_7Nmek_-py3.8/lib/python3.8/site-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/home/nico/.cache/pypoetry/virtualenvs/tower-service-catalog-X_7Nmek_-py3.8/lib/python3.8/site-packages/django/core/handlers/base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/nico/.cache/pypoetry/virtualenvs/tower-service-catalog-X_7Nmek_-py3.8/lib/python3.8/site-packages/django/contrib/auth/decorators.py", line 21, in _wrapped_view
return view_func(request, *args, **kwargs)
File "/home/nico/Documents/squest/service_catalog/views/admin/catalog.py", line 20, in add_service
if form.is_valid():
File "/home/nico/.cache/pypoetry/virtualenvs/tower-service-catalog-X_7Nmek_-py3.8/lib/python3.8/site-packages/django/forms/forms.py", line 177, in is_valid
return self.is_bound and not self.errors
File "/home/nico/.cache/pypoetry/virtualenvs/tower-service-catalog-X_7Nmek_-py3.8/lib/python3.8/site-packages/django/forms/forms.py", line 172, in errors
self.full_clean()
File "/home/nico/.cache/pypoetry/virtualenvs/tower-service-catalog-X_7Nmek_-py3.8/lib/python3.8/site-packages/django/forms/forms.py", line 374, in full_clean
self._clean_fields()
File "/home/nico/.cache/pypoetry/virtualenvs/tower-service-catalog-X_7Nmek_-py3.8/lib/python3.8/site-packages/django/forms/forms.py", line 392, in _clean_fields
value = field.clean(value)
File "/home/nico/.cache/pypoetry/virtualenvs/tower-service-catalog-X_7Nmek_-py3.8/lib/python3.8/site-packages/django/forms/fields.py", line 149, in clean
value = self.to_python(value)
File "/home/nico/.cache/pypoetry/virtualenvs/tower-service-catalog-X_7Nmek_-py3.8/lib/python3.8/site-packages/django/forms/models.py", line 1274, in to_python
value = self.queryset.get(**{key: value})
File "/home/nico/.cache/pypoetry/virtualenvs/tower-service-catalog-X_7Nmek_-py3.8/lib/python3.8/site-packages/django/db/models/query.py", line 433, in get
raise self.model.MultipleObjectsReturned(
service_catalog.models.job_templates.JobTemplate.MultipleObjectsReturned: get() returned more than one JobTemplate -- it returned 2!
[13/Jul/2021 13:00:37] "POST /settings/catalog/service/add_service/ HTTP/1.1" 500 109972
Use cases:
Lib for that: https://channels.readthedocs.io/
After changing Tower/AWX survey, we must synchronize job templates on squest.
Do we update survey when is updated on Tower automatically or do we ask to update it manually?
NoReverseMatch at /settings/catalog/service/4/delete/
Reverse for 'settings_catalog' not found. 'settings_catalog' is not a valid view function or pattern name.
When creating a service, we only select the job template that will be used for provisioning.
It would be interesting to add other job templates that could be executed following the request or instance state.
And on instance change
As a End User of the portal
I want to be able to give permissions (Read or Update)
on my instances
to other users of the portal
And link to the dashboard
Error when creating a service. /app/media seems not allowed.
Currently it seems that it will only collect tower survey from type "text" and not "multiselect" or "password. Can you add this, too?
Regards,
Stephan
I think that should be possible like this: help_text=survey_definition['question_description']
So that the end user get a little bit more information what data is needed.
All all of our template are the same.
We could maybe send some data from the view like the target URL, button name,...
As an admin I need to have a page that print all info concerning a job template for all operation of a service.
This feature will be mostly used to compare the survey present in Squest VS the survey declared in Tower/AWX
Steps to reproduce:
celery -A service_catalog worker -l info
Currently on commit : 46302ff (upstream/resoure_tracker)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.