--- - hosts: nimbus-1.net.enp.one name: Deploy main landing page at enpaul.net vars: # Local directory to use for cloning and building the documentation site DIR_BUILD: /tmp/docs # Remote directory to install the site at DIR_DEPLOY: /usr/share/nginx/enpaul.net/html tasks: - name: Upload static site to remote copy: src: "{{ DIR_BUILD }}/site/" dest: "/tmp/docs/" - name: Remove legacy site become: true file: path: "{{ DIR_DEPLOY }}" state: absent - name: Copy static site to deployment directory become: true copy: src: "/tmp/docs/" dest: "{{ DIR_DEPLOY }}" remote_src: true owner: root group: nginx mode: 0755 setype: httpd_sys_content_t - name: Clean up local build directory delegate_to: 127.0.0.1 file: path: "{{ DIR_BUILD }}" state: absent - name: Clean up remote temp directory file: path: /tmp/docs state: absent