From 8fe580046bef5a2305fa099dc310123361166f9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gardais=20J=C3=A9r=C3=A9my?= Date: Thu, 13 Sep 2018 10:21:44 +0200 Subject: [PATCH] If desired, remove fusioninventory-agent package --- CHANGELOG.md | 3 ++- tasks/main.yml | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dd0eb66..254c6f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ### Features * Install dependent packages for fusioninventory-agent. * Don't remove dependent packages. -* Install fusioninventory-agent package from URL. +* Install fusioninventory-agent package from URL or repos. +* If desired, remove fusioninventory-agent package. * Generate agent's configuration file. * Restart agent's service if needed. diff --git a/tasks/main.yml b/tasks/main.yml index 0b39623..6c0a5f7 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -16,14 +16,16 @@ - name: Ensure fusioninventory-agent package from URL apt: deb: '{{ fusioninventory__agent_package_url | d(omit) }}' - state: '{{ "present" if (fusioninventory__agent_deploy_state == "present") else "absent" }}' when: fusioninventory__agent_package_url != "" + and fusioninventory__agent_deploy_state == "present" - name: Ensure fusioninventory-agent package from REPOS package: name: 'fusioninventory-agent' - state: '{{ "present" if (fusioninventory__agent_deploy_state == "present") else "absent" }}' + state: '{{ "present" if (fusioninventory__agent_deploy_state == "present") + else "absent" }}' when: fusioninventory__agent_package_url == "" + or fusioninventory__agent_deploy_state == "absent" # Manage agent configuration file [[[1 - name: Create Fusioninventory-agent configuration