fmartingr
/
shelfzilla
Archived
1
0
Fork 0
This repository has been archived on 2021-06-29. You can view files and clone it, but cannot push or open issues or pull requests.
shelfzilla/provisioning/roles/shelfzilla/tasks/shelfzilla.yml

89 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 Logfile
file: path="{{ logfile }}"
owner=root
group=root
mode=0666
state=file
sudo: yes
when: not st.stat.exists
- name: Create Static base path
file: path="{{ logpath }}"
owner=root
group=root
mode=0755
state=directory
sudo: yes