[ansible-project] Re: Delete based on directory size

2019-05-11 Thread Dan Linder
Does this help? I created a directory structure with four files: $ find /tmp/dirsize/ -ls | cut -c 18- drwxrwxr-x 5 dan dan 100 May 11 14:59 /tmp/dirsize/ drwxrwxr-x 2 dan dan60 May 11 15:00 /tmp/dirsize/d3 -rw-rw-r-- 1 dan dan 5242880 May 11

Re: [ansible-project] How to choose the var list based on a condition

2019-05-11 Thread Kai Stian Olstad
On 11.05.2019 20:40, Saranya N wrote: > I have a list of dictionary variables something like below in vars file. > > App01: > A : value1 > B : value2 > C : value3 > > App02: >A : value4 >C : value5 >B : value6 > > And so on... > > When I run my playbook with -e option app=01

[ansible-project] How to choose the var list based on a condition

2019-05-11 Thread Saranya N
I have a list of dictionary variables something like below in vars file. App01: A : value1 B : value2 C : value3 App02: A : value4 C : value5 B : value6 And so on... When I run my playbook with -e option app=01 or app=App01 I want to use App01 variables in with_items in my task .

[ansible-project] set_facts with if-else clause, also check if the var contains digits?

2019-05-11 Thread Ansar Sahit
Im trying to set a variable based on below condition where templname is an external variable with below options ansible-playbook -i hosts -e "templname=CTrl03_kerbs_09" OR ansible-playbook -i hosts -e "templname=CTrl05" set_fact: dbn: "{{ CTrl03_kerbs_09 | lower }} dbnum: "{ %

Re: [ansible-project] ansible cron with 2.8rc3

2019-05-11 Thread Kai Stian Olstad
On 11.05.2019 19:15, Kai Stian Olstad wrote: > On 11.05.2019 18:38, Michael Ströder wrote: >> I'm testing my ansible roles with ansible 2.8rc3. >> The roles work with ansible 2.7.10. >> >> This cron task fails with 2.8rc3 using Python 2.7.16 (see details >> attached at message end): >> >> - name:

Re: [ansible-project] ansible cron with 2.8rc3

2019-05-11 Thread Kai Stian Olstad
On 11.05.2019 18:38, Michael Ströder wrote: > I'm testing my ansible roles with ansible 2.8rc3. > The roles work with ansible 2.7.10. > > This cron task fails with 2.8rc3 using Python 2.7.16 (see details > attached at message end): > > - name: "Remove obsolete CRON jobs from

[ansible-project] ansible cron with 2.8rc3

2019-05-11 Thread Michael Ströder
HI! I'm testing my ansible roles with ansible 2.8rc3. The roles work with ansible 2.7.10. This cron task fails with 2.8rc3 using Python 2.7.16 (see details attached at message end): - name: "Remove obsolete CRON jobs from /etc/cron.d/aedir_tools" cron: name: "{{ item }}" state: absent

[ansible-project] Delete based on directory size

2019-05-11 Thread Nicholas Britton
I have been looking for a module for something similar to the du command. I would like to have a play that looks at the log directory to detect if it's a certian size or larger and if so find the sub folders with gbs of data and remove or tar that data up. So far I am not finding that and