Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Executing an ansible playbook with user + password requires the parameter "same_arg_param" #726

Open
DanielSchwartz1 opened this issue Dec 4, 2023 · 2 comments
Labels

Comments

@DanielSchwartz1
Copy link

DanielSchwartz1 commented Dec 4, 2023

Hi,

I am running the script-server version 1.17 within a docker container.

I have in my script inventory, an ansible playbook which requires the parameter "user" + "pw".
When setting the parameters, it requires to flag the setting "Combine param with value".
Also it requires to set the "Param" field to "-e ansible_user=".

Only if these setting is set to true ("same_arg_param": true), the playbook is executed properly.

The problem is that, after the script-server is restarted, these setting ("same_arg_param": true) for the parameter is removed from the runner json file of the dedicated script.

The assumption is that with the migration from 1.16 to 1.17 there is deletion of this parameter in the migrate.py file.
https://github.com/bugy/script-server/blob/master/src/migrations/migrate.py#L306C1-L307C48
if same_arg_param is not None:
del parameter['same_arg_param']

I see that the value "multiselect_argument_type": "repeat_param_value" is being added to the json file, but it does not have the same effect.

Do you have an easy fix for that?

Thank you very much!

@bugy
Copy link
Owner

bugy commented Dec 6, 2023

Hi @DanielSchwartz1, to be honest, I don't remember the reason for this migration already. As far as I remember, there was some issue with inverting the meaning of the parameter for multi-select lists. But clearly, I missed your use case.

For you, as a quick solution, I would recommend keeping temp folder between restarts (i.e. mount it to some volume). In this folder it's stored, which migrations were executed already and do not reapply them.

@bugy bugy added the bug label Dec 6, 2023
@DanielSchwartz1
Copy link
Author

Thank you very much @bugy!
It is possible to fix it with this approach.

Inside the Dockerfile:

  • Create the temp folder
  • Copy the migrations.txt to that temp folder

Migrations.txt has the content like:
migrate_repeat_param_and_same_arg_param

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants