ghost/tasks/install.yml

52 lines
1.2 KiB
YAML
Raw Permalink Normal View History

2022-05-02 17:33:47 +02:00
---
- 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
2023-01-23 17:22:46 +01:00
become_user: "{{ item.account }}"
2022-05-02 17:33:47 +02:00
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
2023-01-23 17:22:46 +01:00
become_user: "{{ item.account }}"
2022-05-02 17:33:47 +02:00
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
2023-01-23 17:22:46 +01:00
become_user: "{{ item.account }}"
2022-05-02 17:33:47 +02:00
when: ghost_deploy_site in item.name
tags:
- install
notify:
- Restart service
2023-01-23 17:22:46 +01:00
- Clean cache yarn
- NPM Cache clean
2022-05-02 17:33:47 +02:00