Looks like it's going to be possible in v2.0.

Move tasks that should be done in 'serial: 1' mode to a separate file. 
Include it with items iterating over hosts in a group and set some variable 
to a host name. Add to files in a separate task condition to check if 
hostname is similar to that variable.

On Wednesday, April 9, 2014 at 4:33:11 PM UTC+3, Michael DeHaan wrote:
>
> Yes, the play could just have one task in it.
>
> A serial task in the middle of several non-serial ones would look like 
> this in a single playbook file.
>
> - hosts: webservers
>   tasks:
>     -
>     -
>     -
>
> - hosts: webservers
>   serial: 1
>   tasks:
>    -
>  
> - hosts: webservers
>
>
>
>
> On Sun, Apr 6, 2014 at 11:10 AM, Paul Durivage <[email protected] 
> <javascript:>> wrote:
>
>> Correct, a task does not allow the keyword serial to be defined on it. 
>>  There's no need to define an entirely new playbook, but you will have to 
>> declare a new play.
>>
>>
>> On Fri, Apr 4, 2014 at 12:39 PM, Khaled Janania <[email protected] 
>> <javascript:>> wrote:
>>
>>> The documentation doesn't really answer the question though.  Does that 
>>> mean there's no way to define one task as serial?  In other words, serial 
>>> only applies for all tasks?
>>>
>>> On Thursday, January 23, 2014 8:06:38 PM UTC-5, Michael DeHaan wrote:
>>>>
>>>> That's a pretty old post.
>>>>
>>>> You should read up on the "serial:" keyword in Ansible.
>>>>
>>>> http://docs.ansible.com/playbooks_delegation.html#id6
>>>>
>>>> serial: 1
>>>>
>>>>
>>>> On Thu, Jan 23, 2014 at 6:53 PM, Mike Sop <[email protected]> wrote:
>>>>
>>>>> Came across another ticket describing a change to make a "playbook" 
>>>>> serial (I'm guessing that means all tasks in the playbook): 
>>>>> https://groups.google.com/forum/#!searchin/
>>>>> ansible-project/task$20serial/ansible-project/ZrSuwsqv1m8/-o-bJTQuJnUJ
>>>>>
>>>>> would like to have more granular control and just specify particular 
>>>>> task(s) as serial, is that possible?  Perhaps the intended way of doing 
>>>>> this is to create a new playbook for those particular tasks?  Seems like 
>>>>> overkill but am willing to give it a shot (beats having to run ALL my 
>>>>> tasks 
>>>>> with forks 1 or serial 1)
>>>>>  
>>>>> -- 
>>>>> 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].
>>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>>
>>>>
>>>>
>>>>
>>>> -- 
>>>> Michael DeHaan <[email protected]>
>>>> CTO, AnsibleWorks, Inc.
>>>> http://www.ansibleworks.com/
>>>>
>>>>   -- 
>>> 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] <javascript:>.
>>> To post to this group, send email to [email protected] 
>>> <javascript:>.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/ansible-project/9cb5a77d-5d06-4b90-bb4a-94f480cac288%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/ansible-project/9cb5a77d-5d06-4b90-bb4a-94f480cac288%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> 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] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/CAK6JQEFjMyytfHWENpESJFh30eO9zJzKw0R9SxeoeYeBMWhsVQ%40mail.gmail.com
>>  
>> <https://groups.google.com/d/msgid/ansible-project/CAK6JQEFjMyytfHWENpESJFh30eO9zJzKw0R9SxeoeYeBMWhsVQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>> 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/397d2078-1ed6-414b-b856-27ef4522ab99%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to