Squest - A service request portal based on Ansible Tower
Squest is a Web portal that allow to expose Tower based automation as a service.
If you want an idea of what you can do with Squest, click on the image below
Like discussed here https://gitter.im/HewlettPackard/squest?at=63038a0c9994996293ffe438 I am trying to implement a custom approval business logic in a python filter triggered by a global hook on request submission.
After some debug on the python module itself, I tried to use the "accept/reject" api via CURL to reduce the debug complexity, but it still throws an error.
That's the curl command :
curl -vvv -X POST "https://[...]/api/service_catalog/request/233/accept/" -H "accept: application/json" -H "authorization: Bearer [...]"
And the error is :
{"required":"This field is required.","null":"This field may not be null.","invalid":"Invalid data. Expected a dictionary, but got {datatype}."}
Please note that :
Seems like I am missing some parameters, but looking at the swagger those apis don't need any payload, just request id in query string.
When I try to request the delete operation fon an instance I got a stack trace from django (I'm on version 1.7.6b).
That's the curl I try to execute :
curl -X POST "https://[...]/api/service_catalog/instance/[...]/operation/[...]/request/" -d '{ "fill_in_survey": { } }' -H 'Content-Type: application/json' -H "accept: application/json" -H "authorization: Bearer [...]"
And that's the django stack trace :
[...]
File "/app/service_catalog/models/request.py", line 62, in full_survey
return {k: v for k, v in {**self.fill_in_survey, **self.admin_fill_in_survey}.items() if v is not None}
Exception Type: TypeError at /api/service_catalog/instance/[...]/operation/[...]/request/
Exception Value: 'str' object is not a mapping
Request information:
USER: admin
GET: No GET data
POST: No POST data
FILES: No FILES data
COOKIES: No cookie data
[...]
Please note that deleting from UI works as expected.
Describe the bug mariadbd error for a docker deployment
1- I did clone the Squest github branch v1.7.5
2 - i did execute the command line : docker-compose up -d
3 - for see if it works : docker ps
[[email protected] squest]#
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
14cdc66c3ba7 nginx:alpine "/docker-entrypoint.…" 23 hours ago Up 23 hours 80/tcp, 0.0.0.0:8080->8080/tcp squest_nginx_1
ff61fdf676cf rabbitmq:3-management "docker-entrypoint.s…" 24 hours ago Up 23 hours 4369/tcp, 5671/tcp, 0.0.0.0:5672->5672/tcp, 15671/tcp, 15691-15692/tcp, 25672/tcp, 0.0.0.0:15672->15672/tcp squest_rabbitmq_1
9e252ca59667 redis:6-alpine "docker-entrypoint.s…" 24 hours ago Up 23 hours 0.0.0.0:6379->6379/tcp squest_redis-cache_1
1aa13d258d4a phpmyadmin/phpmyadmin:5.1.3 "/docker-entrypoint.…" 24 hours ago Up 23 hours 0.0.0.0:8082->80/tcp squest_phpmyadmin_1
57344043bfbd nginx:alpine "/docker-entrypoint.…" 24 hours ago Up 23 hours 80/tcp squest_maintenance_1
The database isn't started. I have an error for db service
[[email protected] squest]# docker-compose logs -f db
Attaching to squest_db_1
db_1 | 2022-09-29 13:32:29+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.9.3+maria~ubu2204 started.
db_1 | 2022-09-29 13:32:29+00:00 [ERROR] [Entrypoint]: mariadbd failed while attempting to check config
db_1 | command was: mariadbd --verbose --help --log-bin-index=/tmp/tmp.1mcnSd4wDn
db_1 | Can't initialize timers
db_1 | 2022-09-29 13:33:37+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.9.3+maria~ubu2204 started.
db_1 | 2022-09-29 13:33:37+00:00 [ERROR] [Entrypoint]: mariadbd failed while attempting to check config
db_1 | command was: mariadbd --verbose --help --log-bin-index=/tmp/tmp.BgFSwpU3Bi
db_1 | Can't initialize timers
db_1 | 2022-09-30 08:06:24+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.9.3+maria~ubu2204 started.
db_1 | 2022-09-30 08:06:24+00:00 [ERROR] [Entrypoint]: mariadbd failed while attempting to check config
db_1 | command was: mariadbd --verbose --help --log-bin-index=/tmp/tmp.bkZFKjSNiw
db_1 | Can't initialize timers
squest_db_1 exited with code 1
**Expected behavior**
db starting correctly and Squest is Up
**Additional context**
here the content of : ./docker/environnement_variables/db.env
MYSQL_DATABASE=squest_db
MYSQL_USER=squest_user
MYSQL_PASSWORD=squest_password
MYSQL_ROOT_PAS[email protected]
MYSQL_HOST=127.0.0.1
MYSQL_PORT=3306
is it a problem with the db config ?
I try with MYSQL_HOST, MYSQL_PORT and without
- Squest version 1.7.5:
- Ansible Tower/AWX version: NA
Describe the bug Squest throw an exception when an AWX survey have either 'multiple select' or 'multiple select multiple' type of field.
To Reproduce Steps to reproduce the behavior:
'list' object has no attribute 'splitlines'
Expected behavior Survey can be displayed
Errors
Request Method: | GET
-- | --
http://squest.example.com/ui/service_catalog/service/6/operation/4/request/
3.2.13
AttributeError
'list' object has no attribute 'splitlines'
/app/service_catalog/forms/utils.py, line 25, in get_choices_from_string
/usr/local/bin/python
3.10.6
['/app', '/app/squest', '/usr/local/lib/python3.10/site-packages/git/ext/gitdb', '/app', '/usr/local/bin', '/usr/local/lib/python310.zip', '/usr/local/lib/python3.10', '/usr/local/lib/python3.10/lib-dynload', '/usr/local/lib/python3.10/site-packages', '/usr/local/lib/python3.10/site-packages/gitdb/ext/smmap']
Mon, 08 Aug 2022 15:17:00 +0200
Traces
Environment:
Request Method: GET
Request URL: http://squest.example.com/ui/service_catalog/service/6/operation/4/request/
Django Version: 3.2.13
Python Version: 3.10.6
Installed Applications:
['django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'rest_framework',
'django_celery_results',
'django_celery_beat',
'guardian',
'tempus_dominus',
'django_node_assets',
'django_filters',
'drf_yasg',
'taggit',
'martor',
'django_tables2',
'dbbackup',
'service_catalog',
'resource_tracker',
'profiles',
'monitoring',
'cachalot',
'django_cleanup.apps.CleanupConfig']
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',
'Squest.middleware.maintenance.MaintenanceMiddleware']
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/usr/local/lib/python3.10/site-packages/django/core/handlers/base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python3.10/site-packages/django/contrib/auth/decorators.py", line 21, in _wrapped_view
return view_func(request, *args, **kwargs)
File "/app/service_catalog/views/customer/catalog_views.py", line 30, in customer_service_request
form = ServiceRequestForm(request.user, **parameters)
File "/app/service_catalog/forms/service_request_forms.py", line 62, in __init__
self.fields.update(get_fields_from_survey(purged_survey_with_validator))
File "/app/service_catalog/forms/utils.py", line 80, in get_fields_from_survey
choices=get_choices_from_string(survey_field["choices"]),
File "/app/service_catalog/forms/utils.py", line 25, in get_choices_from_string
split_lines = string_with_anti_slash_n.splitlines()
Exception Type: AttributeError at /ui/service_catalog/service/6/operation/4/request/
Exception Value: 'list' object has no attribute 'splitlines'
Version
Description of the feature Our ansible playbook can install multiple servers in parallel. I would like to see that possibility to install multiple instances with the same configuration in one go.
Multiple server installs are not possible today if I understand it correctly.
featureDescribe the bug If I try to process a service from the catalog I receive the following error: Exception Value: 'NoneType' object has no attribute 'name' service_catalog/views/common.py, line 78, in create_pie_chart_instance_by_service_type
I don't use any billing groups nor resources. Just use the default value for the service
To Reproduce Steps to reproduce the behavior:
Expected behavior No error
Screenshots
Additional context
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'
bug
Multiselect, text area, password, integer and float fields have been added. The initial values and validators were mapped with values defined in survey spec.
As an example, I order a new service "Virtal Machine". The AWX survey ask therefore options like name, CPU and memory. Later I'll update the existing instance using the update operation, the CPU and memory field are prefilled with the current value from specs.
featureIt'd be nice to have details (i.e. username, email, etc) of the user submitting the request filled into ansible vars.
I'm using squest -> awx to provision vm in vcenter environment and I'd like to set vm attributes to specify contact person and other details: I can set those attributes via ansible, but in this case I'm missing user's value.
In the squest part of the payload I can just see squest user id (squest.user field) while variables as "awx_user_name" or "awx_user_email" are filled with details of the awx user been impersonated by awx application.
From time to time we need to provide "time bounded" resources, like vm for students that we need to delete after a certain period of time.
It'd be nice to have a mapping between groups/resource types where admin could specify whenever expiration date is mandatory during request.
Deletion of resources would obviously happen as is done at the moment, invoking a specific playbook, but with a scheduled job server side without human intervention.
The page is useless in its curent state. We never use it.
Todo:
As a end user I would like to:
We need a value to calculate the cost of each service. For example vCPU of a VM converted as $ per day.
Need to take into account a change of the value itself in time as well as the change of the spec of an instance (added vcpu on a vm)
featureRequest
object were not deleted when deleting Request
(Fix and cleanup migration).fill_in_survey
was saved as string instead of dictspec
/user_spec
--> instance
. Impacted pages:
An advanced software to keep you notes. It allows users to perform CRUD operations on theirs Notes. Was implemented Authorization and Authentication
django-model-utils Django model mixins and utilities. django-model-utils supports Django 2.2+. This app is available on PyPI. Getting Help Documentati
Django-Online-Business-Database-Project this project is still in progress Overview of Website This website serves as an online database (hosted via SQ
Ramlwrap is a toolkit for Django which allows a combination of rapid server prototyping as well as enforcement of API definition from the RAML api. R
django-rich Extensions for using Rich with Django. Requirements Python 3.6 to 3.10 supported. Django 2.2 to 4.0 supported. Are your tests slow? Check
Django Persistent Filters Django Persistent Filters is a Python package which provide a django middleware that take care to persist the querystring in
ImageKit is a Django app for processing images. Need a thumbnail? A black-and-white version of a user-uploaded image? ImageKit will make them for you.
SitoPBG-Django Imparare Django ricreando un sito facsimile a quello Flask Note di utilizzo Necessita la valorizzazione delle seguenti variabili di amb
Tailslide Median and percentile for Django and MongoEngine Supports: PostgreSQL SQLite MariaDB MySQL (with an extension) SQL Server MongoDB 🔥 Uses na
PWA PWA is a simple Django app to develope and deploy a Progressive Web Application. Detailed documentation is in the "docs" directory. Quick start Ad
django + NextJS + Tailwind Boilerplate About A Django project boilerplate/templa
Redis Leaderboard Python (Django) Show how the redis works with Python (Django). Try it out deploying on Heroku (See notes: How to run on Google Cloud
Django Portofolio Example this is a basic portfolio in dark mode Installation git clone https://github.com/FaztWeb/django-portfolio-simple.git cd djan
django-idom allows Django to integrate with IDOM, a package inspired by ReactJS for creating responsive web interfaces in pure Python.
Django-RQ Django integration with RQ, a Redis based Python queuing library. Django-RQ is a simple app that allows you to configure your queues in djan
I managed to attach the Django Framework to my Telegram Bot and set a webhook. I've been developing it from 10th of November 2021 and I want to have a basic working prototype.
Template de desarrollo Django Python Django Docker Postgres Nginx CI/CD Descripción del proyecto : Proyecto template de directrices para la estandariz
pep484 stubs for Django This package contains type stubs and a custom mypy plugin to provide more precise static types and type inference for Django f
django-recurrence django-recurrence is a utility for working with recurring dates in Django. Documentation is available at https://django-recurrence.r
wagtail-tenants wagtail_tenants is a Django/Wagtail app to provide multitenancy to your wagtail project. You are able to run a main Wagtail Site and f