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

feature request: share/import task templates #1344

Open
steadfasterX opened this issue Jul 15, 2023 · 4 comments
Open

feature request: share/import task templates #1344

steadfasterX opened this issue Jul 15, 2023 · 4 comments
Assignees

Comments

@steadfasterX
Copy link
Contributor

steadfasterX commented Jul 15, 2023

description

I would really love to see a "share my task template" feature in a future release..

a mysqldump is sufficient if you just want to have a desaster recovery but if you want to share your:

  1. full task template
  2. including all the config set within (survey variables, view, cron, etc)
  3. including the linked "environment"
  4. including the linked "inventory"
  5. including the linked "repository"
  6. including the linked "Key store" but without the linked key store contents ofc. more like an empty placeholder so the link stays intact to the task template

As said: this must happen without the content of any private key / passwords / vaults etc of course.

The result could then be shared with others to easily re-produce/re-use the current implementation and could also be added to e.g. git for reviewing etc.

last but not least it could be also used as a minimal quick backup to save a specific state or saving important changes before the next scheduled mysqldump backup starts.

implementation idea

sharing

  • a button on each task template named (e.g): "Share"
  • when clicked the necessary API calls will be done, fetching all required links between the task and its deps
  • a tgz will be created and offered as a download

importing

  • a new button on the "Task Templates" main screen named (e.g): "Import"
  • when clicked the tgz can be uploaded
  • the user gets prompted:
    • how the task template should be named
    • to which view the template should be added (default: the one from the imported file and existing views as a drop-down)
  • a pre-check must happen if the task template name is unique - abort or prompt user for a new name if not
  • all necessary API calls will be done, adding the view if its not there, posting all required links between the task and its deps

permissions

  1. sharing and importing should be covered by RBAC and not allowed by default
  2. there should be a separate permission for each of them

references

refs which are related - while not covering 100% the above:

@steadfasterX steadfasterX changed the title feature request: sharing task templates feature request: share/import task templates Jul 15, 2023
@ansibleguy
Copy link
Contributor

ansibleguy commented Jul 19, 2023

Greetings.

Interesting idea. This would also allow for easier support of users as they can share their bugged config.

After reading into the codebase a little:

  • If one ignores the 'Key Store' completely - the export should be pretty easy to do. As it just the information that is displayed inside the template-form the same API calls should do to pull the needed information.
  • 'Copy Button' - I would export the information as plain JSON text as the JS frontend can work with it easily
  • 'Paste Button' - Could just fill in the JSON data (from clipboard) into the form

But as the project currently seems to lack 'manpower' and this feature is only a small improvement for edge-cases - I would not get my hopes up.

- AnsibleGuy

@steadfasterX
Copy link
Contributor Author

thx for investigating this :) yea I hope it will come nevertheless one day :D

@parkjaeil0x01
Copy link

As someone who views the project as a single site (server) and uses this ansible semaphore, the project replication function is very much needed.
Until now, we have been manually creating projects one by one and entering the necessary information into them.
I hope there will be a project duplication function.

@Pshemas
Copy link
Contributor

Pshemas commented Sep 26, 2023

as I mentioned in 1514 for me the way to go would be to have an ability to create tasks in the Semaphore UI based on the contents in the repo.

For example I have a Github repository where I store some of the playbooks I've used via command line. Currently to have them show up in Semaphore I have to create a task template for every playbook file by hand, one by one... .which is crazy waste of time. Some sort of "repo sync" button that would show you available tasks to import (checkbox etc - as you need to make sure that other yaml files won't be confused with playbooks) would be a godsend :) .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: No status
Development

No branches or pull requests

5 participants