You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
70 lines
3.2 KiB
70 lines
3.2 KiB
4 years ago
|
---
|
||
|
|
||
|
- name: Ensure Dynamic DNS image is pulled
|
||
2 years ago
|
community.docker.docker_image:
|
||
4 years ago
|
name: "{{ matrix_dynamic_dns_docker_image }}"
|
||
|
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
|
||
|
force_source: "{{ matrix_dynamic_dns_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
|
||
|
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_dynamic_dns_docker_image_force_pull }}"
|
||
2 years ago
|
when: matrix_dynamic_dns_enabled | bool and not matrix_dynamic_dns_container_image_self_build
|
||
3 years ago
|
register: result
|
||
2 years ago
|
retries: "{{ devture_playbook_help_container_retries_count }}"
|
||
|
delay: "{{ devture_playbook_help_container_retries_delay }}"
|
||
3 years ago
|
until: result is not failed
|
||
4 years ago
|
|
||
|
- name: Ensure Dynamic DNS paths exist
|
||
2 years ago
|
ansible.builtin.file:
|
||
4 years ago
|
path: "{{ item.path }}"
|
||
|
state: directory
|
||
4 years ago
|
mode: 0751
|
||
4 years ago
|
owner: "{{ matrix_user_username }}"
|
||
|
group: "{{ matrix_user_groupname }}"
|
||
|
with_items:
|
||
3 years ago
|
- {path: "{{ matrix_dynamic_dns_base_path }}", when: true}
|
||
|
- {path: "{{ matrix_dynamic_dns_config_path }}", when: true}
|
||
|
- {path: "{{ matrix_dynamic_dns_docker_src_files_path }}", when: "{{ matrix_dynamic_dns_container_image_self_build }}"}
|
||
2 years ago
|
when: matrix_dynamic_dns_enabled | bool and item.when | bool
|
||
4 years ago
|
|
||
|
- name: Ensure Dynamic DNS repository is present on self build
|
||
2 years ago
|
ansible.builtin.git:
|
||
4 years ago
|
repo: "{{ matrix_dynamic_dns_container_image_self_build_repo }}"
|
||
2 years ago
|
version: "{{ matrix_dynamic_dns_container_image_self_build_repo_branch }}"
|
||
4 years ago
|
dest: "{{ matrix_dynamic_dns_docker_src_files_path }}"
|
||
|
force: "yes"
|
||
3 years ago
|
become: true
|
||
|
become_user: "{{ matrix_user_username }}"
|
||
4 years ago
|
register: matrix_dynamic_dns_git_pull_results
|
||
2 years ago
|
when: "matrix_dynamic_dns_enabled | bool and matrix_dynamic_dns_container_image_self_build | bool"
|
||
4 years ago
|
|
||
|
- name: Ensure Dynamic DNS Docker image is built
|
||
2 years ago
|
community.docker.docker_image:
|
||
4 years ago
|
name: "{{ matrix_dynamic_dns_docker_image }}"
|
||
|
source: build
|
||
4 years ago
|
force_source: "{{ matrix_dynamic_dns_git_pull_results.changed if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
|
||
|
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_dynamic_dns_git_pull_results.changed }}"
|
||
4 years ago
|
build:
|
||
|
dockerfile: Dockerfile
|
||
|
path: "{{ matrix_dynamic_dns_docker_src_files_path }}"
|
||
3 years ago
|
pull: true
|
||
2 years ago
|
when: "matrix_dynamic_dns_enabled | bool and matrix_dynamic_dns_container_image_self_build | bool"
|
||
4 years ago
|
|
||
|
- name: Ensure Dynamic DNS ddclient.conf installed
|
||
2 years ago
|
ansible.builtin.template:
|
||
4 years ago
|
src: "{{ role_path }}/templates/ddclient.conf.j2"
|
||
|
dest: "{{ matrix_dynamic_dns_config_path }}/ddclient.conf"
|
||
|
mode: 0644
|
||
|
owner: "{{ matrix_user_username }}"
|
||
|
group: "{{ matrix_user_groupname }}"
|
||
|
|
||
|
- name: Ensure matrix-dynamic-dns.service installed
|
||
2 years ago
|
ansible.builtin.template:
|
||
4 years ago
|
src: "{{ role_path }}/templates/systemd/matrix-dynamic-dns.service.j2"
|
||
|
dest: "/etc/systemd/system/matrix-dynamic-dns.service"
|
||
|
mode: 0644
|
||
|
register: matrix_dynamic_dns_systemd_service_result
|
||
|
|
||
|
- name: Ensure systemd reloaded after matrix-dynamic-dns.service installation
|
||
2 years ago
|
ansible.builtin.service:
|
||
3 years ago
|
daemon_reload: true
|
||
4 years ago
|
when: "matrix_dynamic_dns_systemd_service_result.changed"
|