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: