Added new role

This commit is contained in:
2021-11-02 21:48:41 +01:00
parent 193eae637f
commit 30d3cf835d
26 changed files with 328 additions and 1 deletions

View File

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