You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.2 KiB
YAML
52 lines
1.2 KiB
YAML
---
|
|
- name: "Add ghost user"
|
|
user:
|
|
name: "{{ item.account }}"
|
|
shell: "/bin/false"
|
|
home: "{{ item.home }}"
|
|
loop: "{{ ghost }}"
|
|
when: ghost_deploy_site in item.name
|
|
tags:
|
|
- install
|
|
|
|
- name: "Add www directory"
|
|
file:
|
|
path: "{{ item.home }}/www"
|
|
state: directory
|
|
mode: 0755
|
|
owner: "{{ item.account }}"
|
|
group: "{{ item.account }}"
|
|
loop: "{{ ghost }}"
|
|
become: yes
|
|
become_user: "{{ item.account }}"
|
|
when: ghost_deploy_site in item.name
|
|
tags:
|
|
- install
|
|
|
|
- name: "Install ghost-cli"
|
|
ansible.builtin.shell: /usr/bin/npm install ghost-cli
|
|
args:
|
|
chdir: "{{ item.home }}"
|
|
loop: "{{ ghost }}"
|
|
become: yes
|
|
become_user: "{{ item.account }}"
|
|
when: ghost_deploy_site in item.name
|
|
tags:
|
|
- install
|
|
|
|
- name: "Install Ghost"
|
|
ansible.builtin.shell: "{{ item.home }}/node_modules/.bin/ghost install {{ version | default('') }} --dir www --no-prompt --no-setup --no-stack --db mysql --dbhost 192.168.1.254"
|
|
args:
|
|
chdir: "{{ item.home }}"
|
|
loop: "{{ ghost }}"
|
|
become: yes
|
|
become_user: "{{ item.account }}"
|
|
when: ghost_deploy_site in item.name
|
|
tags:
|
|
- install
|
|
notify:
|
|
- Restart service
|
|
- Clean cache yarn
|
|
- NPM Cache clean
|
|
|