Fix some ansible-lint complaints.

This commit is contained in:
Andreas B. Mundt 2022-06-11 12:42:02 +02:00 committed by Andreas B. Mundt
parent c7030c9245
commit 2cf34e8e55
64 changed files with 357 additions and 297 deletions

View file

@ -5,8 +5,10 @@
register: nextcloud
- name: check for nextcloud archive
local_action: stat path=nextcloud.tar.bz2
become: No
stat:
path: nextcloud.tar.bz2
become: false
delegate_to: localhost
register: nc_archive
when: not nextcloud.stat.exists
@ -45,7 +47,7 @@
- php-xml
- php-zip
- unzip
state: latest
state: latest # noqa package-latest
- name: disable apache modules
apache2_module:
@ -68,10 +70,10 @@
- http2
notify: "restart apache2"
- name: find php version
- name: find php version # noqa risky-shell-pipe
shell: ls /etc/php/ | sort | tail -1
register: php_ver
changed_when: False
changed_when: false
- name: enable php-fpm conf
command: a2enconf php{{ php_ver.stdout }}-fpm
@ -85,10 +87,14 @@
regexp: "{{ item.regex }}"
replace: "{{ item.replace }}"
with_items:
- { regex: "^pm.max_children = .*$", replace: "pm.max_children = 10" }
- { regex: "^pm.start_servers = .*$", replace: "pm.start_servers = 4" }
- { regex: "^pm.min_spare_servers = .*$", replace: "pm.min_spare_servers = 2" }
- { regex: "^pm.max_spare_servers = .*$", replace: "pm.max_spare_servers = 6" }
- regex: "^pm.max_children = .*$"
replace: "pm.max_children = 10"
- regex: "^pm.start_servers = .*$"
replace: "pm.start_servers = 4"
- regex: "^pm.min_spare_servers = .*$"
replace: "pm.min_spare_servers = 2"
- regex: "^pm.max_spare_servers = .*$"
replace: "pm.max_spare_servers = 6"
notify: "restart php-fpm"
- name: increase php memory limit
@ -102,6 +108,7 @@
copy:
src: nextcloud.conf
dest: /etc/apache2/sites-available/nextcloud.conf
mode: 0644
notify: "restart apache2"
- name: enable nextcloud site
@ -123,6 +130,7 @@
file:
path: "{{ data_dir }}"
state: directory
mode: 0770
owner: www-data
group: www-data
@ -140,7 +148,7 @@
dest: "{{ www_root }}"
owner: www-data
group: www-data
remote_src: Yes
remote_src: true
when: not nextcloud.stat.exists and run_in_installer|default(false)|bool
- name: unpack provided nextcloud archive
@ -184,19 +192,19 @@
--data-dir "{{ data_dir }}"
args:
chdir: "{{ nc_dir }}"
no_log: True
no_log: true
when: not nextcloud.stat.exists
- name: dump nc-admin password
shell: echo -n "{{ nc_admin_pwd }}" > "{{ nc_admin_pwd_file }}" ; chmod 0600 "{{ nc_admin_pwd_file }}"
no_log: True
no_log: true
when: not nextcloud.stat.exists
- name: enable APCu memcache
command: sudo -u www-data php ./occ config:system:set memcache.local --value='\OC\Memcache\APCu'
args:
chdir: "{{ nc_dir }}"
warn: False
warn: false
when: not nextcloud.stat.exists
- name: enable acpu for nextcloud updates
@ -208,7 +216,7 @@
command: sudo -u www-data php ./occ config:system:set trusted_domains {{ item[0] }} --value='{{ item[1] }}'
args:
chdir: "{{ nc_dir }}"
warn: False
warn: false
when: not nextcloud.stat.exists
loop:
- [1, '192.168.*.*']
@ -220,6 +228,7 @@
copy:
src: "{{ item }}"
dest: "/etc/systemd/system/{{ item }}"
mode: 0644
with_items:
- nextcloudcron.service
- nextcloudcron.timer
@ -229,8 +238,8 @@
firewalld:
interface: "{{ ansible_default_ipv4.interface }}"
zone: public
permanent: Yes
immediate: Yes
permanent: true
immediate: true
state: enabled
when: not run_in_installer|default(false)|bool
@ -242,8 +251,8 @@
firewalld:
zone: public
service: https
permanent: Yes
immediate: Yes
permanent: true
immediate: true
state: enabled
when: not run_in_installer|default(false)|bool
@ -257,7 +266,7 @@
- name: install libapache2-mod-auth-gssapi
apt:
name: libapache2-mod-auth-gssapi
state: latest
state: latest # noqa package-latest
when: "'kerberize' in role_names"
notify: "restart apache2"
@ -267,8 +276,8 @@
dest: /etc/krb5.keytab.http
group: www-data
mode: "0640"
remote_src: yes
force: no
remote_src: true
force: false
when: "'kerberize' in role_names"
notify: "restart apache2"
@ -276,6 +285,7 @@
copy:
src: krb5-nextcloud.conf
dest: /etc/apache2/sites-available/krb5-nextcloud.conf
mode: 0644
when: "'kerberize' in role_names"
notify: "restart apache2"
@ -290,8 +300,8 @@
firewalld:
zone: internal
service: https
permanent: Yes
immediate: Yes
permanent: true
immediate: true
state: enabled
when: not run_in_installer|default(false)|bool and 'kerberize' in role_names
@ -303,7 +313,7 @@
command: sudo -u www-data php ./occ config:system:set trusted_domains 2 --value='{{ ansible_hostname }}.{{ ansible_domain }}'
args:
chdir: "{{ nc_dir }}"
warn: False
warn: false
when: not nextcloud.stat.exists and 'kerberize' in role_names