You could modify a file with a result when you run a step and use the
'stat' module to check the mtime of the file.




On Fri, Jun 13, 2014 at 5:15 AM, Azul <m...@azulinho.com> wrote:

> sorted,
>
> +  15 - name: check when we last downloaded from upstream
>
> +  14   command: find /var/tmp/ -atime 1 -name "last-upstream-fetch"
>
> +  13   register: result
>
> +  12   ignore_errors: true
>
> +  11
>
>    10 - include: sync-upstream-repositories.yaml
>
> +   9   when: result != '/var/tmp/last-upstream-fetch'
>                8
>
>     7 - include: sync-python-repositories.yaml
>
> +   6   when: result != '/var/tmp/last-upstream-fetch'
>
>     5
>
>     4 - include: update-yum-repos-metadata.yaml
>
> +   3   when: result != '/var/tmp/last-upstream-fetch'
>
> +   2
>
> +   1 - name: update /var/tmp/last-upstream-fetch
>
> + 26    command: touch /var/tmp/last-upstream-fetch
>
>     1
>
>
>
>
> On 12 June 2014 18:34, Azul Inho <m...@azulinho.com> wrote:
>
>> Hi there,
>>
>> I saw an example sometime ago, either a thread,blog or IRC about
>> executing a single task in a playbook only once every 24 hours.
>> Can't find that example anywhere,
>>
>> has anyone here has an example of how to achieve this ?
>>
>> I have a task that syncs a mirror with a bunch of upstream repos, and I
>> need to run the playbook for that role fairly frequently but I need to be
>> polite and not try to contact the upstream mirrors every time I run that
>> playbook.
>>
>>
>> thanks
>>
>> --
>> 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/TNlc-pZeBV0/unsubscribe
>> .
>> To unsubscribe from this group and all its topics, 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/01c07036-fd61-4ad8-8296-1d018c792b25%40googlegroups.com
>> <https://groups.google.com/d/msgid/ansible-project/01c07036-fd61-4ad8-8296-1d018c792b25%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 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/CAMP%3Dowi6mt6i9JuGG0vkMYHVxRgYsVHVTUF55KT81oxSqMeHPg%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CAMP%3Dowi6mt6i9JuGG0vkMYHVxRgYsVHVTUF55KT81oxSqMeHPg%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 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/CA%2BnsWgzb_Mzg6S5%3D_sBxj4wx82enxq5xAd4rjQoAdWwfMYdAuQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to