Replies: 0 comments 4 replies
-
|
This discussion is a continuation of retronas/retronas#25 |
Beta Was this translation helpful? Give feedback.
-
|
I created a little demonstration in retronas/retronas#44 To test:
More tests:
Notes:
|
Beta Was this translation helpful? Give feedback.
-
|
I am planning changes to they way items are launched so they are uniform across the TUI/WUI using keywords instead of commands and offloaded to an ansible_runner script, this is an intermediate step with the intent that when we get back to looking at roles the keyword approach should be interchangeable with tags. So the theory goes, lets see if it plays out. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am in love with this project, and i'm also in love with Ansible.
At the current stage of the project, I think that having most of the logic in playbooks will lead to future problems, such as disaster recovery or update difficultie
I also think the current system with shell scripts and dialog is an excellent solution that offers great possibilities and should be future-proof.
I have a lot of experience with Ansible, so it's possible that these changes seem simple to me while it may not be so clear to you, and I apologize for that. Please note that I am offering my help in making these changes, I am also willing to make them if you are comfortable with the demonstration.
About the changes I want to propose.
At first, create a single playbook and move current logic in different roles.
The syntax is roughly the same between playbook and roles.
In this playbook, we add tags on each entry, one for each role.
Then, update the shell scripts to call tag instead of different playbook.yml (doc: https://docs.ansible.com/ansible/latest/user_guide/playbooks_tags.html)
For example, if we move
install_cockpit.ymlinside a role with the tag "cockpit" in the mainplaybook.yml, we can call this role with the command :ansible-playbook -t cockpit playbook.ymland this is where the magic start to shine, we can call multiple tags in one command,ansible-playbook -t cockpit,samba playbook.ymlNext step of the magic, we can also use host variables to further simplify the operation (doc: https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html#adding-variables-to-inventory).
For example, we set in the playbook the "cockpit" role is attached to the variable "cockpit", then in the inventory, we add the variable "cockpit" to the host localhost.
The variable file is a plain ini file or a yaml file, and since the file will be saved on disk, the user's configuration will persist.
Then we only have to run
ansible-playbook playbook.ymlto apply the exact same configuration each time, permitting the user to update his installation with a simple and unique command.The conversion from playbook to role can be done one playbook at a time and with minor modifications each time.
There is many other things we can do with Ansible, but I suggest to keep it simple.
Thank you so much for your time, I look forward to discussing this topic with each of you.
Beta Was this translation helpful? Give feedback.
All reactions