diego-treitos / ansible-inventory

Script to manage your Ansible Inventory and also can be used by ansible as a dynamic inventory source

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow adding variables via $EDITOR in yaml format

diego-treitos opened this issue · comments

Adding this feature might create minor troubles with the locks. Here are the options:

  1. Working just like now: Lock -> Open editor -> Save -> Unlock. This will lock the inventory while editing and that is not ideal. A single user could cause a DoS by forgeting to close the editor. (add an edit timeout to improve things a bit?)

  2. Edit asynchronously. Do not lock the inventory and check after closing the editor if the variable was modified. If it wasn't allow the edit. If it was edited, show the new value and give a choice to overwrite. When saving the variable, the inventory will be locked like always. This is more complex but a better solution.

Also

  • Should the editor be optional (need an extra parameter)?
  • Should we allow editing several variables at a time? (this would be cool)