Przeglądaj źródła

Using ansible.builtin where possible

pull/2002/head
Charles Wright 3 lat temu
rodzic
commit
0ee44adde8
5 zmienionych plików z 11 dodań i 11 usunięć
  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 Wyświetl plik

@@ -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


+ 3
- 3
roles/matrix-conduit/tasks/conduit/setup_install.yml Wyświetl plik

@@ -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"

+ 4
- 4
roles/matrix-conduit/tasks/conduit/setup_uninstall.yml Wyświetl plik

@@ -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
- 1
roles/matrix-conduit/tasks/init.yml Wyświetl plik

@@ -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

+ 1
- 1
roles/matrix-conduit/tasks/main.yml Wyświetl plik

@@ -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

Ładowanie…
Anuluj
Zapisz