ansible-role-elasticsearch-curator icon indicating copy to clipboard operation
ansible-role-elasticsearch-curator copied to clipboard

Creating multiple action files in `elasticsearch_curator_action_yaml`

Open nightguide opened this issue 3 years ago • 0 comments

Hi Jeff!

Thank you for the excellent ansible role for curator provisioning.

I ran into a problem that this role does not support the ability to create multiple action files.

I will give an example when it is necessary.

I want to create elastic backups and also rotate them: daily, weekly, monthly. But since there is only one action file, I will not be able to separate these schedules

As a workaround, I can use elasticsearch_curator_cron_jobs.job and pass the command there with the necessary arguments. But when there are too many of them, it doesn't look very nice.

I think it would be nice to use the elasticsearch_curator_action_yaml section, like this:

elasticsearch_curator_action_yaml:
  daily.yml:
     ...
  weekly.yml:
     ...
  monthly.yml:
    ...

and then use them in crontab

---
elasticsearch_curator_cron_jobs:
  - name: "Run elasticsearch curator actions (daily)."
    job: "/usr/local/bin/curator ~/.curator/daily.yml"
    state: present
    minute: 0
    hour: 0
  - name: "Run elasticsearch curator actions (weekly)."
    job: "/usr/local/bin/curator ~/.curator/weekly.yml"
    state: present
    minute: 0
    hour: 0
    weekday: Fri
  - name: "Run elasticsearch curator actions (monthly)."
    job: "/usr/local/bin/curator ~/.curator/monthly.yml"
    state: present
    minute: 0
    hour: 0
    day: 1

nightguide avatar Aug 15 '22 06:08 nightguide