I’ll try to get some things out of the way before responding to your (B).

About the "rollback”:
The point wasn't really about wether Capistrano does rollbacks or not (I’ll 
accept that they’re not - I’m no expert on the subject), but more about how 
complex things can become if you’re trying to implement a central place for 
“rollback” in Ansible. In essence, avoiding the result of multiple tasks to 
influence flow of the role. Try/except would ease that pain a bit (but it 
wasn’t painful for us _not_ to have a central rollback at all).

About the “action:” syntax idea: 
** never actually used **
It was an idea using (abusing) the old notation of Ansible to allow writing a 
more flexible role in Galaxy. The point is allowing certain moments where the 
consumer of the role can add their own actions, without having to copy the role.
— it is understood that this idea will not work.

** currently used in ansible-project_deploy role **
Having a configurable list, that is used “with_items” and the “command” module 
(could be shell module). The reason is the same, to allow consumers of the role 
to perform commands that are not part of the deploy role by default.

Answer to (B):
We worked hard to make an easy to re-use role. The only things we found worthy 
of adding to a module where:
- state=present: the automatic creation of the folder structure. The module 
will also create a new timestamp and return that in a fact, and delete any 
folders containing a “BUILD_UNFINISHED” file.
- state=clean: the automatic removal of old releases (which also makes 
assumptions on the folder structure).
- state=absent: removal of the entire deploy folder (just to be consistent, 
could be done with the file module already)

None of these are hard to implement - but I tried to show in the article that 
it does clean up the role a bit.

Moving the symlink *could* be part of the module. We didn’t really see a huge 
benefit, it’s just a single task.

All-in-all I think we went with your mantra when people start suggesting deploy 
modules: “It sounds like a role to me”
But the aim was to create a role in Galaxy that can cover most simple deploy 
scenarios.


--  
Ramon de la Fuente  
@f_u_e_n_t_e




On 1 Aug 2014 at 15:12:16, Michael DeHaan ([email protected]) wrote:
> So several things I wanted to comment on.
>  
> (A) What Cap calls rollbacks aren't - it would be a rollback if it
> magically understood how to undo every action. That being said, some sort
> of try/except facility is intended for 1.8. "Rollback" logic is up to
> you, but failing forward is a better approach. The guide on test strategy
> may also be instructive.
>  
> (B) The symlink pattern thing I'd like to make more idiomatic, though I
> don't think it's hard now. This might just be a docs example, but it
> might be a mini-module that has a couple of modes, one that makes a
> timestamp and another that moves the symlink or something. I don't know.
> Example may be sufficient.
>  
> (C) Yes, adding key=value arguments to existing commands must now be
> intercepted for security reasons. In particular this part, which I don't
> really understand what it's doing in the playbook, can't be a thing:
>  
> action: "{{ item.module }} {{ item.parameters }}"
>  
>  
>  
> In all though, the topic I want to concentrate on the most is (B). If we
> were to make a module or two to make the "timestamp'd symlink thing" more
> idiomatic, what might the syntax look like, etc?
>  
> One of the major goals of Ansible is to not need another deployment tool on
> top, like Cap. In most cases, people are already able to drop Fabric/Cap -
> I'd say it's significantly more common for people to adopt ansible for
> application deployment needs initially - and especially with regard to load
> balancing and such it was designed for the purpose.
>  
> So the question is, how do we make that even easier?
>  
>  
>  
>  
>  
>  
> On Fri, Aug 1, 2014 at 8:31 AM, wrote:
>  
> > Hey All,
> >
> > I posted some thoughts on deploying with Ansible, specifically some
> > problems we tried to solve converting from Capistrano:
> >
> >
> > http://www.future500.nl/articles/2014/07/thoughts-on-deploying-with-ansible/
> >   
> >
> > Michael de Haan pointed out that some of our "solutions" are deprecated
> > for security reasons, so I post here to discuss other options, and
> > deploying with Ansible in general.
> >
> > Here is the role on ansible-galaxy:
> > https://galaxy.ansible.com/list#/roles/732
> >
> > I'd like to point to the "deploy" module specifically:
> > https://github.com/f500/ansible-project_deploy/blob/master/library/deploy  
> > - it creates a folder structure
> > - it generates a timestamp
> > - it generates facts (including the generated timestamp)
> > - it can remove *n* releases
> >
> > Perhaps that does some work that makes life easier for deploys?
> >
> > --
> > 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/c0234581-5a8d-4797-b35f-fd8756d721e3%40googlegroups.com
> >   
> >  
> > .
> > For more options, visit https://groups.google.com/d/optout.
> >
>  
> --
> You received this message because you are subscribed to a topic in the Google 
> Groups "Ansible  
> Project" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/ansible-project/R3Kr2uMYUt4/unsubscribe.  
> To unsubscribe from this group and all its topics, 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/CA%2BnsWgyrUSK0cqCi8Y_3VBXj%2BaGM%3DhZ5HTb6vt_Ej%2Bs9Agu8LQ%40mail.gmail.com.
>   
> For more options, visit https://groups.google.com/d/optout.
>  

-- 
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/etPan.53df94a0.79e2a9e3.1519%40fzzbook.lan.
For more options, visit https://groups.google.com/d/optout.

Reply via email to