--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
+1 Mark's advice. If your project is laid out appropriately submodules would be a very good fit.
Ali
This sounds more like an SCM issue than an Ansible issue, no?Some thoughts:1) Combine the two projects into one. TBH - not sure why you have them separate, it makes this sort of thing far harder, as you can see.2) Git Submodules (http://git-scm.com/book/en/Git-Tools-Submodules). They can be a little tricky, but they really are designed for this sort of issue.MarkOn Tue, Jun 4, 2013 at 8:20 AM, Michael DeHaan <michael...@gmail.com> wrote:
"I want a convenient way of checking out my infrastructure project into the same workspace as my development project."
I don't know what a workspace is.On Mon, Jun 3, 2013 at 6:19 PM, Steve Moyer <smoy...@gmail.com> wrote:
Yeah ... and the inventory file for any of my projects is pretty short.The real question is (perhaps) more related to managing two Git projects together. I want a convenient way of checking out my infrastructure project into the same workspace as my development project.Steve
On Monday, June 3, 2013 10:08:49 AM UTC-4, Michael DeHaan wrote:You can easily use the same ansible tree with seperate inventory files, just pass in the "-i" flag in each case.On Mon, Jun 3, 2013 at 9:44 AM, Steve Moyer <smoy...@gmail.com> wrote:
First a little background ...
I'm building my staging and production provisioning using Ansible and organized as suggested in the Ansible best practices section of the documentation. My Ansible playbooks are kept in an SCM (Git) repository called infrastructure.
I recently started using Vagrant on my development workstation to allow me to easily create or recreate a clean environment (as a guest VM) on my workstation. I'm storing the required Vagrantfile in SCM (Git) along with my project's files and I want to use Ansible to also provision the Vagrant environment. Since much of the configuration of these guest VMs matches the production environment (that's the whole point right?), I want to use the roles (and associated tasks) that are used to provision the production and staging servers when provisioning the VMs.
So the problem I have is ...
The bulk of my provisioning is organized as recommended in the Infrastructure project's repository, but I need access to those files from each of the projects that spins up guest VM(s) on my development system. Obviously I can check out the infrastructure project and refer to it from the other project (if I'm careful to check the projects out in the same directories), but that's not at all portable. Another alternative is to check out the Infrastructure project as one of the tasks before the Vagrant specific provisioning happens, but that may lead to having multiple copies of the same repository on my HD (not a space problem) and I'm afraid I'd miss updating all of them if the infrastructure project has changes.
Is anyone else using Ansible for both their production provisioning and with Vagrant? What are the best strategies for coping with playbooks/plays/tasks/etc that reside in different Git (or other SCM) repositories?
Thanks,
Steve
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
About the `ansible.use_vagrant_inventory` idea: I also aim at in DRYing at maximum the collaboration between Vagrant and Ansible (at least for playbook development tasks). In Vagrant-1.2 the ansible provisioner, `ansible-playbook` is called for each VM to provision (I guess it is the same with dsander-like vagrant plugin, but I haven't verified yet). In multi-machine mode, that leads vagrant to run ansible-playbook several times against the whole inventory (workflow mismatch between "vagrant vm looping" and "ansible parallelism"). I thus opened https://github.com/mitchellh/vagrant/pull/1723, which meets my needs by generating on the fly a single-host inventory file for each VM to provision. It is quite handy for playbook development (so far, I don't plan to use vagrant for staging/prod site deployments). Of course this approach does not support [host groups].
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
From this thread I notice that there is at the moment two "main" ways for Ansible+Vagrant users, which is quite confusing:
- original Ansible Plugin: https://github.com/dsander/vagrant-ansible (or related forks).
- Ansible provisioner is also part of Vagrant "core" since 1.2: https://github.com/mitchellh/vagrant/pull/1465. But this provisioner does not support (yet) parameters like `ansible.options` or `ansible.hosts`