---
- name: sync all conf files for nginx
  hosts: supermaster
  become: yes
  tasks:
    - name: copy files
      copy:
        src: ../../config/sites-available
        dest: /etc/nginx/
        owner: root
        group: root
        mode: '0644'
        

    - name: create link from sites-available to sites-enabled
      shell: |
          rm -rf /etc/nginx/sites-enabled/*
          ln -s /etc/nginx/sites-available/* /etc/nginx/sites-enabled/
    