uberspace-ansible/roles/nextcloud/tasks/config.yml

96 lines
3.0 KiB
YAML
Raw Normal View History

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