[ansible-devel] Windows prompt answer

2018-05-11 Thread belajzus
Hi,

How to answer from ansible to prompts during execution of some scripts/tool 
on Windows machine. Is there something similar to except module?

Or how to hack this issue, is there possibility to provide some default 
answer to any question.

Thank you...


-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-devel] Ansible windows

2018-05-02 Thread belajzus
Thank you Karol...

For now I solve this issue using python slicing. That was my backup option. 
But it is pretty weird that Ansible can't work with a comma in creationtime 
instead of a dot. 

Dana srijeda, 2. svibnja 2018. u 16:36:09 UTC+2, korisnik Karol Czeryna 
napisao je:
>
> hint: use replace filter :-) (To replace comma into dot) 
>
> {{ variable | replace(‘,’,’.’) }}   
>
> Probably you’ll need to use set_fact as well. 
>   
> Best, 
> Karol 
>
>
>
> > On 2 May 2018, at 15:21, belajzus > 
> wrote: 
> > 
> > Hi, 
> > 
> > I'm trying to filter files newer than some other file. 
> > 
> > So, I list that file, get his creationtime, after that I calculate the 
> difference between the current time and the creation time of that file. 
> That is the difference in days between today and day when the file is 
> created. 
> > 
> > BUT, I work with fucking windows, and, there I got epoch with comma, not 
> dot. And I'm unable to calculate difference. If I try to get int valčue 
> from epoch, calculated value is zero. 
> > 
> > For example, this is output of setup module on windows: 
> > 
> >"ansible_date_time": { 
> > "date": "2018-05-02", 
> > "day": "02", 
> > "epoch": "1525275022,0416", 
> > 
> > 
> > My idea was to calculate before how much day file was created with 
> following formula: 
> > 
> >   days_since_last_backup: "{{ ((current_epoch|int - 
> item.creationtime|int)/86400)|int }}" 
> > But I got negative value since ansible can't calculate integer value 
> from some variable which has comma in self. 
> > 
> > 
> > So, is there some option to replace in variable/string comma with dot. 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups "Ansible Development" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an email to ansible-deve...@googlegroups.com . 
> > For more options, visit https://groups.google.com/d/optout. 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-devel] Ansible windows

2018-05-02 Thread belajzus
Hi,

I'm trying to filter files newer than some other file.

So, I list that file, get his creationtime, after that I calculate the 
difference between the current time and the creation time of that file. 
That is the difference in days between today and day when the file is 
created.

BUT, I work with fucking windows, and, there I got epoch with comma, not 
dot. And I'm unable to calculate difference. If I try to get int valčue 
from epoch, calculated value is zero.

For example, this is output of setup module on windows:

   "ansible_date_time": {
"date": "2018-05-02",
"day": "02",
"epoch": *"1525275022,0416",*


My idea was to calculate before how much day file was created with 
following formula:

  days_since_last_backup: "{{ ((current_epoch|int - 
item.creationtime|int)/86400)|int }}"
But I got negative value since ansible can't calculate integer value from 
some variable which has comma in self. 


So, is there some option to replace in variable/string comma with dot.

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-devel] Content from multiple hosts to one file

2018-03-07 Thread belajzus
Hi to all,

I need to generate some file, and inside that file is some content from 
multiple hosts.
I've done that using template module, so I generate one file on every host, 
delegate that to localhost, and with assemble module all that files I merge 
to one single file.
Is that OK, or is it the better way to do the same. 
I try with blockinfile module, but it always override current content of 
some file, and I'm not sure is it possible to generate new file with 
blockinfile module. 
I would like to run playbook on the group, collect some data with custom 
facts, and those custom facts from all hosts use to populate one single 
file on control machine for example.

Tnx for any help

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.