Compare commits
No commits in common. "6dd44dfe8775e1de73efc717dad172a0470a30d5" and "efbecdbc238761786da5f82b72a49b1b9ba4a1b4" have entirely different histories.
6dd44dfe87
...
efbecdbc23
@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
namespace: happydns
|
namespace: happydns
|
||||||
name: happydomain
|
name: happydomain
|
||||||
version: 0.2.3
|
version: 0.2.2
|
||||||
readme: README.md
|
readme: README.md
|
||||||
authors:
|
authors:
|
||||||
- happyDomain Team <happydomain.org>
|
- happyDomain Team <happydomain.org>
|
||||||
|
@ -1,7 +1,4 @@
|
|||||||
---
|
---
|
||||||
use_container: false
|
|
||||||
state: present
|
|
||||||
|
|
||||||
instance_name: "happyDomain"
|
instance_name: "happyDomain"
|
||||||
happydomain_version: "latest"
|
happydomain_version: "latest"
|
||||||
|
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
#!/sbin/openrc-run
|
|
||||||
# Copyright 2016-2017 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
|
|
||||||
description="happyDomain Domain Managment Server"
|
|
||||||
pidfile=${pidfile:-"/run/${SVCNAME}.pid"}
|
|
||||||
command="/usr/bin/happydomain"
|
|
||||||
command_background="true"
|
|
||||||
start_stop_daemon_args="--stdout /var/log/${SVCNAME}/${SVCNAME}.log \
|
|
||||||
--stderr /var/log/${SVCNAME}/${SVCNAME}.log -u happydomain -g happydomain"
|
|
@ -1,9 +0,0 @@
|
|||||||
---
|
|
||||||
- name: restart happyDomain
|
|
||||||
ansible.builtin.service:
|
|
||||||
name: happydomain
|
|
||||||
state: restarted
|
|
||||||
|
|
||||||
- name: reload systemd
|
|
||||||
ansible.builtin.systemd:
|
|
||||||
daemon_reload: true
|
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
- name: "launch happyDomain container ({{ instance_name }})"
|
- name: "launch happyDomain container ({{ instance_name }})"
|
||||||
community.general.docker_container:
|
docker_container:
|
||||||
name: "{{ instance_name }}"
|
name: "{{ instance_name }}"
|
||||||
image: "happydomain/happydomain:{{ happydomain_version }}"
|
image: "happydomain/happydomain:{{ happydomain_version }}"
|
||||||
pull: true
|
pull: true
|
||||||
|
@ -1,79 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Download happydomain binary
|
|
||||||
ansible.builtin.get_url:
|
|
||||||
url: "https://get.happydomain.org/{% if happydomain_version == 'latest' %}master{% else %}{{ happydomain_version }}{% endif %}/happydomain-{{ ansible_system | lower }}-{% if ansible_architecture == 'armv7l' %}armv7{% elif ansible_architecture == 'aarch64' %}arm64{% elif ansible_architecture == 'x86_64' %}amd64{% else %}{{ ansible_architecture }}{% endif %}"
|
|
||||||
dest: /usr/bin/happydomain
|
|
||||||
mode: '0755'
|
|
||||||
|
|
||||||
- name: "ensure happydomain group exists"
|
|
||||||
ansible.builtin.group:
|
|
||||||
name: happydomain
|
|
||||||
gid: 533
|
|
||||||
system: true
|
|
||||||
|
|
||||||
- name: "ensure happydomain user exists"
|
|
||||||
ansible.builtin.user:
|
|
||||||
name: happydomain
|
|
||||||
comment: happyDomain user
|
|
||||||
shell: /sbin/nologin
|
|
||||||
uid: 533
|
|
||||||
group: happydomain
|
|
||||||
system: true
|
|
||||||
home: /var/lib/happydomain
|
|
||||||
|
|
||||||
- name: "configure happyDomain"
|
|
||||||
ansible.builtin.template:
|
|
||||||
src: happydomain.conf.j2
|
|
||||||
dest: "/etc/happydomain.conf"
|
|
||||||
mode: 0755
|
|
||||||
notify:
|
|
||||||
- restart happyDomain
|
|
||||||
|
|
||||||
- name: Create data directory
|
|
||||||
ansible.builtin.file:
|
|
||||||
path: "{% if happydomain_data_dir != '' %}{{ happydomain_data_dir }}{% else %}/var/lib/happydomain{% if instance_name != 'happyDomain' %}.{{ instance_name }}{% endif %}{% endif %}"
|
|
||||||
owner: happydomain
|
|
||||||
group: happydomain
|
|
||||||
state: directory
|
|
||||||
|
|
||||||
- name: "setup init script for happyDomain"
|
|
||||||
ansible.builtin.copy:
|
|
||||||
src: happydomain.initd
|
|
||||||
dest: "/etc/init.d/happydomain{% if instance_name is defined and instance_name != 'happyDomain' %}.{{ instance_name }}{% endif %}"
|
|
||||||
mode: 0755
|
|
||||||
when: ansible_service_mgr == "openrc"
|
|
||||||
|
|
||||||
- name: "create log dir for happydomain"
|
|
||||||
ansible.builtin.file:
|
|
||||||
path: "/var/log/happydomain{% if instance_name is defined and instance_name != 'happyDomain' %}.{{ instance_name }}{% endif %}"
|
|
||||||
mode: 0755
|
|
||||||
owner: happydomain
|
|
||||||
group: happydomain
|
|
||||||
state: directory
|
|
||||||
when: ansible_service_mgr == "openrc"
|
|
||||||
|
|
||||||
- name: "setup systemd service for happyDomain"
|
|
||||||
ansible.builtin.template:
|
|
||||||
src: happydomain.service.j2
|
|
||||||
dest: "/lib/systemd/system/happydomain{% if instance_name is defined and instance_name != 'happyDomain' %}-{{ instance_name }}{% endif %}.service"
|
|
||||||
mode: 0644
|
|
||||||
notify:
|
|
||||||
- reload systemd
|
|
||||||
when: ansible_service_mgr == "systemd"
|
|
||||||
|
|
||||||
- name: Flush handlers
|
|
||||||
meta: flush_handlers
|
|
||||||
|
|
||||||
- name: "ensure happyDomain is running and enabled"
|
|
||||||
ansible.builtin.service:
|
|
||||||
name: "happydomain{% if instance_name is defined and instance_name != 'happyDomain' %}.{{ instance_name }}{% endif %}"
|
|
||||||
enabled: yes
|
|
||||||
state: started
|
|
||||||
when: ansible_service_mgr == "openrc"
|
|
||||||
|
|
||||||
- name: "ensure happyDomain is running and enabled"
|
|
||||||
ansible.builtin.service:
|
|
||||||
name: "happydomain{% if instance_name is defined and instance_name != 'happyDomain' %}-{{ instance_name }}{% endif %}"
|
|
||||||
enabled: yes
|
|
||||||
state: started
|
|
||||||
when: ansible_service_mgr == "systemd"
|
|
@ -1,19 +1,9 @@
|
|||||||
---
|
---
|
||||||
- block:
|
- include_tasks: docker.yml
|
||||||
- include_tasks: download.yml
|
|
||||||
when: not use_container
|
|
||||||
|
|
||||||
- include_tasks: docker.yml
|
- name: Ensure cleaning job runs every day.
|
||||||
when: use_container
|
cron:
|
||||||
|
name: "run {{ instance_name }} database cleaning"
|
||||||
- name: Ensure cleaning job runs every day.
|
hour: "3"
|
||||||
ansible.builtin.cron:
|
minute: "0"
|
||||||
name: "run {{ instance_name }} database cleaning"
|
job: "docker exec {{ instance_name }} hadmin /api/tidy -X POST"
|
||||||
hour: "3"
|
|
||||||
minute: "0"
|
|
||||||
job: "docker exec {{ instance_name }} hadmin /api/tidy -X POST"
|
|
||||||
|
|
||||||
when: state == 'present'
|
|
||||||
|
|
||||||
- include_tasks: remove.yml
|
|
||||||
when: state == 'absent'
|
|
||||||
|
@ -1,33 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Stop the service
|
|
||||||
ansible.builtin.service:
|
|
||||||
name: happydomain
|
|
||||||
state: stopped
|
|
||||||
enabled: false
|
|
||||||
|
|
||||||
- name: Remove happydomain binary
|
|
||||||
ansible.builtin.file:
|
|
||||||
path: /usr/bin/happydomain
|
|
||||||
state: absent
|
|
||||||
|
|
||||||
- name: Remove happydomain user
|
|
||||||
ansible.builtin.user:
|
|
||||||
name: happydomain
|
|
||||||
state: absent
|
|
||||||
|
|
||||||
- name: Remove happydomain group
|
|
||||||
ansible.builtin.group:
|
|
||||||
name: happydomain
|
|
||||||
state: absent
|
|
||||||
|
|
||||||
- name: Remove init script
|
|
||||||
ansible.builtin.file:
|
|
||||||
path: /etc/init.d/happydomain
|
|
||||||
state: absent
|
|
||||||
|
|
||||||
- name: Remove systemd service
|
|
||||||
ansible.builtin.file:
|
|
||||||
path: /lib/systemd/system/happydomain.service
|
|
||||||
state: absent
|
|
||||||
notify:
|
|
||||||
- reload systemd
|
|
@ -1,58 +0,0 @@
|
|||||||
{% if happydomain_admin_bind is defined and happydomain_admin_bind != "" %}
|
|
||||||
admin-bind={{ happydomain_admin_bind }}
|
|
||||||
{% endif %}
|
|
||||||
{% if happydomain_bind is defined and happydomain_bind != "" %}
|
|
||||||
bind={{ happydomain_bind }}
|
|
||||||
{% endif %}
|
|
||||||
{% if happydomain_baseurl is defined and happydomain_baseurl != "" %}
|
|
||||||
baseurl={{ happydomain_baseurl }}
|
|
||||||
{% endif %}
|
|
||||||
{% if happydomain_custom_head_html is defined and happydomain_custom_head_html != "" %}
|
|
||||||
custom-head-html={{ happydomain_custom_head_html }}
|
|
||||||
{% endif %}
|
|
||||||
{% if happydomain_custom_body_html is defined and happydomain_custom_body_html != "" %}
|
|
||||||
custom-body-html={{ happydomain_custom_body_html }}
|
|
||||||
{% endif %}
|
|
||||||
{% if happydomain_default_nameserver is defined and happydomain_default_nameserver != "" %}
|
|
||||||
default-ns={{ happydomain_default_nameserver }}
|
|
||||||
{% endif %}
|
|
||||||
{% if happydomain_external_auth is defined and happydomain_external_auth != "" %}
|
|
||||||
external-auth={{ happydomain_external_auth }}
|
|
||||||
{% endif %}
|
|
||||||
{% if happydomain_external_url is defined and happydomain_external_url != "" %}
|
|
||||||
externalurl={{ happydomain_external_url }}
|
|
||||||
{% endif %}
|
|
||||||
{% if happydomain_jwt_secret_key is defined and happydomain_jwt_secret_key != "" %}
|
|
||||||
jwt-secret-key={{ happydomain_jwt_secret_key }}
|
|
||||||
{% 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 }}
|
|
||||||
{% endif %}
|
|
||||||
{% if happydomain_mail_smtp_host is defined and happydomain_mail_smtp_host != "" %}
|
|
||||||
mail-smtp-host={{ happydomain_mail_smtp_host }}
|
|
||||||
{% endif %}
|
|
||||||
{% if happydomain_mail_smtp_port is defined and happydomain_mail_smtp_port != "" %}
|
|
||||||
mail-smtp-port={{ happydomain_mail_smtp_port }}
|
|
||||||
{% endif %}
|
|
||||||
{% if happydomain_mail_smtp_username is defined and happydomain_mail_smtp_username != "" %}
|
|
||||||
mail-smtp-username={{ happydomain_mail_smtp_username }}
|
|
||||||
{% endif %}
|
|
||||||
{% if happydomain_mail_smtp_password is defined and happydomain_mail_smtp_password != "" %}
|
|
||||||
mail-smtp-password={{ happydomain_mail_smtp_password }}
|
|
||||||
{% endif %}
|
|
||||||
{% 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_no_auth is defined and happydomain_no_auth != "" %}
|
|
||||||
no-auth={{ happydomain_no_auth }}
|
|
||||||
{% endif %}
|
|
||||||
{% if happydomain_storage_engine is defined and happydomain_storage_engine != "" %}
|
|
||||||
storage-engine={{ happydomain_storage_engine }}
|
|
||||||
{% endif %}
|
|
||||||
{% if happydomain_ovh_application_key is defined and happydomain_ovh_application_key != "" %}
|
|
||||||
ovh-application-key={{ happydomain_ovh_application_key }}
|
|
||||||
{% endif %}
|
|
||||||
{% if happydomain_ovh_application_secret is defined and happydomain_ovh_application_secret != "" %}
|
|
||||||
ovh-application-secret={{ happydomain_ovh_application_secret }}
|
|
||||||
{% endif %}
|
|
@ -1,14 +0,0 @@
|
|||||||
[Unit]
|
|
||||||
Description=happyDomain Domain Managment Server
|
|
||||||
After=network.target nss-lookup.target
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=exec
|
|
||||||
ExecStart=/usr/bin/happydomain
|
|
||||||
WorkingDirectory={% if happydomain_data_dir != '' %}{{ happydomain_data_dir }}{% else %}/var/lib/happydomain{% if instance_name != 'happyDomain' %}.{{ instance_name }}{% endif %}{% endif %}
|
|
||||||
|
|
||||||
User=happydomain
|
|
||||||
Group=happydomain
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
Loading…
x
Reference in New Issue
Block a user