Hi Everyone,

I have an ansible playbook which will be used to take AMI snapshot of EC2 
instance *every month* in a year.

Now i got a new requirement that snapshot should not be taken for every 
month and it should for 3 months once. I checked *ansible_date_time *but 
did not see the logic to take every 3 months. It has just day, month and 
yearly like* ansible_date_time.month. *

*here is my playbook (variable calls from template).* Is there any way to 
take snapshot for every 3 months. It would be grateful if anyone could 
answer.

*------------------------*

- hosts: localhost  connection: local  vars:    - ami_instance_id: null    - 
ami_date: "{{ ansible_date_time.month }}{{ ansible_date_time.year }}"    - 
ami_name: null    - ami_service: null  tasks:    - name: create AMI      
ec2_ami:        instance_id: "{{ ami_instance_id }}"        wait: yes        
name: "{{ ami_name }}_{{ ami_date }}"        region: us-east-1        tags:     
     Name: "{{ ami_name }}_{{ ami_date }}"          Service: "{{ ami_service 
}}"      register: instance    - debug: var=instance


---------------------------------

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/04ff7423-48e0-49c1-a437-bba0e14c9159%40googlegroups.com.

Reply via email to