diff options
author | Romain Gonçalves <me@rgoncalves.se> | 2023-01-13 00:15:52 +0100 |
---|---|---|
committer | Romain Gonçalves <me@rgoncalves.se> | 2023-04-02 11:45:09 +0200 |
commit | 28332d389dd3644aeb3973d4ca472820f6b45b07 (patch) | |
tree | c458ec9899a90942e726ed92f2c1a49e99d1f805 /roles/relayd/tasks | |
parent | 1ff0fc1803fc71d925a0f2d0cf9c27058914044a (diff) | |
download | rules-28332d389dd3644aeb3973d4ca472820f6b45b07.tar.gz |
feat(roles/relayd): add argument specs
Diffstat (limited to 'roles/relayd/tasks')
-rw-r--r-- | roles/relayd/tasks/main.yml | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/roles/relayd/tasks/main.yml b/roles/relayd/tasks/main.yml index e8e18a3..8dc2837 100644 --- a/roles/relayd/tasks/main.yml +++ b/roles/relayd/tasks/main.yml @@ -7,11 +7,23 @@ owner: 0 group: 0 mode: "0640" - notify: - - lint relayd configuration + register: relayd_result_generate_configuration -- name: enable and restart relayd +- name: lint relayd configuration + ansible.builtin.command: "relayd -nf {{ relayd_configuration_file }}" + register: relayd_result_lint_configuration + changed_when: + - relayd_result_generate_configuration.changed + - relayd_result_lint_configuration.rc != 0 + +- name: restart relayd # noqa: no-handler ansible.builtin.service: name: relayd state: restarted + when: relayd_result_generate_configuration.changed + or relayd_result_lint_configuration.changed + +- name: enable relayd + ansible.builtin.service: + name: relayd enabled: true |