Просмотр исходного кода

Using ansible.builtin where possible

pull/2002/head
Charles Wright 3 лет назад
Родитель
Сommit
0ee44adde8
5 измененных файлов: 11 добавлений и 11 удалений
  1. +2
    -2
      roles/matrix-conduit/tasks/conduit/setup.yml
  2. +3
    -3
      roles/matrix-conduit/tasks/conduit/setup_install.yml
  3. +4
    -4
      roles/matrix-conduit/tasks/conduit/setup_uninstall.yml
  4. +1
    -1
      roles/matrix-conduit/tasks/init.yml
  5. +1
    -1
      roles/matrix-conduit/tasks/main.yml

+ 2
- 2
roles/matrix-conduit/tasks/conduit/setup.yml Просмотреть файл

@@ -1,7 +1,7 @@
---

- name: Ensure Conduit config path exists
file:
ansible.builtin.file:
path: "{{ matrix_conduit_config_path }}"
state: directory
mode: 0750
@@ -10,7 +10,7 @@
when: "matrix_conduit_enabled|bool"

- name: Ensure Conduit data path exists
file:
ansible.builtin.file:
path: "{{ matrix_conduit_data_path }}"
state: directory
mode: 0770


+ 3
- 3
roles/matrix-conduit/tasks/conduit/setup_install.yml Просмотреть файл

@@ -11,7 +11,7 @@
until: result is not failed

- name: Ensure Conduit configuration installed
template:
ansible.builtin.template:
src: "{{ role_path }}/templates/conduit/conduit.toml.j2"
dest: "{{ matrix_conduit_config_path }}/conduit.toml"
mode: 0644
@@ -19,13 +19,13 @@
group: "{{ matrix_user_groupname }}"

- name: Ensure matrix-conduit.service installed
template:
ansible.builtin.template:
src: "{{ role_path }}/templates/conduit/systemd/matrix-conduit.service.j2"
dest: "{{ matrix_systemd_path }}/matrix-conduit.service"
mode: 0644
register: matrix_conduit_systemd_service_result

- name: Ensure systemd reloaded after matrix-conduit.service installation
service:
ansible.builtin.systemd:
daemon_reload: true
when: "matrix_conduit_systemd_service_result.changed|bool"

+ 4
- 4
roles/matrix-conduit/tasks/conduit/setup_uninstall.yml Просмотреть файл

@@ -1,12 +1,12 @@
---

- name: Check existence of matrix-conduit service
stat:
ansible.builtin.stat:
path: "{{ matrix_systemd_path }}/matrix-conduit.service"
register: matrix_conduit_service_stat

- name: Ensure matrix-conduit is stopped
service:
ansible.builtin.systemd:
name: matrix-conduit
state: stopped
daemon_reload: true
@@ -14,13 +14,13 @@
when: "matrix_conduit_service_stat.stat.exists"

- name: Ensure matrix-conduit.service doesn't exist
file:
ansible.builtin.file:
path: "{{ matrix_systemd_path }}/matrix-conduit.service"
state: absent
when: "matrix_conduit_service_stat.stat.exists"

- name: Ensure systemd reloaded after matrix-conduit.service removal
service:
ansible.builtin.systemd:
daemon_reload: true
when: "matrix_conduit_service_stat.stat.exists"



+ 1
- 1
roles/matrix-conduit/tasks/init.yml Просмотреть файл

@@ -1,5 +1,5 @@
---

- set_fact:
- ansible.builtin.set_fact:
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-conduit.service'] }}"
when: matrix_conduit_enabled|bool

+ 1
- 1
roles/matrix-conduit/tasks/main.yml Просмотреть файл

@@ -11,7 +11,7 @@
- setup-conduit

- name: Mark matrix-conduit role as executed
set_fact:
ansible.builtin.set_fact:
matrix_conduit_role_executed: true
tags:
- always

Загрузка…
Отмена
Сохранить