-
-
Notifications
You must be signed in to change notification settings - Fork 53
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
integrate just roles as pre-task on localhost #170
base: main
Are you sure you want to change the base?
Conversation
I see a few problems with this:
The optimization feature (see |
I didn't know the just optimize command and the other just commands before. Would a second file in the playbook root directory next to the setup.yml be a solution that can call the individual just commands? So that the file always exists and can create and optimize the setup.yml? Or should I simply close the PR and write my own little playbook for exactly this purpose? |
I suppose a new
This can also be invoked with a single Doing that, you won't need to manually copy template files, etc, since these
I suppose Semaphore can only be configured to invoke a single playbook, so if it invokes |
I have created a first draft for an init.yml that contains the individual just commands. However, I see two problems when running just install-all or setup-all: If I interpret the behavior of Semaphore correctly, the ansible-playbook is called with additional variables for authentication and is not set up globally on the host. Accordingly, you would have to extend the install-all and setup-all task with both via variables In addition, you cannot use the web interface for the variables. Accordingly, you would have to set and manage the variables at file level. In my opinion, a cleaner solution would therefore be to use two playbooks or two tasks in one playbook, from which the init.yml playbook initializes the other playbook and then starts the setup.yml via a semaphore API call. However, the setup.yml is called directly by ansible with the appropriate tags. |
The just commands do not work in the semaphore container, regardless of whether this is executed in a /tmp or a bind mount.
I can't find a solution for this at the moment. If you copy the requirements file into the roles folder and add rolename If the init.yml creates the files accordingly, the playbook could update itself. |
This PR allows the playbook to install the roles itself via ansible galaxy, so that ansible semaphore should be able to update and run the playbook automatically.
The role also updates the templates, even if a change to the setup.yml only takes effect when the playbook is executed a second time
I have not yet tested the interaction with ansible semaphore, locally this works with ansible-playbook -i inventory/hosts setup.yml --tags=install-all,roles,start
I'm not sure if this PR is in your interest, if not, I can also spin it off into a small playbook of my own.
related to mother-of-all-self-hosting/ansible-role-semaphore#2