zoneminder: Initial version of role
This commit is contained in:
parent
3f9de759aa
commit
6a79379d85
4 changed files with 79 additions and 0 deletions
63
roles/zoneminder/tasks/main.yml
Normal file
63
roles/zoneminder/tasks/main.yml
Normal file
|
@ -0,0 +1,63 @@
|
|||
---
|
||||
- name: fix selinux contexts from cache directory
|
||||
sefcontext:
|
||||
path: "/var/cache/zoneminder(/.*)?"
|
||||
setype: httpd_cache_t
|
||||
|
||||
- name: install packages
|
||||
package:
|
||||
name: zoneminder-httpd
|
||||
state: installed
|
||||
|
||||
- name: create config
|
||||
template:
|
||||
dest: /etc/zm/conf.d/local.conf
|
||||
src: zm.conf
|
||||
mode: 0640
|
||||
owner: root
|
||||
group: apache
|
||||
notify: restart zoneminder
|
||||
|
||||
# selinux doesn't allow create this
|
||||
- name: create stub web log
|
||||
file:
|
||||
dest: /var/log/zoneminder/web_php.log
|
||||
state: touch
|
||||
mode: 0640
|
||||
owner: apache
|
||||
group: apache
|
||||
access_time: preserve
|
||||
modification_time: preserve
|
||||
|
||||
- name: link apache config
|
||||
file:
|
||||
dest: /etc/httpd/conf.local.d/zm.conf
|
||||
src: /etc/zm/www/zoneminder.httpd.conf
|
||||
state: link
|
||||
owner: root
|
||||
group: "{{ ansible_wheel }}"
|
||||
notify: restart apache
|
||||
|
||||
- name: link apache php config
|
||||
file:
|
||||
dest: /etc/httpd/conf.local.d/php.conf
|
||||
src: /etc/httpd/conf.d/php.conf
|
||||
state: link
|
||||
owner: root
|
||||
group: "{{ ansible_wheel }}"
|
||||
notify: restart apache
|
||||
|
||||
- name: configure zoneminder timezone
|
||||
copy:
|
||||
dest: /etc/php.d/timezone.ini
|
||||
content: "date.timezone=UTC\n"
|
||||
mode: 0644
|
||||
owner: root
|
||||
group: "{{ ansible_wheel }}"
|
||||
notify: restart apache
|
||||
|
||||
- name: enable service
|
||||
service:
|
||||
name: zoneminder
|
||||
state: started
|
||||
enabled: true
|
Loading…
Add table
Add a link
Reference in a new issue