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:
My Django Diary Full-stack web application that functions as a digital diary using Django, Python, SQLite, HTML & CSS. Things I learned during this pr
Aldryn CMS |PyPI Version| An opinionated django CMS setup bundled as an Aldryn Addon. This package will auto configure django CMS including some extra
A fresh approach to autocomplete implementations, specially for Django. Status: v3 stable, 2.x.x stable, 1.x.x deprecated. Please DO regularely ping us with your link at #yourlabs IRC channel
Django Compressor Django Compressor processes, combines and minifies linked and inline Javascript or CSS in a Django template into cacheable static fi
django + NextJS + Tailwind Boilerplate About A Django project boilerplate/templa
Realtime read-write with AJAX Hey,this is the basic implementation type of ajax realtime read write from the database. where you can insert or view re
getdp-project https://get-my-dp.herokuapp.com/ A Django-built web app that gener
martor Martor is a Markdown Editor plugin for Django, supported for Bootstrap & Semantic-UI. Features Live Preview Integrated with Ace Editor Supporte
Redis Django Cache Backend A Redis cache backend for Django Docs can be found at http://django-redis-cache.readthedocs.org/en/latest/. Changelog 3.0.0
Interiorshop A Simple E-Commerce app made with Django Instructions Make sure you have python installed Step 1. Open a terminal Step 2. Paste the given
Django & React Notes App Cloning the repository -- Clone the repository using the command below : git clone https://github.com/divanov11/Django-React
Email-Sender Django Email Sender Installation 1.clone Repository & Install Packages git clone https://github.com/telman03/Email-Sender.git pip install
btcpay-django A Django app for working with BTCPayServer Installation pip install btcpay-django Developers Release To cut a release, run bumpversion,
"Casares News" API Api that scrapes and provides the last news of the city of Carlos Casares by semantic way (RDF format). Usage Consume the articles
RuneKit Alt1-compatible toolbox for RuneScape 3, for Linux and macOS. Compatibility macOS installation guide Running This project use Poetry as packag
Django Solo +---------------------------+ | | | | | \ | Django Solo helps
Super simple bar charts for django admin list views visualizing the number of objects based on date_hierarchy using Chart.js.
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,
django-easy-audit Yet another Django audit log app, hopefully the easiest one. This app allows you to keep track of every action taken by your users.
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