Fixed errors in playbook

This commit is contained in:
2021-11-06 16:14:55 +01:00
parent 5720ea6bce
commit e8fdabc8b5
9 changed files with 70 additions and 52 deletions

View File

@ -1,90 +1,95 @@
---
- name: configure email
when: use_sendmail
when: use_sendmail and installation.changed
block:
- name: mail_domain
ansible.builtin.command:
command:
chdir: ~/html
cmd: php occ config:system:set mail_domain --value="uber.space"
- name: mail_from_address
ansible.builtin.command:
command:
chdir: ~/html
cmd: php occ config:system:set mail_from_address --value="{{ uberspace_user }}"
- name: smtp_mode
ansible.builtin.command:
command:
chdir: ~/html
cmd: php occ config:system:set mail_smtpmode --value="sendmail"
- name: sendmail_mode
ansible.builtin.command:
command:
chdir: ~/html
cmd: php occ config:system:set mail_sendmailmode --value="pipe"
- name: initialize URL rewriting
when: installation.changed
block:
- name: rewrite base
ansible.builtin.command:
command:
chdir: ~/html
cmd: php occ config:system:set htaccess.RewriteBase --value='/'
- name: update htaccess
ansible.builtin.command:
command:
chdir: ~/html
cmd: php occ maintenance:update:htaccess
- name: initialize cronjob
when: installation.changed
block:
- name: update crontab
ansible.builtin.cron:
cron:
name: nextcloud-cron
state: present
job: php -f $HOME/html/cron.php > $HOME/logs/nextcloud-cron.log 2>&1
minute: */5
minute: "*/5"
- name: use cronjob for background
ansible.builtin.command:
command:
chdir: ~/html
cmd: php occ background:cron
- name: set up redis
when: installation.changed
block:
- name: set redis host
ansible.builtin.command:
command:
chdir: ~/html
cmd: php occ config:system:set redis host --value="/home/{{ uberspace_user }}/.redis/sock"
- name: set redis port
ansible.builtin.command:
command:
chdir: ~/html
cmd: php occ config:system:set redis port --value=0
- name: set redis timeout
ansible.builtin.command:
command:
chdir: ~/html
cmd: php occ config:system:set redis port --value=1.5
cmd: php occ config:system:set redis timeout --value=1.5
- name: enable file locking
ansible.builtin.command:
command:
chdir: ~/html
cmd: php occ config:system:set filelocking.enabled --value='true'
- name: use Redis for memcache.locking
ansible.builtin.command:
command:
chdir: ~/html
cmd: php occ config:system:set memcache.locking --value='\OC\Memcache\Redis'
- name: use Redis for memcache.distributed
ansible.builtin.command:
command:
chdir: ~/html
cmd: php occ config:system:set memcache.distributed --value='\OC\Memcache\Redis'
- name: set default phone region
ansible.builtin.command:
when: installation.changed
command:
chdir: ~/html
cmd: php occ config:system:set default_phone_region --value='{{ phone_region }}'
- name: perform database maintenance
when: installation.changed
block:
- name: add missing indices
ansible.builtin.command:
command:
chdir: ~/html
cmd: php occ db:add-missing-indices --no-interaction
- name: add missing columns
ansible.builtin.command:
command:
chdir: ~/html
cmd: php occ db:add-missing-columns --no-interaction
- name: add missing primary keys
ansible.builtin.command:
command:
chdir: ~/html
cmd: php occ db:add-missing-primary-keys --no-interaction
- name: convert filecache bigint
ansible.builtin.command:
command:
chdir: ~/html
cmd: php occ db:convert-filecache-bigint --no-interaction