Use fully-qualified module names for builtin Ansible modules
Related to https://github.com/spantaleev/matrix-docker-ansible-deploy/pull/1939
This commit is contained in:
@ -2,10 +2,10 @@
|
||||
# See https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/1070
|
||||
# and https://github.com/spantaleev/matrix-docker-ansible-deploy/commit/1ab507349c752042d26def3e95884f6df8886b74#commitcomment-51108407
|
||||
- name: Fail if trying to self-build on Ansible < 2.8
|
||||
fail:
|
||||
ansible.builtin.fail:
|
||||
msg: "To self-build the Element image, you should use Ansible 2.8 or higher. See docs/ansible.md"
|
||||
when: "ansible_version.major == 2 and ansible_version.minor < 8 and matrix_dynamic_dns_container_image_self_build and matrix_dynamic_dns_enabled"
|
||||
|
||||
- set_fact:
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-dynamic-dns.service'] }}"
|
||||
when: "matrix_dynamic_dns_enabled|bool"
|
||||
|
@ -13,7 +13,7 @@
|
||||
until: result is not failed
|
||||
|
||||
- name: Ensure Dynamic DNS paths exist
|
||||
file:
|
||||
ansible.builtin.file:
|
||||
path: "{{ item.path }}"
|
||||
state: directory
|
||||
mode: 0751
|
||||
@ -26,7 +26,7 @@
|
||||
when: matrix_dynamic_dns_enabled|bool and item.when|bool
|
||||
|
||||
- name: Ensure Dynamic DNS repository is present on self build
|
||||
git:
|
||||
ansible.builtin.git:
|
||||
repo: "{{ matrix_dynamic_dns_container_image_self_build_repo }}"
|
||||
dest: "{{ matrix_dynamic_dns_docker_src_files_path }}"
|
||||
force: "yes"
|
||||
@ -48,7 +48,7 @@
|
||||
when: "matrix_dynamic_dns_enabled|bool and matrix_dynamic_dns_container_image_self_build|bool"
|
||||
|
||||
- name: Ensure Dynamic DNS ddclient.conf installed
|
||||
template:
|
||||
ansible.builtin.template:
|
||||
src: "{{ role_path }}/templates/ddclient.conf.j2"
|
||||
dest: "{{ matrix_dynamic_dns_config_path }}/ddclient.conf"
|
||||
mode: 0644
|
||||
@ -56,13 +56,13 @@
|
||||
group: "{{ matrix_user_groupname }}"
|
||||
|
||||
- name: Ensure matrix-dynamic-dns.service installed
|
||||
template:
|
||||
ansible.builtin.template:
|
||||
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
|
||||
service:
|
||||
ansible.builtin.service:
|
||||
daemon_reload: true
|
||||
when: "matrix_dynamic_dns_systemd_service_result.changed"
|
||||
|
@ -6,7 +6,7 @@
|
||||
register: matrix_dynamic_dns_service_stat
|
||||
|
||||
- name: Ensure matrix-dynamic-dns is stopped
|
||||
service:
|
||||
ansible.builtin.service:
|
||||
name: matrix-dynamic-dns
|
||||
state: stopped
|
||||
enabled: false
|
||||
@ -14,13 +14,13 @@
|
||||
when: "matrix_dynamic_dns_service_stat.stat.exists"
|
||||
|
||||
- name: Ensure matrix-dynamic-dns.service doesn't exist
|
||||
file:
|
||||
ansible.builtin.file:
|
||||
path: "{{ matrix_systemd_path }}/matrix-dynamic-dns.service"
|
||||
state: absent
|
||||
when: "matrix_dynamic_dns_service_stat.stat.exists"
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-dynamic-dns.service removal
|
||||
service:
|
||||
ansible.builtin.service:
|
||||
daemon_reload: true
|
||||
when: "matrix_dynamic_dns_service_stat.stat.exists"
|
||||
|
||||
|
@ -1,13 +1,13 @@
|
||||
---
|
||||
|
||||
- name: Fail if no configurations specified
|
||||
fail:
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
You need to define at least one configuration in `matrix_dynamic_dns_domain_configurations` for using matrix-dynamic-dns.
|
||||
when: "matrix_dynamic_dns_domain_configurations|length == 0"
|
||||
|
||||
- name: Fail if required settings not defined in configuration blocks
|
||||
fail:
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
One of the configurations in matrix_dynamic_dns_domain_configurations is missing a required key (domain, provider, protocol).
|
||||
when: "'domain' not in configuration or 'provider' not in configuration or 'protocol' not in configuration"
|
||||
|
Reference in New Issue
Block a user