Quantcast
Channel: linuxadmin: Expanding Linux SysAdmin knowledge
Viewing all articles
Browse latest Browse all 17854

Ansible playbook doubt

$
0
0

Hi,

I recently started using ansible and I have created many small playbooks so far to manage my day to day tasks(like - copy a script to all/selective nodes with backup, restarting a service, executing a script remotely, shell module, synchronize module etc). But now I am stuck at a simple task.

Here the scenario is - I have 20 machines which are running identical applications and a cron job takes a backup of most of our important files, db etc and create a backup file at say /mnt/backup location with name backup_20160531.tgz. Now I want to fetch daily backup from all machines to a central location. Local machine keeps 5 days backup and deletes the older files daily. I want to pass the system date in my ansible script so that only that day's backup file will be copied (fetch /synchronize) to central location.

So far I have created a playbooks which is able to fetch the exact name filename from each machine. But how can I modify it to be able to pass the system date in file name?

Or is there any other easy way to achieve this?

submitted by /u/xmen81
[link] [comments]

Viewing all articles
Browse latest Browse all 17854