Re: [ansible-project] How to configure playbook serial value by group var from inventory file?

2018-04-20 Thread Deepesh Jakkal
So Brain, how do we provide a serial value then? I also want to externalize 
it so that our operator can configure it. 
Currently the way it supports is using extra variables --extra-vars.

Thanks and Regards,
Deepesh


On Friday, February 9, 2018 at 10:44:10 PM UTC+5:30, Bing Hsueh wrote:
>
> Thanks for the explaination.
> Now I know the reason why I cannot set the value from inventory file.
>
> And also thanks for branko to point out the inconsistence of variable 
> names, I didn't notice that. :p
>
> Brian Coca於 2018年2月9日星期五 UTC+8下午11時08分27秒寫道:
>>
>> This is because serial is a play level keyword and must be the same 
>> for ALL hosts in play, so inventory data cannot be used to set it. 
>>
>>
>> You cannot set 'batches' of hosts for all play if the batch size keeps 
>> changing per host. 
>>
>>
>>
>>
>> -- 
>> -- 
>> Brian Coca 
>>
>

-- 
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-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/3d83701d-48c1-4bc9-9359-d579822e7b7a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] How to configure playbook serial value by group var from inventory file?

2018-02-09 Thread Bing Hsueh
Thanks for the explaination.
Now I know the reason why I cannot set the value from inventory file.

And also thanks for branko to point out the inconsistence of variable 
names, I didn't notice that. :p

Brian Coca於 2018年2月9日星期五 UTC+8下午11時08分27秒寫道:
>
> This is because serial is a play level keyword and must be the same 
> for ALL hosts in play, so inventory data cannot be used to set it. 
>
>
> You cannot set 'batches' of hosts for all play if the batch size keeps 
> changing per host. 
>
>
>
>
> -- 
> -- 
> Brian Coca 
>

-- 
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-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/8f7a5c47-b1d9-471f-968a-487f4af1d27e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] How to configure playbook serial value by group var from inventory file?

2018-02-09 Thread Brian Coca
This is because serial is a play level keyword and must be the same
for ALL hosts in play, so inventory data cannot be used to set it.


You cannot set 'batches' of hosts for all play if the batch size keeps
changing per host.




-- 
--
Brian Coca

-- 
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-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CACVha7ef3JhEDjHhaFqToFFHFxNcrFfZ%2BkwggKteYtaPgPfdDQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] How to configure playbook serial value by group var from inventory file?

2018-02-09 Thread Branko Majic
On Fri, 9 Feb 2018 01:35:08 -0800 (PST)
Bing Hsueh  wrote:

> > ERROR! The field 'serial' has an invalid value, which includes an   
> >> undefined variable. The error was: 'batch_deploy' is undefined  

Ansible is complaining that you are referencing a variable
"batch_deploy", and that it is not defined anywhere.

> inventory.yml
> ---
> deployservers:
> vars:
>  deploy_batch: 1

Here, the variable is called "deploy_batch".

> playbook.yml
> ---
>   - name: test rolling update by batch size
> hosts: deployservers
> serial: "{{ batch_deploy }}"

Here, the variable is called "batch_deploy". E.g. not the same as in
the inventory file (swapped batch/deploy in the name).

Best regards

-- 
Branko Majic
XMPP: bra...@majic.rs
Please use only Free formats when sending attachments to me.

Бранко Мајић
XMPP: bra...@majic.rs
Молим вас да додатке шаљете искључиво у слободним форматима.

-- 
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-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/20180209134043.594aa837%40majic.rs.
For more options, visit https://groups.google.com/d/optout.