Description of problem: Working with public sector clients, I am often asked to stand up CloudForms in a disconnected environment with no internet access for proof of concepts. Oftentimes, these environments have no internal git infrastructure in place. As we start to plan out POCs based on CloudForms 4.5, I've begun thinking how I will handle importing Ansible playbooks for proving out functionality of embedded Ansible. I see that there is a URL validator rule in place (opt/rh/cfme-gemset/bundler/gems/manageiq-ui-classic-1048ffdbd63f/app/views/ansible_repository/_repository_form.html.haml) which only allows HTTP or HTTPS git repos to be added. As an addendum to https://bugzilla.redhat.com/show_bug.cgi?id=1452584, I'd ask that we able to add local file system git repos as well, so we can simply copy playbooks to the appliance with the Ansible role and initialize the directory. Version-Release number of selected component (if applicable): 5.8.x How reproducible: Always Steps to Reproduce: 1. Try add an Ansible repository prefixed with file:/// 2. Message will display indicating repos must be http or https: Actual results: Can not add local file system repo Expected results: Would like to have to the option to use local file system for playbooks as the backend supports it. Additional info: I removed the validator rule in a test env (line 55 of the indicated file), and was able to create local file system repos. Functions as expected without the url-validator in place.
This is a RFE. I am assigning to John to decide on 1. if we want to support this 2. and assign a PM score for priority assessment. regards, James
Pavol, Can you please test this against upstream 5.10 build? - Sudhir
Pavol...it seems there was a miscommunication and we didn't give the steps on what we expected you to test. We know it doesn't work through the UI, but since this is for POC/demo purposes, it doesn't *have* to work through the UI. That is, someone will be SSHing or SCPing into the appliance anyway, so we can give a tool or set of steps to make it work. There are 2 approaches, if you could test them out: 1) Reusing an existing content/ansible directory to leverage built-in EmbeddedAnsible seeding. a) Copying the playbooks into an existing /content/ansible directory, (I think /opt/rh/cfme-gemset/gems/manageiq-content-*/content/ansible should work) b) Enable Embedded Ansible role and let it seed Doing it this way would make the playbooks appear like they came with CloudForms which may or may not be acceptable. We could also tweak the code to allow /var/www/miq/vmdb/content/ansible if it would make things easier. 2) Creating a new "repo" in EmbeddedAnsible a) Enable Embedded Ansible role b) Put the content anywhere on the appliance c) Add repo content to Embedded Ansible git init -q git add . GIT_COMMITTER_NAME="System" GIT_COMMITTER_EMAIL="system@localhost" \ GIT_AUTHOR_NAME="System" GIT_AUTHOR_EMAIL="system@localhost" \ git commit -q -m"Initial Commit" vmdb bin/rails c conn = EmbeddedAnsible.new.api_connection conn.api.projects.create!(:name => "My Project", :scm_type => "git", :scm_url => "file://path/to/git/repo", :scm_update_on_launch => false, :organization => ManageIQ::Providers::EmbeddedAnsible::Provider.first.default_organization)
jritenou are these paths acceptable? The first one has a presentation caveat that I'm not sure you're ok with or not.
I think either one really solves the use case, since this is primarily for demo/POC purposes, as long as we have some way of getting playbooks in without access to github or dependency on a local git service. The only question I have is would the first method allow for adding/updating playbooks after that initial seeding?
Hi Jason, thanks for provided instructions. I tried 1st option and copied my playbooks into /opt/rh/cfme-gemset/gems/manageiq-content-0.1.0/content/ansible and then enabled Ansible Embedded role. I could see playbooks in Automation -> Ansible -> Playboks. When I tried order the service, I could not, because 'Repository' dropdown list required to pick repository. Please see attached screenshot. I will test also second option. Pavol
Created attachment 1456516 [details] catalog item - no repository
Jason, I was able to add local repo by using 2nd method you proposed. I only had to add one '/' so the path looked like this: :scm_url => "file:///path/to/git/repo" Also I had to wait some time for repo to appear in the CFME UI. I tried to force provider refresh from rails console, but I did not know how. Once repo was visible in the UI, I created catalog+catalog item and ordered it. Playbook executed without issues. Pavol
Great! Then we can document that approach (approach number 2), and I think that should be acceptable. If updates are also required while local changes are made, that can easily be fixed by setting `:scm_update_on_launch => true` and of course leaving the on-disk repo in place (probably with a caveat of single-appliance only, or something to that effect). gtanzillo, I'm reassigning back to you to figure out the documentation efforts, since you have that on your plate for the other Ansible RFEs anyway. If you're not the right person, please reassign.
Brad, Check out comment #11 follow Step 2 that Jason lays out.
Jason, Can you follow the steps in comment #11 step 2 Creating a new "repo" in EmbeddedAnsible. Does this answer you need for POC?
Those steps work and are suitable for PoC usage. Thanks!
Verified Version: 5.10.0.24.20181113213923_03b81fd