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

Seed plugin ansible content #18844

Merged
merged 5 commits into from
Jun 11, 2019

Conversation

carbonin
Copy link
Member

@carbonin carbonin commented Jun 7, 2019

This allows plugins (like manageiq-content) to provide ansible playbooks and roles to embedded ansible.

The directory trees at /content/ansible in the plugins will be merged into the /content/ansible_consolidated directory in the manageiq repo root directory. From there the roles directory should be added to the roles_path in your local ansible config (and is added to the path on the appliance by the changes in ManageIQ/manageiq-appliance#240) so that all playbooks will have access to the roles provided by plugins.

The playbooks in the /content/ansible_consolidated directory will be available in a special playbook repository and can be used as targets for service templates and/or automate methods.

NOTE: As of now, plugin roles are not fetched from ansible-galaxy if a requirements file is provided.

@@ -1,5 +1,7 @@
module Ansible
class Content
PLUGIN_CONTENT_DIR = Rails.root.join("content", "ansible").to_s.freeze
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about this directory because we always intended that the content directory of manageiq core could also be pluggable (that is, it could bring its own content things as well). We might want another directory that's not /content

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I'm fine with putting this somewhere else, but I wanted it to be in the source tree so that we could get at it when running locally.

That said, even if there were playbooks here as you describe, the behavior wouldn't really be any different right? We would then just have to copy those from here to the new location anyway so I don't really see any harm in keeping this.

@Fryguy
Copy link
Member

Fryguy commented Jun 7, 2019

Overall looks good, but I'm not sure about the location or the timing of when it's run.

private

def create_local_playbook_repo
Ansible::Content.consolidate_plugin_playbooks
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're still looking for names... mishmash, mingle, hodgepodge, amalgam, merge

@carbonin carbonin force-pushed the seed_plugin_ansible_content branch 2 times, most recently from f40b9b4 to 2487556 Compare June 10, 2019 19:43
carbonin added 4 commits June 11, 2019 11:45
This will be used for downloading roles for user-provided
ansible content as well as content provided by plugins.
The roles dir in this directory should be added to the default
roles search path for your ansible config to make the roles
provided by plugins available for all playbook runs.

This is done on the appliance in the /root/.ansible.cfg file,
but for local development you will need to make this configuration
change manually in whatever way seems best for you.
This repo will contain any ansible content from plugins which
want playbooks exposed directly to users for use as service targets
or from within automate.
This is because in the future content/ansible should be reserved
for when the manageiq core repo wants to provide playbooks to the
repo we make out of all the plugin repos
@carbonin carbonin force-pushed the seed_plugin_ansible_content branch from 2487556 to 1078773 Compare June 11, 2019 15:45
@carbonin carbonin changed the title [WIP] Seed plugin ansible content Seed plugin ansible content Jun 11, 2019
@carbonin carbonin force-pushed the seed_plugin_ansible_content branch from 1078773 to 6296ce5 Compare June 11, 2019 17:57
@miq-bot
Copy link
Member

miq-bot commented Jun 11, 2019

Some comments on commits carbonin/manageiq@70f8291~...6296ce5

lib/tasks/evm_ansible_runner.rake

  • ⚠️ - 11 - Detected puts. Remove all debugging statements.

@miq-bot
Copy link
Member

miq-bot commented Jun 11, 2019

Checked commits carbonin/manageiq@70f8291~...6296ce5 with ruby 2.3.3, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0
4 files checked, 0 offenses detected
Everything looks fine. 👍

@carbonin
Copy link
Member Author

@Fryguy @NickLaMuro Any other thoughts on this one?

@carbonin carbonin requested a review from NickLaMuro June 11, 2019 18:47
@Fryguy Fryguy merged commit f812391 into ManageIQ:master Jun 11, 2019
@Fryguy Fryguy added this to the Sprint 114 Ending Jun 24, 2019 milestone Jun 11, 2019
@carbonin carbonin deleted the seed_plugin_ansible_content branch August 16, 2019 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants