---
- name: Install dependencies
  xbps: name={{ item }} state=present
  with_items:
  - ruby
  - ruby-devel
  - nodejs
  - base-devel
  - git

- name: Install firewall rules
  copy: src=jekyll.rules dest=/etc/iptables.d/jekyll.rules owner=root group=root mode=0640
  notify:
  - iptables

- name: Install Jekyll
  gem: name={{ item }} state=present user_install=no
  with_items:
    - jekyll
    - jekyll-paginate

- name: Get Site Files
  git: clone=yes depth=1 force=yes dest=/tmp/cv_jekyll repo=https://github.com/collegiumv/cv_jekyll.git

- name: Create Jekyll site folder
  file: path=/var/www/home state=directory owner=root group=nginx mode=0755

- name: Build CV Site
  command: jekyll build --destination=/var/www/home/ chdir=/tmp/cv_jekyll

- name: Fix CV Site permissions
  file: path=/var/www/home owner=root group=nginx recurse=yes

- name: Copy CV Site descriptor
  copy: src=jekyll.conf dest=/etc/nginx/sites-available/ owner=root group=root mode=0644
  notify:
  - nginx

- name: Enable CV Site
  file: src=../sites-available/jekyll.conf dest=/etc/nginx/sites-enabled/jekyll.conf state=link owner=root group=root
  notify:
  - nginx

---
- name: Install dependencies
  xbps: name={{ item }} state=present
  with_items:
  - ruby
  - ruby-devel
  - nodejs
  - base-devel
  - git

- name: Install firewall rules
  copy: src=jekyll.rules dest=/etc/iptables.d/jekyll.rules owner=root group=root mode=0640
  notify:
  - iptables

- name: Install Jekyll
  gem: name={{ item }} state=present user_install=no
  with_items:
    - jekyll
    - jekyll-paginate

- name: Get Site Files
  git: clone=yes depth=1 force=yes dest=/tmp/cv_jekyll repo=https://github.com/collegiumv/cv_jekyll.git

- name: Create Jekyll site folder
  file: path=/var/www/home state=directory owner=root group=nginx mode=0755

- name: Build CV Site
  command: jekyll build --destination=/var/www/home/ chdir=/tmp/cv_jekyll

- name: Fix CV Site permissions
  file: path=/var/www/home owner=root group=nginx mode=go+rX recurse=yes

- name: Copy CV Site descriptor
  copy: src=jekyll.conf dest=/etc/nginx/sites-available/ owner=root group=root mode=0644
  notify:
  - nginx

- name: Enable CV Site
  file: src=../sites-available/jekyll.conf dest=/etc/nginx/sites-enabled/jekyll.conf state=link owner=root group=root
  notify:
  - nginx

Set correct mode on jekyll_site
Set correct mode on jekyll_site
