Compare commits
16 Commits
Author | SHA1 | Date | |
---|---|---|---|
9a3b521f42 | |||
98d060056f | |||
4b446e51f0 | |||
b1e3c3be53 | |||
a69b4364fd | |||
67d954473a | |||
a35d78be37 | |||
cc55808f31 | |||
d01ebe66af | |||
bd820e4c53 | |||
734e89e720 | |||
360bc2a587 | |||
106e879eb9 | |||
5199779fb2 | |||
9b25bd8412 | |||
2ddbb56ce5 |
|
@ -1,7 +1,7 @@
|
|||
---
|
||||
namespace: happydns
|
||||
name: happydomain
|
||||
version: 0.3.1
|
||||
version: 0.4.4
|
||||
readme: README.md
|
||||
authors:
|
||||
- happyDomain Team <happydomain.org>
|
||||
|
|
|
@ -62,7 +62,7 @@ def main():
|
|||
result['current_zone'] = d.current_zone.id
|
||||
result['msg'] += " and zone imported"
|
||||
else:
|
||||
result['current_zone'] = d.current_zone
|
||||
result['current_zone'] = d.current_zone.id
|
||||
break
|
||||
|
||||
if not found:
|
||||
|
|
|
@ -54,9 +54,10 @@ def main():
|
|||
for d in domains:
|
||||
if d.domain == p['domain'] or d.domain == p['domain'] + ".":
|
||||
for z in d.zone_history:
|
||||
if z == p['zone']:
|
||||
zone = d.get_zone(z)
|
||||
if p['zone'] is None or z == p['zone']:
|
||||
zone = d.get_zone(z.id)
|
||||
|
||||
skipAdd = False
|
||||
if p['subdomain'].removesuffix(d.domain) in zone.services:
|
||||
for s in zone.services[p['subdomain'].removesuffix(d.domain)]:
|
||||
if s._svctype == p['type']:
|
||||
|
@ -67,19 +68,20 @@ def main():
|
|||
differ = True
|
||||
break
|
||||
|
||||
if p['erase_others']:
|
||||
if p['state'] == 'absent' and not differ:
|
||||
s.delete()
|
||||
result['changed'] = True
|
||||
elif p['erase_others']:
|
||||
if differ:
|
||||
s.delete()
|
||||
result['changed'] = True
|
||||
elif not differ:
|
||||
if p['state'] == 'absent':
|
||||
s.delete()
|
||||
result['changed'] = True
|
||||
else:
|
||||
module.exit_json(**result)
|
||||
return
|
||||
skipAdd = True
|
||||
elif not differ:
|
||||
module.exit_json(**result)
|
||||
return
|
||||
|
||||
if p['state'] != 'absent':
|
||||
if not skipAdd and p['state'] != 'absent':
|
||||
zone.add_zone_service(
|
||||
p['subdomain'].removesuffix(d.domain),
|
||||
p['type'],
|
||||
|
@ -88,14 +90,16 @@ def main():
|
|||
result['changed'] = True
|
||||
|
||||
|
||||
if p['apply_changes']:
|
||||
if p['apply_changes'] and result['changed']:
|
||||
zone.apply_changes()
|
||||
result['published'] = True
|
||||
result['changed'] = True
|
||||
|
||||
break
|
||||
else:
|
||||
module.fail_json(msg="No zone found with id " + p['zone'])
|
||||
if p['zone'] is None:
|
||||
module.fail_json(msg="No zone found in domain " + p['domain'])
|
||||
else:
|
||||
module.fail_json(msg="No zone found with id " + p['zone'])
|
||||
return
|
||||
break
|
||||
else:
|
||||
|
|
|
@ -7,24 +7,33 @@ happydomain_version: "latest"
|
|||
|
||||
happydomain_data_dir: "" # defaults to /var/lib/happydomain.{{ instance_name }} if not filled
|
||||
happydomain_inner_data_dir: "/data"
|
||||
|
||||
happydomain_docker_mounts:
|
||||
- source: "{% if happydomain_data_dir != '' %}{{ happydomain_data_dir }}{% else %}/var/lib/{% if instance_name != 'happyDomain' %}happydomain.{% endif %}{{ instance_name }}{% endif %}"
|
||||
target: "{{ happydomain_inner_data_dir }}"
|
||||
type: "bind"
|
||||
happydomain_admin_bind: "./happydomain.sock"
|
||||
happydomain_baseurl: ""
|
||||
happydomain_custom_body_html: ""
|
||||
happydomain_custom_head_html: ""
|
||||
happydomain_default_nameserver: "127.0.0.1:53"
|
||||
happydomain_disable_providers_edit: "false"
|
||||
happydomain_endpoint: ":8081"
|
||||
happydomain_external_auth: ""
|
||||
happydomain_external_url: "http://localhost:8081"
|
||||
happydomain_hide_feedback_button: "false"
|
||||
happydomain_jwt_secret_key: ""
|
||||
happydomain_storage_leveldb_path: "./happydomain.db"
|
||||
happydomain_mail_from: "happyDomain <happydomain@localhost>"
|
||||
happydomain_mail_smtp_host: ""
|
||||
happydomain_mail_smtp_port: "465"
|
||||
happydomain_mail_smtp_username: ""
|
||||
happydomain_mail_smtp_password: ""
|
||||
happydomain_mail_smtp_tls_no_verify: ""
|
||||
happydomain_msg_header_text: ""
|
||||
happydomain_msg_header_color: "danger"
|
||||
happydomain_newsletter_server_url: ""
|
||||
happydomain_newsletter_id: ""
|
||||
happydomain_no_auth: "false"
|
||||
happydomain_ovh_application_key: ""
|
||||
happydomain_ovh_application_secret: ""
|
||||
happydomain_storage_engine: "leveldb"
|
||||
happydomain_storage_leveldb_path: "./happydomain.db"
|
||||
|
|
|
@ -4,22 +4,30 @@
|
|||
name: "{{ instance_name }}"
|
||||
image: "happydomain/happydomain:{{ happydomain_version }}"
|
||||
pull: true
|
||||
volumes:
|
||||
- "{% if happydomain_data_dir != '' %}{{ happydomain_data_dir }}{% else %}/var/lib/{% if instance_name != 'happyDomain' %}happydomain.{% endif %}{{ instance_name }}{% endif %}:{{ happydomain_inner_data_dir }}"
|
||||
state: started
|
||||
restart: "{{ happydomain_docker_restart | default('no') }}"
|
||||
restart_policy: unless-stopped
|
||||
memory: 256M
|
||||
memory_swap: 512M
|
||||
mounts: "{{ happydomain_docker_mounts }}"
|
||||
tmpfs: "{{ happydomain_docker_tmpfs | default([]) }}"
|
||||
networks: "{{ happydomain_docker_network | default([]) }}"
|
||||
env:
|
||||
HAPPYDOMAIN_ADMIN_BIND: "{{ happydomain_admin_bind }}"
|
||||
HAPPYDOMAIN_BIND: "0.0.0.0:8081"
|
||||
HAPPYDOMAIN_BASEURL: "{{ happydomain_baseurl }}"
|
||||
HAPPYDOMAIN_CUSTOM_HEAD_HTML: "{{ happydomain_custom_head_html }}"
|
||||
HAPPYDOMAIN_DEFAULT_NS: "{{ happydomain_default_nameserver }}"
|
||||
HAPPYDOMAIN_DISABLE_PROVIDERS_EDIT: "{{ happydomain_disable_providers_edit }}"
|
||||
HAPPYDOMAIN_EXTERNAL_AUTH: "{{ happydomain_external_auth }}"
|
||||
HAPPYDOMAIN_EXTERNALURL: "{{ happydomain_external_url }}"
|
||||
HAPPYDOMAIN_HIDE_FEEDBACK_BUTTON: "{{ happydomain_hide_feedback_button }}"
|
||||
HAPPYDOMAIN_JWT_SECRET_KEY: "{{ happydomain_jwt_secret_key }}"
|
||||
HAPPYDOMAIN_LEVELDB_PATH: "{{ happydomain_storage_leveldb_path }}"
|
||||
HAPPYDOMAIN_MSG_HEADER_TEXT: "{{ happydomain_msg_header_text }}"
|
||||
HAPPYDOMAIN_MSG_HEADER_COLOR: "{{ happydomain_msg_header_color }}"
|
||||
HAPPYDOMAIN_NEWSLETTER_SERVER_URL: "{{ happydomain_newsletter_server_url }}"
|
||||
HAPPYDOMAIN_NEWSLETTER_ID: "{{ happydomain_newsletter_id }}"
|
||||
HAPPYDOMAIN_MAIL_FROM: "{{ happydomain_mail_from }}"
|
||||
HAPPYDOMAIN_MAIL_SMTP_HOST: "{{ happydomain_mail_smtp_host }}"
|
||||
HAPPYDOMAIN_MAIL_SMTP_PORT: "{{ happydomain_mail_smtp_port }}"
|
||||
|
|
|
@ -16,6 +16,9 @@ custom-body-html={{ happydomain_custom_body_html }}
|
|||
{% if happydomain_default_nameserver is defined and happydomain_default_nameserver != "" %}
|
||||
default-ns={{ happydomain_default_nameserver }}
|
||||
{% endif %}
|
||||
{% if happydomain_disable_providers_edit is defined and happydomain_disable_providers_edit != "" %}
|
||||
disable-providers-edit={{ happydomain_disable_providers_edit }}
|
||||
{% endif %}
|
||||
{% if happydomain_external_auth is defined and happydomain_external_auth != "" %}
|
||||
external-auth={{ happydomain_external_auth }}
|
||||
{% endif %}
|
||||
|
@ -25,6 +28,9 @@ externalurl={{ happydomain_external_url }}
|
|||
{% if happydomain_jwt_secret_key is defined and happydomain_jwt_secret_key != "" %}
|
||||
jwt-secret-key={{ happydomain_jwt_secret_key }}
|
||||
{% endif %}
|
||||
{% if happydomain_hide_feedback_button is defined and happydomain_hide_feedback_button %}
|
||||
hide-feedback-button={{ happydomain_hide_feedback_button }}
|
||||
{% endif %}
|
||||
leveldb-path={{ happydomain_storage_leveldb_path | default(happydomain_data_dir + '/happydomain.db') }}
|
||||
{% if happydomain_mail_from is defined and happydomain_mail_from != "" %}
|
||||
mail-from={{ happydomain_mail_from }}
|
||||
|
@ -44,6 +50,18 @@ mail-smtp-password={{ happydomain_mail_smtp_password }}
|
|||
{% if happydomain_mail_smtp_tls_no_verify is defined and happydomain_mail_smtp_tls_no_verify != "" %}
|
||||
mail-smtp-tls-no-verify={{ happydomain_mail_smtp_tls_no_verify }}
|
||||
{% endif %}
|
||||
{% if happydomain_msg_header_text is defined and happydomain_msg_header_text != "" %}
|
||||
msg-header-text={{ happydomain_msg_header_text }}
|
||||
{% endif %}
|
||||
{% if happydomain_msg_header_color is defined and happydomain_msg_header_color != "" %}
|
||||
msg-header-color={{ happydomain_msg_header_color }}
|
||||
{% endif %}
|
||||
{% if happydomain_newsletter_server_url is defined and happydomain_newsletter_server_url != "" %}
|
||||
newsletter-server-url={{ happydomain_newsletter_server_url }}
|
||||
{% endif %}
|
||||
{% if happydomain_newsletter_id is defined and happydomain_newsletter_id != "" %}
|
||||
newsletter-id={{ happydomain_newsletter_id }}
|
||||
{% endif %}
|
||||
{% if happydomain_no_auth is defined and happydomain_no_auth != "" %}
|
||||
no-auth={{ happydomain_no_auth }}
|
||||
{% endif %}
|
||||
|
|
Loading…
Reference in New Issue
Block a user