-
Notifications
You must be signed in to change notification settings - Fork 898
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
Expose plugin ansible content consolidation as a rake task #17407
Expose plugin ansible content consolidation as a rake task #17407
Conversation
Looks good so far. I'm guessing that since we gate |
This only applies to the appliance version of embedded ansible so it makes more sense for the logic to live here rather than in the worker which should only be responsible for creating the repo in the provider. https://www.pivotaltracker.com/story/show/157313841
This task will be used to create an rpm for providing plugin ansible content to the embedded ansible container image https://www.pivotaltracker.com/story/show/157313841
a52eede
to
9b6fe1e
Compare
I think this will still fail for ManageIQ, but it was already failing before this change for other reasons. |
Removing WIP after testing this out on an appliance 👍 |
Rugged::Commit.create(repo, options) | ||
end | ||
|
||
FileUtils.chown_R('awx', 'awx', playbook_repo_path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does awx own the repo? I know that was there before, but that doesn't make any sense to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jrafanie ? I know the tower processes run as the awx user, but if it's just copying off the files it seems like it wouldn't need to own the directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The assumption was the awx user would be reading this git repo's path when we posted this local path for the new project. If it has permission to read in all situations, then this can be removed.
task :write_plugin_ansible_content => :environment do | ||
dest_dir = ENV["ANSIBLE_CONTENT_DIR"] || Rails.root.join("tmp", "ansible_content") | ||
EmbeddedAnsible.consolidate_plugin_playbooks(dest_dir) | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, this just copies the content but doesn't set up git?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct.
options[:author] = options[:committer] = { :email => "system@localhost", :name => "System", :time => Time.now.utc } | ||
options[:message] = "Initial Commit" | ||
options[:parents] = [] | ||
options[:update_ref] = 'HEAD' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm surprised there isn't a master branch. Does awx/tower only reference the HEAD commit anyway?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a master branch after everything is set up. Is that just the default behavior?
[root@localhost ~]# cd /var/lib/awx_consolidated_source/
[root@localhost awx_consolidated_source]# git status
# On branch master
nothing to commit, working directory clean
[root@localhost awx_consolidated_source]# git log
commit 882ea0dbf707c366de82655bd1b74376ccf1d712
Author: System <system@localhost>
Date: Mon May 14 19:06:53 2018 +0000
Initial Commit
[root@localhost awx_consolidated_source]#
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this is probably using the default behavior.
Looks good @carbonin. Most of my questions are on the existing implementation, so no need to hold up this PR for those. The only one I'm really curious about is #17407 (review) |
@jrafanie did you get a chance to take a look at this? I think this one is ready to go. |
@carbonin still failing
Can that test just be deleted now that containers aren't skipped? ^ |
…repo This is currently the case for DockerEmbeddedAnsible and ContainerEmbeddedAnsible so this will allow those cases to continue without the default project
db7c6f6
to
f8568b9
Compare
Checked commits carbonin/manageiq@8c32282~...f8568b9 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
Changing this to gaprindashvili/yes as not having this is breaking DockerEmbeddedAnsible with AWX. The error looks like this:
|
This will allow us to pull the set of ansible content provided by our plugins together at build time to provide the data to build an rpm.
This rpm can then be used in the embedded ansible container image to provide plugin ansible content when embedded ansible does not share a file system with the manageiq application at runtime.