---
# default is etc/utc in build 20141129 [http://cloud.centos.org/centos/7/images/]
- name: set timezone to etc/utc
  sudo: yes
  file:
    src: /usr/share/zoneinfo/Etc/UTC
    dest: /etc/localtime
    state: link
    force: yes

# fix issue where dhclient blows away our resolv.conf
- name: configure resolv.conf script
  sudo: yes
  copy:
    src: dns-config.sh
    dest: /etc/dhcp/dhclient.d/dns-config.sh
    owner: root
    group: root
    mode: 755 

- include: users.yml  

---
# default is etc/utc in build 20141129 [http://cloud.centos.org/centos/7/images/]
- name: set timezone to etc/utc
  sudo: yes
  file:
    src: /usr/share/zoneinfo/Etc/UTC
    dest: /etc/localtime
    state: link
    force: yes

# fix issue where dhclient blows away our resolv.conf
- name: configure resolv.conf script
  sudo: yes
  copy:
    src: dns-config.sh
    dest: /etc/dhcp/dhclient.d/dns-config.sh
    owner: root
    group: root
    mode: 755 

# add hosts to /etc/hosts
- name: configure hosts file
  sudo: yes
  lineinfile:
    dest: /etc/hosts
    regexp: '.*{{ item }}$'
    line: "{{ hostvars[item].ansible_default_ipv4.address }} {{ item }} {{ item }}.novalocal"
    state: present
  when: hostvars[item].ansible_default_ipv4.address is defined
  with_items: groups['all']

- include: users.yml

Add task to update /etc/hosts
Add task to update /etc/hosts
