- name: overwrite default config
  copy:
    src: default
    dest: /etc/nginx/sites-available/default
    force: yes

- name: reverse proxy config
  template:
    src: proxy-hosts.conf.j2
    dest: /etc/nginx/sites-available/proxy-hosts.conf
    owner: www-data
    group: www-data
    mode: 0644

- name: enable reverse proxy
  file:
    src: /etc/nginx/sites-available/proxy-hosts.conf
    dest: /etc/nginx/sites-enabled/proxy-hosts.conf
    owner: www-data
    group: www-data
    mode: 0644
    state: link
          

- name: overwrite index html
  copy:
    src: index.html
    dest: /var/www/html/index.html
    owner: www-data
    group: www-data
    mode: 0644
    force: yes
