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
[root@comp 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
[root@comp 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_PASSWORD=p@ssw0rd
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:
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,
Create a netflix-like service using Django. Learn advanced Django techniques to achieve amazing results like never before.
Stream Framework Activity Streams & Newsfeeds Stream Framework is a Python library which allows you to build activity streams & newsfeeds using Cassan
Adding Firebase Cloud Messaging Service into a Django Project The aim of this repository is to provide a step-by-step guide and a basic project sample
starlette context Middleware for Starlette that allows you to store and access the context data of a request. Can be used with logging so logs automat
starlette context Middleware for Starlette that allows you to store and access the context data of a request. Can be used with logging so logs automat
starlette context Middleware for Starlette that allows you to store and access the context data of a request. Can be used with logging so logs automat
Ansible Ansible is a radically simple IT automation system. It handles configuration management, application deployment, cloud provisioning, ad-hoc ta
ansible_mlp An Ansible collection of Ansible Modules and Lookup Plugins (MLP) from Linuxfabrik. Ansible Bitwarden Item Lookup Plugin Returns a passwor
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,
Docker-Vulnerability-Check Docker is an open platform for developing, shipping, and running applications OS-level virtualization to deliver software i
Automate activities in Control Tower provisioned AWS accounts Table of contents Introduction Architecture Prerequisites Tools and services Usage Clean
Caylent Security Catalyst Reference Architecture Examples This repository contains solutions for Caylent's Security Catalyst. The Security Catalyst is
Tower_of_Hanoi Implementation of the famous puzle "Tower of Hanoi". The setup consists of three pegs (sticks) and a certain amount of discs (in this i
Bloons TD Battles 2 EXP Grinder Auto grind btdb2 exp for towers Setup I suggest checking out every screenshot to see what they are supposed to be, so
Monster Manual + This is an advanced monster manual for Tower of the Sorcerer mods. Users can get a plenty of extra imformation for decision making wh
Obstacle Tower Challenge using Deep Reinforcement Learning Unity Obstacle Tower is a challenging realistic 3D, third person perspective and procedural
IMPORTANT: I mean no offense at all in this game, this is only based off of cycl
Scrap-mtg-top-8 - A top 8 mtg scraper using python
Spotify Top Lists This is a simple script that will get the current top lists of a user from the Spotify API and display them in a Flask app. Requirem