From 81f9bda6cdbf0482df446901460d5090a8ecc1c7 Mon Sep 17 00:00:00 2001 From: Renich Bon Ciric Date: Tue, 26 Mar 2024 20:52:39 -0600 Subject: [PATCH] =?UTF-8?q?nextcloud:=20versi=C3=B3n=20funcional=20de=20co?= =?UTF-8?q?nfiguraci=C3=B3n=20de=20SMTP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ansible/roles/nextcloud/tasks/main.yml | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/nextcloud/ansible/roles/nextcloud/tasks/main.yml b/nextcloud/ansible/roles/nextcloud/tasks/main.yml index 5faefea..5d58c03 100644 --- a/nextcloud/ansible/roles/nextcloud/tasks/main.yml +++ b/nextcloud/ansible/roles/nextcloud/tasks/main.yml @@ -385,6 +385,12 @@ - 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. # @@ -393,13 +399,21 @@ 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_smtphost --value={{ mail_smtphost }} --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_smtpauth --value={{ mail_smtpauth }} --type=bool - /usr/bin/php {{ nextcloud_occ }} config:system:set mail_smtppassword --value={{ mail_smtppassword }} --type=string - /usr/bin/php {{ nextcloud_occ }} config:system:set mail_smtpport --value={{ mail_smtpport }} --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: