- name: set locale to /etc/cloud/cloud.cfg
  lineinfile: 'dest=/etc/cloud/cloud.cfg line="locale: {{locale}}"'
  tags: aws

- name: set repo_upgrade to /etc/cloud/cloud.cfg
  lineinfile: 'dest=/etc/cloud/cloud.cfg regexp="repo_upgrade\:" line="repo_upgrade: {{repo_upgrade}}"'
  tags: aws

- name: crontab
  cron: name='creates snapshot' job="curl -L https://raw.githubusercontent.com/miya0001/create-snapshot/master/create_snapshot.sh | bash" hour="3" minute="0" user="root" state=present
  when: aws.snapshot | bool 
  tags: aws

- name: aws configure directory
  file: path=/root/.aws state=directory owner=root group=root mode=0755
  tags: aws

- name: copy aws configure file with default region
  template: src=.aws_config.j2 dest=/root/.aws/config owner=root mode=0600
  tags: aws

- name: cloudwatch
  shell: curl -L https://raw.githubusercontent.com/onagatani/cloudwatch-create-alarm/master/cloudwatch-create-alarm | bash /dev/stdin -a {{ server_hostname }} -t {{ server_hostname }} -e {{ alert.email }}
  when: aws.cloudwatch | bool 
  tags: aws
  

- name: set locale to /etc/cloud/cloud.cfg
  lineinfile: 'dest=/etc/cloud/cloud.cfg line="locale: {{locale}}"'
  tags: aws

- name: set repo_upgrade to /etc/cloud/cloud.cfg
  lineinfile: 'dest=/etc/cloud/cloud.cfg regexp="repo_upgrade\:" line="repo_upgrade: {{repo_upgrade}}"'
  tags: aws

- name: crontab
  cron: name='creates snapshot' job="curl -L https://raw.githubusercontent.com/miya0001/create-snapshot/master/create_snapshot.sh | bash" hour="3" minute="0" user="root" state=present
  when: aws.snapshot | bool 
  tags: aws

- name: aws configure directory
  file: path=/root/.aws state=directory owner=root group=root mode=0755
  tags: aws

- name: copy aws configure file with default region
  template: src=.aws_config.j2 dest=/root/.aws/config owner=root mode=0600
  tags: aws

- name: cloudwatch
  shell: curl -L https://raw.githubusercontent.com/onagatani/cloudwatch-create-alarm/master/cloudwatch-create-alarm | bash /dev/stdin -a {{ server_hostname }} -t {{ server_hostname }} -e {{ alert.email }}
  when: aws.cloudwatch | bool 
  tags: aws

- name: remove the ntpdate package
  yum: name={{ item }}  state=absent
  with_items: 
    - ntp
    - ntpdate
  tags: aws

- name: Install the chronyd
  yum: name=chrony state=present
  tags: aws

- name: chronyd is runnning and enabled
  service: name=chronyd state=started enabled=yes
  tags: aws
  

Change from NTP to Chrony
Change from NTP to Chrony
