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 Cinny 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_client_cinny_container_image_self_build and matrix_client_cinny_enabled"
|
||||
|
||||
- set_fact:
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-client-cinny.service'] }}"
|
||||
when: matrix_client_cinny_enabled|bool
|
||||
|
@ -1,10 +1,10 @@
|
||||
---
|
||||
|
||||
- set_fact:
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_client_cinny_url_endpoint_public: "https://{{ matrix_server_fqn_cinny }}/config.json"
|
||||
|
||||
- name: Check Cinny
|
||||
uri:
|
||||
ansible.builtin.uri:
|
||||
url: "{{ matrix_client_cinny_url_endpoint_public }}"
|
||||
follow_redirects: none
|
||||
validate_certs: "{{ matrix_client_cinny_self_check_validate_certificates }}"
|
||||
@ -13,10 +13,10 @@
|
||||
ignore_errors: true
|
||||
|
||||
- name: Fail if Cinny not working
|
||||
fail:
|
||||
ansible.builtin.fail:
|
||||
msg: "Failed checking Cinny is up at `{{ matrix_server_fqn_cinny }}` (checked endpoint: `{{ matrix_client_cinny_url_endpoint_public }}`). Is Cinny running? Is port 443 open in your firewall? Full error: {{ matrix_client_cinny_self_check_result }}"
|
||||
when: "matrix_client_cinny_self_check_result.failed or 'json' not in matrix_client_cinny_self_check_result"
|
||||
|
||||
- name: Report working Cinny
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
msg: "Cinny at `{{ matrix_server_fqn_cinny }}` is working (checked endpoint: `{{ matrix_client_cinny_url_endpoint_public }}`)"
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
- name: Ensure Cinny paths exists
|
||||
file:
|
||||
ansible.builtin.file:
|
||||
path: "{{ item.path }}"
|
||||
state: directory
|
||||
mode: 0750
|
||||
@ -24,7 +24,7 @@
|
||||
until: result is not failed
|
||||
|
||||
- name: Ensure Cinny repository is present on self-build
|
||||
git:
|
||||
ansible.builtin.git:
|
||||
repo: "{{ matrix_client_cinny_container_image_self_build_repo }}"
|
||||
dest: "{{ matrix_client_cinny_docker_src_files_path }}"
|
||||
version: "{{ matrix_client_cinny_docker_image.split(':')[1] }}"
|
||||
@ -35,7 +35,7 @@
|
||||
when: "matrix_client_cinny_container_image_self_build|bool"
|
||||
|
||||
- name: Ensure Cinny configuration installed
|
||||
copy:
|
||||
ansible.builtin.copy:
|
||||
content: "{{ matrix_client_cinny_configuration|to_nice_json }}"
|
||||
dest: "{{ matrix_client_cinny_data_path }}/config.json"
|
||||
mode: 0644
|
||||
@ -43,7 +43,7 @@
|
||||
group: "{{ matrix_user_groupname }}"
|
||||
|
||||
- name: Ensure Cinny additional config files installed
|
||||
template:
|
||||
ansible.builtin.template:
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ matrix_client_cinny_data_path }}/{{ item.name }}"
|
||||
mode: 0644
|
||||
@ -65,13 +65,13 @@
|
||||
when: "matrix_client_cinny_container_image_self_build|bool"
|
||||
|
||||
- name: Ensure matrix-client-cinny.service installed
|
||||
template:
|
||||
ansible.builtin.template:
|
||||
src: "{{ role_path }}/templates/systemd/matrix-client-cinny.service.j2"
|
||||
dest: "{{ matrix_systemd_path }}/matrix-client-cinny.service"
|
||||
mode: 0644
|
||||
register: matrix_client_cinny_systemd_service_result
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-client-cinny.service installation
|
||||
service:
|
||||
ansible.builtin.service:
|
||||
daemon_reload: true
|
||||
when: "matrix_client_cinny_systemd_service_result.changed|bool"
|
||||
|
@ -5,7 +5,7 @@
|
||||
register: matrix_client_cinny_service_stat
|
||||
|
||||
- name: Ensure matrix-client-cinny is stopped
|
||||
service:
|
||||
ansible.builtin.service:
|
||||
name: matrix-client-cinny
|
||||
state: stopped
|
||||
enabled: false
|
||||
@ -14,18 +14,18 @@
|
||||
when: "matrix_client_cinny_service_stat.stat.exists|bool"
|
||||
|
||||
- name: Ensure matrix-client-cinny.service doesn't exist
|
||||
file:
|
||||
ansible.builtin.file:
|
||||
path: "{{ matrix_systemd_path }}/matrix-client-cinny.service"
|
||||
state: absent
|
||||
when: "matrix_client_cinny_service_stat.stat.exists|bool"
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-client-cinny.service removal
|
||||
service:
|
||||
ansible.builtin.service:
|
||||
daemon_reload: true
|
||||
when: "matrix_client_cinny_service_stat.stat.exists|bool"
|
||||
|
||||
- name: Ensure Cinny paths doesn't exist
|
||||
file:
|
||||
ansible.builtin.file:
|
||||
path: "{{ matrix_client_cinny_data_path }}"
|
||||
state: absent
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
- name: Fail if required Cinny settings not defined
|
||||
fail:
|
||||
ansible.builtin.fail:
|
||||
msg: >
|
||||
You need to define a required configuration setting (`{{ item }}`) to use Cinny.
|
||||
when: "vars[item] == '' or vars[item] is none"
|
||||
|
Reference in New Issue
Block a user