Using ansible.builtin where possible
This commit is contained in:
parent
47caba38fb
commit
0ee44adde8
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
|
|
||||||
- name: Ensure Conduit config path exists
|
- name: Ensure Conduit config path exists
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "{{ matrix_conduit_config_path }}"
|
path: "{{ matrix_conduit_config_path }}"
|
||||||
state: directory
|
state: directory
|
||||||
mode: 0750
|
mode: 0750
|
||||||
|
@ -10,7 +10,7 @@
|
||||||
when: "matrix_conduit_enabled|bool"
|
when: "matrix_conduit_enabled|bool"
|
||||||
|
|
||||||
- name: Ensure Conduit data path exists
|
- name: Ensure Conduit data path exists
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "{{ matrix_conduit_data_path }}"
|
path: "{{ matrix_conduit_data_path }}"
|
||||||
state: directory
|
state: directory
|
||||||
mode: 0770
|
mode: 0770
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
until: result is not failed
|
until: result is not failed
|
||||||
|
|
||||||
- name: Ensure Conduit configuration installed
|
- name: Ensure Conduit configuration installed
|
||||||
template:
|
ansible.builtin.template:
|
||||||
src: "{{ role_path }}/templates/conduit/conduit.toml.j2"
|
src: "{{ role_path }}/templates/conduit/conduit.toml.j2"
|
||||||
dest: "{{ matrix_conduit_config_path }}/conduit.toml"
|
dest: "{{ matrix_conduit_config_path }}/conduit.toml"
|
||||||
mode: 0644
|
mode: 0644
|
||||||
|
@ -19,13 +19,13 @@
|
||||||
group: "{{ matrix_user_groupname }}"
|
group: "{{ matrix_user_groupname }}"
|
||||||
|
|
||||||
- name: Ensure matrix-conduit.service installed
|
- name: Ensure matrix-conduit.service installed
|
||||||
template:
|
ansible.builtin.template:
|
||||||
src: "{{ role_path }}/templates/conduit/systemd/matrix-conduit.service.j2"
|
src: "{{ role_path }}/templates/conduit/systemd/matrix-conduit.service.j2"
|
||||||
dest: "{{ matrix_systemd_path }}/matrix-conduit.service"
|
dest: "{{ matrix_systemd_path }}/matrix-conduit.service"
|
||||||
mode: 0644
|
mode: 0644
|
||||||
register: matrix_conduit_systemd_service_result
|
register: matrix_conduit_systemd_service_result
|
||||||
|
|
||||||
- name: Ensure systemd reloaded after matrix-conduit.service installation
|
- name: Ensure systemd reloaded after matrix-conduit.service installation
|
||||||
service:
|
ansible.builtin.systemd:
|
||||||
daemon_reload: true
|
daemon_reload: true
|
||||||
when: "matrix_conduit_systemd_service_result.changed|bool"
|
when: "matrix_conduit_systemd_service_result.changed|bool"
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
---
|
---
|
||||||
|
|
||||||
- name: Check existence of matrix-conduit service
|
- name: Check existence of matrix-conduit service
|
||||||
stat:
|
ansible.builtin.stat:
|
||||||
path: "{{ matrix_systemd_path }}/matrix-conduit.service"
|
path: "{{ matrix_systemd_path }}/matrix-conduit.service"
|
||||||
register: matrix_conduit_service_stat
|
register: matrix_conduit_service_stat
|
||||||
|
|
||||||
- name: Ensure matrix-conduit is stopped
|
- name: Ensure matrix-conduit is stopped
|
||||||
service:
|
ansible.builtin.systemd:
|
||||||
name: matrix-conduit
|
name: matrix-conduit
|
||||||
state: stopped
|
state: stopped
|
||||||
daemon_reload: true
|
daemon_reload: true
|
||||||
|
@ -14,13 +14,13 @@
|
||||||
when: "matrix_conduit_service_stat.stat.exists"
|
when: "matrix_conduit_service_stat.stat.exists"
|
||||||
|
|
||||||
- name: Ensure matrix-conduit.service doesn't exist
|
- name: Ensure matrix-conduit.service doesn't exist
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "{{ matrix_systemd_path }}/matrix-conduit.service"
|
path: "{{ matrix_systemd_path }}/matrix-conduit.service"
|
||||||
state: absent
|
state: absent
|
||||||
when: "matrix_conduit_service_stat.stat.exists"
|
when: "matrix_conduit_service_stat.stat.exists"
|
||||||
|
|
||||||
- name: Ensure systemd reloaded after matrix-conduit.service removal
|
- name: Ensure systemd reloaded after matrix-conduit.service removal
|
||||||
service:
|
ansible.builtin.systemd:
|
||||||
daemon_reload: true
|
daemon_reload: true
|
||||||
when: "matrix_conduit_service_stat.stat.exists"
|
when: "matrix_conduit_service_stat.stat.exists"
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
|
|
||||||
- set_fact:
|
- ansible.builtin.set_fact:
|
||||||
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-conduit.service'] }}"
|
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-conduit.service'] }}"
|
||||||
when: matrix_conduit_enabled|bool
|
when: matrix_conduit_enabled|bool
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
- setup-conduit
|
- setup-conduit
|
||||||
|
|
||||||
- name: Mark matrix-conduit role as executed
|
- name: Mark matrix-conduit role as executed
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
matrix_conduit_role_executed: true
|
matrix_conduit_role_executed: true
|
||||||
tags:
|
tags:
|
||||||
- always
|
- always
|
||||||
|
|
Loading…
Reference in a new issue