Michael DeHaan <[email protected]> napisał: >I would not recommend using a seperate branch unless there are seperate >versions of the product, branching is great for versions, not great for >environments. What do you think about having a staging branch that's followed by a production one? Then production would have an easy to see "lag", and could even have custom hotfixes. I've seen this model work for web apps versioning, and I wonder if it's recommended for Ansible.
It would still use the standard mechanisms (separate inventories, group/host vars) for differences between those environments in configuration, but not for difference in time when the configuration was deployed. >Differences in environment should be modelled by differences in >group_variables where possible -- and possibly in a slightly different >top >level playbook, all leveraging many common roles. > >Then it's just > >ansible-playbook site.yml -i production > >vs > >ansible-playbook site.yml -i stage > > > > >On Tue, Apr 1, 2014 at 5:35 PM, Alex King <[email protected]> wrote: > >> Hi, I'm new to ansible but liking what I see so far. I'm using it to >> configure a bunch of machines acting as routers across a region, and >I like >> the model so far. >> >> Now I'm trying to set up a couple of machines as a staging >environment so >> I can check out configuration changes before I push them to >production >> machines. >> >> In http://docs.ansible.com/playbooks_best_practices.html a separate >> inventory file for stage and production is recommended. >> OK, but how do I actually apply a different configuration to the >staging >> machines from production? I see further down it's recommended to >keep the >> playbooks and inventory files in git. Am I supposed to branch the >whole >> thing and use a test branch which gets applied to staging machines? >Or is >> there an ansible feature to switch between staging and production? >> >> I have a simple file copy which I want to do different on staging vs. >> production. I could set up a template and choose different content >> depending on whether we're deploying to staging or production, but >that >> seems the wrong way to do it. It's really just a different version >of the >> same file, and I want to choose one version for staging servers and >another >> for production. >> >> How do others do this? >> >> Cheers, >> Alex >> >> -- >> 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 [email protected]. >> To post to this group, send email to >[email protected]. >> To view this discussion on the web visit >> >https://groups.google.com/d/msgid/ansible-project/2423c0ad-5a15-4d32-be13-0535344fe7bd%40googlegroups.com<https://groups.google.com/d/msgid/ansible-project/2423c0ad-5a15-4d32-be13-0535344fe7bd%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> -- Wysłane za pomocą K-9 Mail. -- 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 [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/9b731735-3c6c-4c85-be2d-cc9a8434e5be%40email.android.com. For more options, visit https://groups.google.com/d/optout.
