From db905031d570d82f0805114f338088872f7b0b90 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Wed, 23 Jun 2021 16:00:11 +0200 Subject: [PATCH] Remove a conditional --- tasks/gitea.yml | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/tasks/gitea.yml b/tasks/gitea.yml index 17e4df8..9614b44 100644 --- a/tasks/gitea.yml +++ b/tasks/gitea.yml @@ -41,9 +41,9 @@ - name: Install the required packages package: state=present use=auto name={{ gitea_required_packages }} - - name: Check if the gitea configuration file exists - stat: path={{ gitea_conf_dir }}/app.ini - register: gitea_app_ini + - name: Install the gitea configuration file. At install time only + template: src=app.ini.j2 dest={{ gitea_conf_dir }}/app.ini owner={{ gitea_user }} group={{ gitea_group }} mode=0640 force=no + notify: restart gitea - name: Change the gitea configuration. After the installation ini_file: @@ -56,10 +56,8 @@ group: '{{ gitea_group }}' mode: '0640' create: no - with_items: '{{ gitea_app_configurations }}' - when: - - gitea_app_ini.stat.exists - - gitea_app_configurations is defined + loop: '{{ gitea_app_configurations }}' + when: gitea_app_configurations is defined notify: restart gitea - name: Create the tmpfile entry for the gitea socket directory @@ -70,10 +68,6 @@ group: root mode: 0644 - - name: Install the gitea configuration file. At install time only - template: src=app.ini.j2 dest={{ gitea_conf_dir }}/app.ini owner={{ gitea_user }} group={{ gitea_group }} mode=0640 force=no - notify: restart gitea - - name: Install the gitea systemd unit template: src=gitea.service.systemd dest=/etc/systemd/system/gitea.service register: gitea_systemd_unit