91 lines
2.1 KiB
YAML
91 lines
2.1 KiB
YAML
---
|
|
- name: Group Shelfzilla
|
|
group: name=shelfzilla state=present
|
|
sudo: yes
|
|
|
|
- name: User Shelfzilla
|
|
user: name=shelfzilla comment="Shelfzilla" groups=shelfzilla,nginx,postgres
|
|
sudo: yes
|
|
|
|
- name: Modify Nginx user
|
|
user: name=nginx groups=shelfzilla,nginx,postgres
|
|
sudo: yes
|
|
|
|
- name: Install shelfzilla RPM
|
|
yum: pkg=shelfzilla state=installed
|
|
sudo: yes
|
|
|
|
- stat: path="{{shelfzilla_base_path}}/init/shelfzilla"
|
|
register: st
|
|
|
|
- name: Move Shelfzilla init script
|
|
## Use mv instead copy because Ansible use local path as src
|
|
command: mv "{{shelfzilla_base_path}}/init/shelfzilla" "{{system_init_path}}/shelfzilla"
|
|
sudo: yes
|
|
when: st.stat.exists
|
|
|
|
- name: Change Permission of init script
|
|
file: path="{{system_init_path}}/shelfzilla"
|
|
owner=root
|
|
group=root
|
|
mode=0755
|
|
sudo: yes
|
|
|
|
- name: Load Shelfzilla service in boot
|
|
service: name=shelfzilla
|
|
pattern="{{system_init_path}}/shelfzilla"
|
|
enabled=yes
|
|
sudo: yes
|
|
|
|
- stat: path="{{shelfzilla_base_path}}/init/"
|
|
register: st
|
|
|
|
- name: delete init directory
|
|
file: path="{{item}}" state=absent
|
|
with_items:
|
|
- "{{shelfzilla_base_path}}/init/"
|
|
sudo: yes
|
|
when: st.stat.exists
|
|
|
|
- name: Install Shelfzilla config file
|
|
template: src=shelfzilla.toml
|
|
dest="{{shelfzilla_base_path}}/shelfzilla.toml"
|
|
owner=root
|
|
group=root
|
|
mode=0755
|
|
sudo: yes
|
|
|
|
- name: Create necessary folders
|
|
file: path="{{ item }}"
|
|
owner=shelfzilla
|
|
group=shelfzilla
|
|
mode=0775
|
|
state=directory
|
|
sudo: yes
|
|
with_items:
|
|
- "{{ logpath }}"
|
|
- "{{ static_root }}"
|
|
- "{{ media_root }}"
|
|
|
|
- stat: path="{{ logfile }}"
|
|
register: st
|
|
|
|
- name: Create LogPath
|
|
file: path="{{ logpath }}"
|
|
owner=root
|
|
group=root
|
|
mode=0755
|
|
state=directory
|
|
sudo: yes
|
|
|
|
- name: Create Logfile
|
|
file: path="{{ logfile }}"
|
|
owner=root
|
|
group=root
|
|
mode=0666
|
|
state=touch
|
|
sudo: yes
|
|
when: not st.stat.exists
|
|
|
|
|