zoneminder: ansible-lint fixes

This commit is contained in:
Timo Makinen 2022-10-29 18:04:02 +00:00
parent c566ddd819
commit 8ffc56a625
2 changed files with 23 additions and 23 deletions

View file

@ -1,5 +1,5 @@
--- ---
- name: restart zoneminder - name: Restart zoneminder
service: ansible.builtin.service:
name: zoneminder name: zoneminder
state: restarted state: restarted

View file

@ -1,10 +1,10 @@
--- ---
- name: fix selinux contexts from cache directory - name: Fix SELinux contexts from cache directory
community.general.sefcontext: community.general.sefcontext:
path: "/var/cache/zoneminder(/.*)?" path: "/var/cache/zoneminder(/.*)?"
setype: httpd_cache_t setype: httpd_cache_t
- name: install packages - name: Install packages
ansible.builtin.package: ansible.builtin.package:
name: "{{ item }}" name: "{{ item }}"
state: installed state: installed
@ -12,12 +12,12 @@
- mariadb - mariadb
- zoneminder-httpd - zoneminder-httpd
- name: fix selinux contexts from data directory - name: Fix SELinux contexts from data directory
community.general.sefcontext: community.general.sefcontext:
path: "/export/zoneminder(/.*)?" path: "/export/zoneminder(/.*)?"
setype: zoneminder_var_lib_t setype: zoneminder_var_lib_t
- name: create data directory - name: Create data directory
ansible.builtin.file: ansible.builtin.file:
path: /export/zoneminder path: /export/zoneminder
state: directory state: directory
@ -26,7 +26,7 @@
group: apache group: apache
setype: _default setype: _default
- name: link data directory - name: Link data directory
ansible.builtin.file: ansible.builtin.file:
dest: /srv/zoneminder dest: /srv/zoneminder
src: /export/zoneminder src: /export/zoneminder
@ -35,34 +35,34 @@
group: "{{ ansible_wheel }}" group: "{{ ansible_wheel }}"
follow: false follow: false
- name: create config - name: Create config
ansible.builtin.template: ansible.builtin.template:
dest: /etc/zm/conf.d/local.conf dest: /etc/zm/conf.d/local.conf
src: zm.conf src: zm.conf
mode: 0640 mode: 0640
owner: root owner: root
group: apache group: apache
notify: restart zoneminder notify: Restart zoneminder
- name: remove mariadb depency from unit file - name: Remove mariadb depency from unit file
ansible.builtin.shell: ansible.builtin.shell:
cmd: >- cmd: >-
sed -e 's/mariadb\.service//' /lib/systemd/system/zoneminder.service sed -e 's/mariadb\.service//' /lib/systemd/system/zoneminder.service
> /etc/systemd/system/zoneminder.service > /etc/systemd/system/zoneminder.service
creates: /etc/systemd/system/zoneminder.service creates: /etc/systemd/system/zoneminder.service
warn: false warn: false
notify: restart zoneminder notify: Restart zoneminder
when: zm_mysql_host != "localhost" when: zm_mysql_host != "localhost"
- name: allow zoneminder to read host private key - name: Allow zoneminder to read host private key
ansible.builtin.user: ansible.builtin.user:
name: apache name: apache
groups: hostkey groups: hostkey
append: true append: true
notify: restart zoneminder notify: Restart zoneminder
when: zm_mysql_host != "localhost" when: zm_mysql_host != "localhost"
- name: loosen selinux settings - name: Loosen SELinux settings
ansible.posix.seboolean: ansible.posix.seboolean:
name: "{{ item }}" name: "{{ item }}"
state: true state: true
@ -72,7 +72,7 @@
- nis_enabled - nis_enabled
# selinux doesn't allow create this # selinux doesn't allow create this
- name: create stub web log - name: Create stub web log
ansible.builtin.file: ansible.builtin.file:
dest: /var/log/zoneminder/web_php.log dest: /var/log/zoneminder/web_php.log
state: touch state: touch
@ -82,35 +82,35 @@
access_time: preserve access_time: preserve
modification_time: preserve modification_time: preserve
- name: link apache config - name: Link apache config
ansible.builtin.file: ansible.builtin.file:
dest: /etc/httpd/conf.local.d/zm.conf dest: /etc/httpd/conf.local.d/zm.conf
src: /etc/zm/www/zoneminder.httpd.conf src: /etc/zm/www/zoneminder.httpd.conf
state: link state: link
owner: root owner: root
group: "{{ ansible_wheel }}" group: "{{ ansible_wheel }}"
notify: restart apache notify: Restart apache
- name: link apache php config - name: Link apache php config
ansible.builtin.file: ansible.builtin.file:
dest: /etc/httpd/conf.local.d/php.conf dest: /etc/httpd/conf.local.d/php.conf
src: /etc/httpd/conf.d/php.conf src: /etc/httpd/conf.d/php.conf
state: link state: link
owner: root owner: root
group: "{{ ansible_wheel }}" group: "{{ ansible_wheel }}"
notify: restart apache notify: Restart apache
- name: configure zoneminder timezone - name: Configure zoneminder timezone
ansible.builtin.copy: ansible.builtin.copy:
dest: /etc/php.d/timezone.ini dest: /etc/php.d/timezone.ini
content: "date.timezone=UTC\n" content: "date.timezone=UTC\n"
mode: 0644 mode: 0644
owner: root owner: root
group: "{{ ansible_wheel }}" group: "{{ ansible_wheel }}"
notify: restart apache notify: Restart apache
# required for database updates to work # required for database updates to work
- name: configure mysql client to use ssl - name: Configure mysql client to use ssl
ansible.builtin.copy: ansible.builtin.copy:
dest: /root/.my.cnf dest: /root/.my.cnf
content: | content: |
@ -122,7 +122,7 @@
owner: root owner: root
group: "{{ ansible_wheel }}" group: "{{ ansible_wheel }}"
- name: enable service - name: Enable service
ansible.builtin.service: ansible.builtin.service:
name: zoneminder name: zoneminder
state: started state: started