From 1ea6202f92e2ea948377409f81a4c1725120de78 Mon Sep 17 00:00:00 2001 From: Michael Hofer Date: Sat, 11 Nov 2023 22:01:29 +0100 Subject: [PATCH] feat: run ocis init if needed and enable service --- tasks/main.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/tasks/main.yml b/tasks/main.yml index e84f4fc..0d5e7e1 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -50,7 +50,7 @@ group: root mode: '0755' -- name: Configure ocis environment file +- name: Configure ocis environment config ansible.builtin.template: src: etc/ocis/ocis.env.j2 dest: /etc/ocis/ocis.env @@ -67,3 +67,19 @@ group: root mode: '0644' notify: Reload systemd daemon + +- name: Initialize ocis yaml config + ansible.builtin.command: + cmd: 'ocis init --insecure {{ ocis_env_insecure }} --config-path {{ ocis_config_path }}' + creates: '{{ ocis_config_path }}/ocis.yaml' + become: true + become_user: '{{ ocis_user }}' + +# Service related tasks do not work well in molecule idempotence tests +- name: Enable ocis + ansible.builtin.service: + name: ocis + enabled: true + state: started + tags: + - molecule-idempotence-notest