Compare commits

...

4 commits

Author SHA1 Message Date
Renich Bon Ciric
81f9bda6cd nextcloud: versión funcional de configuración de SMTP 2024-03-26 20:52:39 -06:00
Renich Bon Ciric
cf4aa26c69 nextcloud: corregí el ejemplo de variables para SMTP 2024-03-26 20:52:25 -06:00
Renich Bon Ciric
80d6edd0ac nextcloud: agregamos la configuración con occ para el SMTP 2024-03-26 18:50:08 -06:00
4723ed547c Agregué variables para SMTP 2024-03-26 18:04:44 -06:00
2 changed files with 50 additions and 0 deletions

View file

@ -383,6 +383,43 @@
- redis
- notify_push
- name: Setup SMTP
block:
- name: Unset Nextcloud's config.php read-only setting.
lineinfile:
path: "{{ nextcloud_path }}/config/config.php"
state: absent
regexp: "config_is_read_only"
# TODO: Para que la configuración sea más flexible, debemos considerar que no todas estas variables se usan en todas las
# permutaciones de la configuración. Necesitamos separarlas.
#
# issue: <pendiente>
- name: Configure SMTP
ansible.builtin.shell:
cmd: |
/usr/bin/php {{ nextcloud_occ }} config:system:set mail_smtpmode --value={{ mail_smtpmode }} --type=string
/usr/bin/php {{ nextcloud_occ }} config:system:set mail_sendmailmode --value={{ mail_sendmailmode }} --type=string
/usr/bin/php {{ nextcloud_occ }} config:system:set mail_smtpsecure --value={{ mail_smtpsecure }} --type=string
/usr/bin/php {{ nextcloud_occ }} config:system:set mail_from_address --value={{ mail_from_address}} --type=string
/usr/bin/php {{ nextcloud_occ }} config:system:set mail_domain --value={{ mail_domain}} --type=string
/usr/bin/php {{ nextcloud_occ }} config:system:set mail_smtphost --value={{ mail_smtphost }} --type=string
/usr/bin/php {{ nextcloud_occ }} config:system:set mail_smtpport --value={{ mail_smtpport }} --type=integer
/usr/bin/php {{ nextcloud_occ }} config:system:set mail_smtpauth --value={{ mail_smtpauth }} --type=integer
/usr/bin/php {{ nextcloud_occ }} config:system:set mail_smtpname --value={{ mail_smtpname }} --type=string
/usr/bin/php {{ nextcloud_occ }} config:system:set mail_smtppassword --value={{ mail_smtppassword }} --type=string
become: true
become_user: "{{ web_user }}"
- name: Set Nextcloud's config.php read only setting.
ansible.builtin.shell:
cmd: "/usr/bin/php {{ nextcloud_occ }} config:system:set config_is_read_only --value=true --type=bool"
become: true
become_user: "{{ web_user }}"
tags:
- smtp
when: mail_smtp_enabled
- name: Enable Nextcloud Calendar
ansible.builtin.shell:
cmd: |

View file

@ -22,6 +22,19 @@ nextcloud_db: nextcloud
nextcloud_db_user: nextcloud
nextcloud_db_user_password: Una contraseña bien, pero bien difícil.
## SMTP
mail_smtp_enabled: false
mail_smtpmode: smtp
mail_sendmailmode: smtp
mail_smtpsecure: ssl
mail_from_address: CHANGEME
mail_domain: CHANGEME
mail_smtphost: CHANGEME
mail_smtpport: 587
mail_smtpauth: 0
mail_smtpname: ''
mail_smtppassword: ''
## LDAP
ldap_enabled: false
ldap_agent_password: cIBI4mLESN1nSrAPr7pX3350NPXkD3vExjr27X1ju