Story #4494
closedAs a plugin writer, I can add custom installation steps
100%
Description
If any plugin has special installation steps, currently there is no way to add those per plugin basis.
E.g. for RPM plugin some build dependencies should be installed before createrepo_c gets pip-installed.
Related issues
Updated by amacdona@redhat.com almost 6 years ago
What QE is doing with pre_tasks is one way to accomplish this. It's not ideal because it needs to be configured by the user, but I don't see a better way.
Another option could be to add to the plugin variables, like this:
pulp_install_plugins:
pulp_rpm:
app_label: rpm
required_packages:
- gcc
- make
This approach is a little cleaner, but still forces each user to know the dependencies of the pulp_rpm plugin. Note that with either approach, these values may vary depending on the package manager being used by the managed node OS.
Updated by kersom almost 6 years ago
We could have variables to chose what plugin not to install, like create `defaults` pulp_rpm_install: yes, then this could be overwritten doing the playbook call.
ansible-playbook -vvv -i 192.168.122.138 -u root source-install-plugins.yml -e pulp_rpm_install no
This will give more control over what it will be installed.
Not sure if this kind of solution was discussed before.
Updated by jsherril@redhat.com almost 6 years ago
My 2 cents:
- The user shouldn't have to know about these things (or even that an additional playbook is required) The user needing to know anything other than 'i want plugin X' is asking too much.
- Few plugins will require this (maybe i'm wrong?)
- Its okay if there is plugin specific stuff in this module (structure it to make this easy to contribute to)
Updated by ehelms@redhat.com almost 6 years ago
From my experiences, I'll offer up two approaches for plugin writers:
1) Treat ansible-pulp3 as the canonical source for installation and have plugin writers contribute storing all plugin enablement and install in the main pulp3 role
2) Create a role for every plugin and allow simple composition. Plugin writers can contribute their role to the repository itself or publish it independently to be included.
Flexibility can lead to complexity so I caution erring on the side providing a well-defined method more so than a flexible method for plugin authors at the outset.
Updated by ttereshc almost 6 years ago
- Related to Story #4163: As a user, I can install pulp_rpm using the Ansible installer added
Updated by dkliban@redhat.com almost 6 years ago
- Groomed changed from No to Yes
- Sprint Candidate changed from No to Yes
Updated by bmbouter almost 6 years ago
The issue I see with custom plugin steps being added to ansible-pulp3 itself is that we won't be able to handle version changes since ansible-pulp3 can't be versioned with plugin.
Say in plugin foo 0.1 you have to run 'thiscommand' but with 0.2 you have to run 'thatcommand'. The current version of the installer have both so someone is going to end up broken.
For this reason, I believe having the plugin provide a custom role and playbook that calls ansible-pulp3 is the easiest and most viable solution.
Updated by amacdona@redhat.com over 5 years ago
bmbouter, I think that makes sense. So a playbook would be:
- hosts: all
roles:
- pulp-rpm-presteps
- pulp-database
- pulp-workers
- pulp-resource-manager
- pulp-webserver
- pulp-content
Importantly, the pulp-rpm-presteps role would not be included in the ansible-pulp repository, and would be an entirely separate project.
Seems like this means there isn't really anything the installer needs to do other than suggest a role and/or pretasks as a documentation story.
Updated by bmbouter over 5 years ago
@asmacdo what you are describing sounds right.
Updated by amacdona@redhat.com over 5 years ago
This plan is fine for running ansible playbooks directly, but there is still a gap for pulplift, which doesn't allow the user to run a custom playbook before provisioning.
Maybe we could create a new directory of pretasks, and the user could configure which pretasks to include?
For example, as-is, a developer will still have to include custom pretasks (https://github.com/PulpQE/pulp-qe-tools/blob/master/pulp3/install_pulp3/source-install-plugins.yml#L26-L44) in a the playbook (https://github.com/pulp/pulplift/blob/master/playbooks/source-install.yml#L11), which is checked into git, so not ideal.
Updated by bmbouter over 5 years ago
@asmacdo, I see what you are saying.
What about having the rpm aspects install in pulplift using a post_install playbook? https://github.com/theforeman/forklift/#post-install-playbooks
Updated by ppicka over 5 years ago
What about to keep role (or just playbook) with dependencies inside pulp_rpm repository (what I understood we want) and in installer (https://github.com/pulp/ansible-pulp/blob/master/roles/pulp/tasks/install.yml#L112 e.g. above this line) got something like
when: pulp_install_plugins.pulp_rpm is defined
and if true call the playbook from rpm repository. This possibly can avoid conflict in plugin versions and user from adding any pre-task or manually edit dependencies.
Updated by bmbouter over 5 years ago
ppicka, +1 to what you are proposing here.
We should probably start with getting that extra 'rpm install' role into the pulp_rpm repo and then we can add that line here to call it during install time.
I think one of us should pick this up soon to work on it. What do you think?
Updated by rochacbruno over 5 years ago
I have done something similar few months ago using `include_tasks`
there are some related discussion on:
Updated by bmbouter over 5 years ago
ppicka how are you going to have it install the dependencies for Pulp RPM?
After thinking about it I think we should have them install via the rpms available to Fedora and RHEL. This will limit RPM to only running on those distros but from what I'm hearing about libmodulemd not running on other distros I think it's unavoidable at this point.
dalley does this sound right to you also?
Updated by amacdona@redhat.com over 5 years ago
- Blocked by Story #4660: As an ansible-pulp user, I can configure my venv to have system-site-packages enabled added
Updated by ppicka over 5 years ago
- Status changed from ASSIGNED to MODIFIED
- % Done changed from 0 to 100
Applied in changeset commit:pulpcore-plugin|ad5c14604465cb18f2f17b1beb47d0cdb06ab988.
Updated by bmbouter about 5 years ago
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Updated by bmbouter over 4 years ago
- Category set to Installer - Moved to GitHub issues
- Tags deleted (
Pulp 3 installer)