mirror of
https://github.com/spantaleev/matrix-docker-ansible-deploy.git
synced 2024-12-12 08:43:55 +02:00
removed dhcp option
This commit is contained in:
parent
de1511b4bb
commit
19721be8b1
@ -1,28 +1,25 @@
|
||||
# Whether dynamic dns is enabled
|
||||
matrix_dynamic_dns_enabled: false
|
||||
|
||||
# Allowed values: 'daemon', 'dhcp'
|
||||
matrix_dynamic_dns_mode: 'daemon'
|
||||
|
||||
# The dynamic dns daemon interval
|
||||
matrix_dynamic_dns_daemon_interval: '300'
|
||||
|
||||
# The docker container to use when in daemon mode
|
||||
# The docker container to use when in mode
|
||||
matrix_dynamic_dns_docker_image: 'linuxserver/ddclient'
|
||||
|
||||
# The image to force pull
|
||||
matrix_dynamic_dns_docker_image_force_pull: "{{ matrix_dynamic_dns_docker_image.endswith(':latest') }}"
|
||||
|
||||
# List of extra arguments to pass to the ontainer daemon mode
|
||||
# List of extra arguments to pass to the ontainer mode
|
||||
matrix_dynamic_dns_container_extra_arguments: []
|
||||
|
||||
# List of wanted services when running in daemon mode
|
||||
# List of wanted services when running in mode
|
||||
matrix_dynamic_dns_systemd_wanted_services_list: []
|
||||
|
||||
# List of required services when running in daemon mode
|
||||
# List of required services when running in mode
|
||||
matrix_dynamic_dns_systemd_required_services_list: ['docker.service']
|
||||
|
||||
# Build the container from source when running in daemon mode
|
||||
# Build the container from source when running in mode
|
||||
matrix_dynamic_dns_container_image_self_build: false
|
||||
|
||||
# Config paths
|
||||
|
@ -1,7 +1,3 @@
|
||||
- set_fact:
|
||||
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['ddclient'] }}"
|
||||
when: "matrix_dynamic_dns_enabled|bool and matrix_dynamic_dns_mode == 'dhcp'"
|
||||
|
||||
- set_fact:
|
||||
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-dynamic-dns'] }}"
|
||||
when: "matrix_dynamic_dns_enabled|bool and matrix_dynamic_dns_mode == 'daemon'"
|
||||
when: "matrix_dynamic_dns_enabled|bool"
|
||||
|
@ -1,17 +0,0 @@
|
||||
---
|
||||
|
||||
- name: Ensure ddclient domain config exists
|
||||
template:
|
||||
src: "{{ role_path }}/templates/ddclient.conf.j2"
|
||||
dest: "/etc/ddclient.conf"
|
||||
mode: 0600
|
||||
|
||||
- name: Ensure ddclient client config exists
|
||||
copy:
|
||||
content: "run_dhclient=\"true\"\nrun_ipup=\"false\"\nrun_daemon=\"false\""
|
||||
dest: "/etc/default/ddclient"
|
||||
mode: 0600
|
||||
owner: "{{ matrix_user_username }}"
|
||||
group: "{{ matrix_user_groupname }}"
|
||||
|
||||
- import_tasks: "{{ role_path }}/tasks/platform/main.yml"
|
@ -8,26 +8,14 @@
|
||||
- setup-all
|
||||
- setup-dynamic-dns
|
||||
|
||||
- import_tasks: "{{ role_path }}/tasks/install_dhcp.yml"
|
||||
when: "run_setup|bool and matrix_dynamic_dns_enabled|bool and matrix_dynamic_dns_mode == 'dhcp'"
|
||||
- import_tasks: "{{ role_path }}/tasks/install.yml"
|
||||
when: "run_setup|bool and matrix_dynamic_dns_enabled|bool"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-dynamic-dns
|
||||
|
||||
- import_tasks: "{{ role_path }}/tasks/uninstall_dhcp.yml"
|
||||
when: "run_setup|bool and not matrix_dynamic_dns_enabled|bool and matrix_dynamic_dns_mode == 'dhcp'"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-dynamic-dns
|
||||
|
||||
- import_tasks: "{{ role_path }}/tasks/install_daemon.yml"
|
||||
when: "run_setup|bool and matrix_dynamic_dns_enabled|bool and matrix_dynamic_dns_mode == 'daemon'"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-dynamic-dns
|
||||
|
||||
- import_tasks: "{{ role_path }}/tasks/uninstall_daemon.yml"
|
||||
when: "run_setup|bool and not matrix_dynamic_dns_enabled|bool and matrix_dynamic_dns_mode == 'daemon'"
|
||||
- import_tasks: "{{ role_path }}/tasks/uninstall.yml"
|
||||
when: "run_setup|bool and not matrix_dynamic_dns_enabled|bool"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-dynamic-dns
|
||||
|
@ -1,33 +0,0 @@
|
||||
---
|
||||
|
||||
- import_tasks: "{{ role_path }}/tasks/platform/main.yml"
|
||||
|
||||
- name: Check existence of ddclient.service
|
||||
stat:
|
||||
path: "{{ systemd_path }}/ddclient.service"
|
||||
register: matrix_dynamic_dns_ddclient_service_stat
|
||||
|
||||
- name: Ensure ddclient.service is stopped
|
||||
service:
|
||||
name: dynamic-dns
|
||||
state: stopped
|
||||
daemon_reload: yes
|
||||
when: "matrix_dynamic_dns_ddclient_service_stat.stat.exists"
|
||||
|
||||
- name: Ensure ddclient.service doesn't exist
|
||||
file:
|
||||
path: "{{ systemd_path }}/ddclient.service"
|
||||
state: absent
|
||||
when: "matrix_dynamic_dns_ddclient_service_stat.stat.exists"
|
||||
|
||||
- name: Ensure ddclient configuration files don't exist
|
||||
file:
|
||||
path:
|
||||
- "etc/ddclient.conf"
|
||||
- "etc/default/ddclient"
|
||||
state: absent
|
||||
|
||||
- name: Ensure systemd reloaded after ddclient.service removal
|
||||
service:
|
||||
daemon_reload: yes
|
||||
when: "matrix_dynamic_dns_ddclient_service_stat.stat.exists"
|
@ -8,10 +8,3 @@
|
||||
with_items:
|
||||
- "matrix_dynamic_dns_domain"
|
||||
- "matrix_dynamic_dns_provider"
|
||||
- "matrix_dynamic_dns_mode"
|
||||
|
||||
- name: Fail if dynamic dns mode is incorrect
|
||||
fail:
|
||||
msg: >-
|
||||
matrix_dynamic_dns_mode needs to be set to 'daemon' or 'dhcp'
|
||||
when: "matrix_dynamic_dns_enabled and matrix_dynamic_dns_mode != 'daemon' and matrix_dynamic_dns_mode != 'dhcp'"
|
||||
|
@ -1,7 +1,6 @@
|
||||
{% if matrix_dynamic_dns_mode == "daemon" %}}
|
||||
daemon={{ matrix_dynamic_dns_daemon_interval }}
|
||||
syslog=no
|
||||
pid=/var/run/ddclient/ddclient.pid {% endif %}
|
||||
pid=/var/run/ddclient/ddclient.pid
|
||||
ssl=yes
|
||||
use={{ matrix_dynamic_dns_use }}
|
||||
protocol={{ matrix_dynamic_dns_protocol }}
|
||||
|
Loading…
Reference in New Issue
Block a user