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:
Organize Django settings into multiple files and directories. Easily override and modify settings. Use wildcards in settings file paths and mark setti
Logan Logan is a toolkit for running standalone Django applications. It provides you with tools to create a CLI runner, manage settings, and the abili
Learning Django 💡 create a virtual environment create python -m venv ./venv. this virtualenv file will be excluded by .gitignore activate the virtual
Django Web Forum This is a personal django website for forum posts It includes login, registration and forum posts with date time. Tech / Framework us
mypy-django Type stubs to use the mypy static type-checker with your Django projects This project includes the PEP-484 compatible "type stubs" for Dja
Django Stomp A simple implementation of STOMP with Django. In theory it can work with any broker which supports STOMP with none or minor adjustments.
django-simple-history django-simple-history stores Django model state on every create/update/delete. This app supports the following combinations of D
django-webpack-loader Use webpack to generate your static bundles without django's staticfiles or opaque wrappers. Django webpack loader consumes the
Created by Stephen McDonald Introduction Up until PostgreSQL 9.2, COUNT queries generally required scanning every row in a database table. With millio
Django-SEKH Django Search Engine Keywords Highlighter, is a middleware for Django providing the capacities to highlight the user's search keywords if
djangoblog 👨💻 A blogging platform built on Django and Python
django-reversion django-reversion is an extension to the Django web framework that provides version control for model instances. Requirements Python 3
Sistema Contrasenas Desarrolado en Django Proyecto sistema de administracion de contraseñas, de la experiencia educativa Programacion Segura Descripci
privalise Social Media Network Focuses On Data Security And Being Community Driven Web App The Main Idea: We`ve seen social media web apps that focuse
Pillow Python Imaging Library (Fork) Pillow is the friendly PIL fork by Alex Clark and Contributors. PIL is the Python Imaging Library by Fredrik Lund
Agenda de Eventos Projeto Agenda com Django Inicio O projeto foi iniciado no Django, usando o models.py foi adicionado os dados dos eventos e feita as
Installation Installing from PyPI is as easy as doing: pip install django-storages If you'd prefer to install from source (maybe there is a bugfix in
Blog Management System Backend use: Django Features Enhanced Ui
martor Martor is a Markdown Editor plugin for Django, supported for Bootstrap & Semantic-UI. Features Live Preview Integrated with Ace Editor Supporte
Django GUID Now with ASGI support! Django GUID attaches a unique correlation ID/request ID to all your log outputs for every request. In other words,