Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
Commit 5ed53953 authored by Arthur BOUDREAULT's avatar Arthur BOUDREAULT
Browse files

feat: Added smtp_relay support

parent 0717812d
No related branches found
No related tags found
No related merge requests found
Pipeline #2899 passed with warnings
This commit is part of merge request !14. Comments created here will be created in the context of that merge request.
...@@ -36,6 +36,15 @@ ynh_users: null ...@@ -36,6 +36,15 @@ ynh_users: null
# lastname: Doe # lastname: Doe
# mail_domain: domain.tld # mail_domain: domain.tld
# SMTP custom settings ( Only override if you need a SMTP relay)
ynh_smtp_get_cli: yunohost settings get smtp.relay
ynh_smtp_set_cli: yunohost settings set smtp.relay
ynh_new_smtp_relay: null
# host: smtp.domain.tld
# port: 25
# user: user1
# password: Pa$$w0rd
# The list of Yunohost apps. # The list of Yunohost apps.
ynh_apps: null ynh_apps: null
# - label: Tiny Tiny RSS # - label: Tiny Tiny RSS
......
...@@ -60,6 +60,10 @@ ...@@ -60,6 +60,10 @@
ansible.builtin.command: yunohost domain cert-install ansible.builtin.command: yunohost domain cert-install
changed_when: False changed_when: False
- name: Configure SMTP relay
ansible.builtin.include_tasks: smtp_relay.yml
when: ynh_new_smtp_relay
- name: Add Yunohost users - name: Add Yunohost users
ansible.builtin.include_tasks: users.yml ansible.builtin.include_tasks: users.yml
when: ynh_users when: ynh_users
......
---
#-----------------------------------------------------------------------------#
# ansible-yunohost allows to deploy Yunohost using Ansible #
# Copyright 2021-2021 Lydra https://www.lydra.fr/ #
# #
# this program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# this program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
# #
#-----------------------------------------------------------------------------#
# - name: Get current SMTP relay host
# ansible.builtin.command: "{{ ynh_smtp_get_cli }}.host"
# register: ynh_old_smtp_relay_host
# changed_when: False
# - name: Set new SMTP relay host
# ansible.builtin.command: "{{ ynh_smtp_set_cli }}.host -v {{ ynh_new_smtp_relay.host }}"
# when: ynh_old_smtp_relay_host.stdout != ynh_new_smtp_relay.host
# - name: Get current SMTP relay port
# ansible.builtin.command: "{{ ynh_smtp_get_cli }}.port"
# register: ynh_old_smtp_port
# changed_when: False
# - name: Set new SMTP relay port
# ansible.builtin.command: "{{ ynh_smtp_set_cli }}.host -v {{ ynh_new_smtp_relay.port }}"
# when: ynh_old_smtp_port.stdout != ynh_new_smtp_relay.port
# - name: Get current SMTP relay username
# ansible.builtin.command: "{{ ynh_smtp_get_cli }}.user"
# register: ynh_old_smtp_user
# changed_when: False
# - name: Set new SMTP relay username
# ansible.builtin.command: "{{ ynh_smtp_set_cli }}.user -v {{ ynh_new_smtp_relay.user }}"
# when: ynh_old_smtp_user.stdout != ynh_new_smtp_relay.user
# - name: Get current SMTP relay password
# ansible.builtin.command: "{{ ynh_smtp_get_cli }}.password"
# register: ynh_old_smtp_password
# changed_when: False
# - name: Set new SMTP relay password
# ansible.builtin.command: "{{ ynh_smtp_set_cli }}.host -v {{ ynh_new_smtp_relay.password }}"
# when: ynh_old_smtp_password.stdout != ynh_new_smtp_relay.password
# - name: Set new SMTP relay port
# ansible.builtin.command: "{{ ynh_smtp_set_cli }}.host -v {{ ynh_smtp_relay.host }}"
# when: ynh_smtp_host_config.stdout != ynh_smtp_relay.host
- name: Get current SMTP settings
ansible.builtin.command:
"{{ ynh_smtp_get_cli }}.{{ item }}"
register: _ynh_smtp_current_values
with_items: "{{ ynh_new_smtp_relay }}"
changed_when: False
- name: Set new SMTP settings
ansible.builtin.command:
"{{ ynh_smtp_set_cli }}.{{ item.key }} -v {{ item.value }}"
with_items: "{{ ynh_new_smtp_relay | dict2items }}"
changed_when: False
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment