From ffa2ecbd80a6003958541777d9f84ef14e068bdd Mon Sep 17 00:00:00 2001 From: Aidan Fitzgerald Date: Fri, 8 Mar 2019 00:04:53 -0500 Subject: [PATCH] Don't care about previous state per Ansible convention --- roles/gitea/tasks/install.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/roles/gitea/tasks/install.yml b/roles/gitea/tasks/install.yml index 4f4a3c1ad..71514da6c 100644 --- a/roles/gitea/tasks/install.yml +++ b/roles/gitea/tasks/install.yml @@ -147,20 +147,22 @@ src: gitea.conf.j2 dest: "/etc/{{ apache_config_dir }}/gitea.conf" -- name: Enable httpd conf file if we are disabled (debuntu) +- name: Enable httpd conf file (debuntu) file: src: /etc/{{ apache_config_dir }}/gitea.conf dest: /etc/apache2/sites-enabled/gitea.conf state: link when: gitea_enabled and is_debuntu -- name: Remove httpd conf file if we are disabled (OS's other than debuntu) +- name: Remove httpd conf file (OS's other than debuntu) file: path: /etc/apache2/sites-enabled/gitea.conf state: absent when: not gitea_enabled and is_debuntu -- name: Restart Apache ({{ apache_service }}) to enable/disable http://box/gitea +- name: >- + Restart Apache ({{ apache_service }}) to {% if gitea_enabled %}enable{% + else %}disable{% endif %} http://box/gitea service: name: "{{ apache_service }}" state: restarted