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