|
|
|
@ -17,7 +17,7 @@
|
|
|
|
|
loop: "{{ ghost }}"
|
|
|
|
|
become: yes
|
|
|
|
|
become_user : "{{ item.account }}"
|
|
|
|
|
when: ghost_deploy_site in item.key
|
|
|
|
|
when: ghost_deploy_site in item.name
|
|
|
|
|
|
|
|
|
|
- name: "Add blog log directory"
|
|
|
|
|
file:
|
|
|
|
@ -33,7 +33,7 @@
|
|
|
|
|
owner: "{{ item.account }}"
|
|
|
|
|
group: "{{ item.account }}"
|
|
|
|
|
loop: "{{ ghost }}"
|
|
|
|
|
when: ghost_deploy_site in item.key
|
|
|
|
|
when: ghost_deploy_site in item.name
|
|
|
|
|
|
|
|
|
|
- name: "Download Ghost"
|
|
|
|
|
get_url:
|
|
|
|
@ -43,14 +43,14 @@
|
|
|
|
|
loop: "{{ ghost }}"
|
|
|
|
|
become: yes
|
|
|
|
|
become_user : "{{ item.account }}"
|
|
|
|
|
when: ghost_deploy_site in item.key
|
|
|
|
|
when: ghost_deploy_site in item.name
|
|
|
|
|
|
|
|
|
|
- name: "Delete www"
|
|
|
|
|
file:
|
|
|
|
|
path: "{{ item.home }}/www"
|
|
|
|
|
state: absent
|
|
|
|
|
loop: "{{ ghost }}"
|
|
|
|
|
when: ghost_deploy_site in item.key
|
|
|
|
|
when: ghost_deploy_site in item.name
|
|
|
|
|
|
|
|
|
|
- name: "Unzip Ghost"
|
|
|
|
|
shell: "unzip -o ghost-latest.zip -d www"
|
|
|
|
@ -59,7 +59,7 @@
|
|
|
|
|
loop: "{{ ghost }}"
|
|
|
|
|
become: yes
|
|
|
|
|
become_user : "{{ item.account }}"
|
|
|
|
|
when: ghost_deploy_site in item.key
|
|
|
|
|
when: ghost_deploy_site in item.name
|
|
|
|
|
|
|
|
|
|
- name: "Unzip content folder Ghost"
|
|
|
|
|
shell: "unzip -o ghost-latest.zip 'content/*' -d ./"
|
|
|
|
@ -68,14 +68,14 @@
|
|
|
|
|
with_dict: "{{ ghost }}"
|
|
|
|
|
become: yes
|
|
|
|
|
become_user : "{{ item.account }}"
|
|
|
|
|
when: ghost_deploy_site in item.key
|
|
|
|
|
when: ghost_deploy_site in item.name
|
|
|
|
|
|
|
|
|
|
- name: "Delete content"
|
|
|
|
|
file:
|
|
|
|
|
path: "{{ item.home }}/www/content"
|
|
|
|
|
state: absent
|
|
|
|
|
loop: "{{ ghost }}"
|
|
|
|
|
when: ghost_deploy_site in item.key
|
|
|
|
|
when: ghost_deploy_site in item.name
|
|
|
|
|
|
|
|
|
|
- name: "Symlink content"
|
|
|
|
|
file:
|
|
|
|
@ -85,7 +85,7 @@
|
|
|
|
|
owner: "{{ item.account }}"
|
|
|
|
|
group: "{{ item.account }}"
|
|
|
|
|
loop: "{{ ghost }}"
|
|
|
|
|
when: ghost_deploy_site in item.key
|
|
|
|
|
when: ghost_deploy_site in item.name
|
|
|
|
|
become: yes
|
|
|
|
|
become_user : "{{ item.account }}"
|
|
|
|
|
|
|
|
|
@ -96,14 +96,14 @@
|
|
|
|
|
owner: "{{ item.account }}"
|
|
|
|
|
group: "{{ item.account }}"
|
|
|
|
|
loop: "{{ ghost }}"
|
|
|
|
|
when: ghost_deploy_site in item.key
|
|
|
|
|
when: ghost_deploy_site in item.name
|
|
|
|
|
|
|
|
|
|
- name: "Config daemon"
|
|
|
|
|
template:
|
|
|
|
|
src: "systemd.service.j2"
|
|
|
|
|
dest: "/etc/systemd/system/{{ item.name }}.service"
|
|
|
|
|
loop: "{{ ghost }}"
|
|
|
|
|
when: ghost_deploy_site in item.key
|
|
|
|
|
when: ghost_deploy_site in item.name
|
|
|
|
|
|
|
|
|
|
- name: "Install node modules"
|
|
|
|
|
shell: "NODE_ENV=production npm i"
|
|
|
|
@ -112,7 +112,7 @@
|
|
|
|
|
loop: "{{ ghost }}"
|
|
|
|
|
become: yes
|
|
|
|
|
become_user : "{{ item.account }}"
|
|
|
|
|
when: ghost_deploy_site in item.key
|
|
|
|
|
when: ghost_deploy_site in item.name
|
|
|
|
|
|
|
|
|
|
- name: "Install yarn module"
|
|
|
|
|
shell: "NODE_ENV=production yarn install"
|
|
|
|
@ -121,7 +121,7 @@
|
|
|
|
|
loop: "{{ ghost }}"
|
|
|
|
|
become: yes
|
|
|
|
|
become_user : "{{ item.account }}"
|
|
|
|
|
when: ghost_deploy_site in item.key
|
|
|
|
|
when: ghost_deploy_site in item.name
|
|
|
|
|
|
|
|
|
|
- name: "Knex init"
|
|
|
|
|
shell: "NODE_ENV=production node_modules/knex-migrator/bin/knex-migrator init"
|
|
|
|
@ -130,7 +130,7 @@
|
|
|
|
|
loop: "{{ ghost }}"
|
|
|
|
|
become: yes
|
|
|
|
|
become_user : "{{ item.account }}"
|
|
|
|
|
when: ghost_deploy_site in item.key
|
|
|
|
|
when: ghost_deploy_site in item.name
|
|
|
|
|
|
|
|
|
|
- name: "Knex migrate"
|
|
|
|
|
shell: "NODE_ENV=production node_modules/knex-migrator/bin/knex-migrator migrate"
|
|
|
|
@ -139,7 +139,7 @@
|
|
|
|
|
loop: "{{ ghost }}"
|
|
|
|
|
become: yes
|
|
|
|
|
become_user : "{{ item.account }}"
|
|
|
|
|
when: ghost_deploy_site in item.key
|
|
|
|
|
when: ghost_deploy_site in item.name
|
|
|
|
|
|
|
|
|
|
- name: "Reload systemctl"
|
|
|
|
|
systemd:
|
|
|
|
@ -150,21 +150,21 @@
|
|
|
|
|
name: "{{ item.name }}.service"
|
|
|
|
|
enabled: yes
|
|
|
|
|
loop: "{{ ghost }}"
|
|
|
|
|
when: ghost_deploy_site in item.key
|
|
|
|
|
when: ghost_deploy_site in item.name
|
|
|
|
|
|
|
|
|
|
- name: "Restart service"
|
|
|
|
|
systemd:
|
|
|
|
|
name: "{{ item.name }}.service"
|
|
|
|
|
state: restarted
|
|
|
|
|
loop: "{{ ghost }}"
|
|
|
|
|
when: ghost_deploy_site in item.key
|
|
|
|
|
when: ghost_deploy_site in item.name
|
|
|
|
|
|
|
|
|
|
- name: "Delete archive"
|
|
|
|
|
file:
|
|
|
|
|
path: "{{ item.home }}/ghost-latest.zip"
|
|
|
|
|
state: absent
|
|
|
|
|
loop: "{{ ghost }}"
|
|
|
|
|
when: ghost_deploy_site in item.key
|
|
|
|
|
when: ghost_deploy_site in item.name
|
|
|
|
|
|
|
|
|
|
- name: "Clean cache yarn"
|
|
|
|
|
shell: "yarn cache clean"
|
|
|
|
@ -173,7 +173,7 @@
|
|
|
|
|
loop: "{{ ghost }}"
|
|
|
|
|
become: yes
|
|
|
|
|
become_user : "{{ item.account }}"
|
|
|
|
|
when: ghost_deploy_site in item.key
|
|
|
|
|
when: ghost_deploy_site in item.name
|
|
|
|
|
|
|
|
|
|
- name: "NPM Cache clean"
|
|
|
|
|
shell: "npm cache clean --force"
|
|
|
|
@ -182,4 +182,4 @@
|
|
|
|
|
loop: "{{ ghost }}"
|
|
|
|
|
become: yes
|
|
|
|
|
become_user : "{{ item.account }}"
|
|
|
|
|
when: ghost_deploy_site in item.key
|
|
|
|
|
when: ghost_deploy_site in item.name
|
|
|
|
|