2020-05-09 04:30:35 +00:00
|
|
|
---
|
|
|
|
- name: Install Hexo static site generator
|
2020-06-12 04:35:55 +00:00
|
|
|
hosts: dev
|
2020-05-09 04:30:35 +00:00
|
|
|
become: yes
|
|
|
|
tasks:
|
|
|
|
- name: Update apt sources and install npm
|
|
|
|
apt:
|
|
|
|
name: npm
|
|
|
|
state: present
|
|
|
|
update_cache: yes
|
|
|
|
- name: Install hexo-cli
|
|
|
|
npm:
|
|
|
|
name: hexo-cli
|
|
|
|
global: yes
|
|
|
|
- name: Adding hexo user / administrator
|
|
|
|
user:
|
|
|
|
name: hexo
|
|
|
|
shell: /bin/bash
|
|
|
|
groups: sudo
|
|
|
|
uid: 1001
|
|
|
|
- name: Initialize site files
|
|
|
|
command:
|
|
|
|
chdir: /home/hexo/
|
|
|
|
cmd: hexo init site
|
|
|
|
- name: Install site packages
|
|
|
|
npm:
|
|
|
|
path: /home/hexo/site/
|
|
|
|
- name: Start server
|
|
|
|
command:
|
|
|
|
chdir: /home/hexo/site/
|
|
|
|
cmd: nohup hexo server &
|
|
|
|
async: 45
|
|
|
|
poll: 0
|
|
|
|
|