diff --git a/roles/fusioninventory_agent/tasks/install_Debian.yml b/roles/fusioninventory_agent/tasks/install_Debian.yml index 7e6452c..c374844 100644 --- a/roles/fusioninventory_agent/tasks/install_Debian.yml +++ b/roles/fusioninventory_agent/tasks/install_Debian.yml @@ -29,10 +29,13 @@ environment: - http_proxy: "{{ system_proxy | default('') }}" + tags: inventory + - when: ansible_distribution_major_version is version('11', '>=') block: - name: Install FusionInventory Agent apt: name: - fusioninventory-agent + tags: inventory diff --git a/roles/fusioninventory_agent/tasks/install_RedHat.yml b/roles/fusioninventory_agent/tasks/install_RedHat.yml index 0425c54..1b37977 100644 --- a/roles/fusioninventory_agent/tasks/install_RedHat.yml +++ b/roles/fusioninventory_agent/tasks/install_RedHat.yml @@ -2,4 +2,5 @@ - name: Install FusionInventory Agent yum: name=fusioninventory-agent + tags: inventory diff --git a/roles/fusioninventory_agent/tasks/main.yml b/roles/fusioninventory_agent/tasks/main.yml index e839dbc..89014f3 100644 --- a/roles/fusioninventory_agent/tasks/main.yml +++ b/roles/fusioninventory_agent/tasks/main.yml @@ -1,20 +1,24 @@ --- -- include_tasks: install_{{ ansible_os_family }}.yml +- include: install_{{ ansible_os_family }}.yml - name: Deploy FusionInventory Agent config template: src=agent.cfg.j2 dest=/etc/fusioninventory/agent.cfg mode=640 notify: restart fusioninventory-agent + tags: inventory - name: Check if the first inventory has been done stat: path=/var/lib/fusioninventory-agent/FusionInventory-Agent.dump register: first_inventory + tags: inventory - name: First Fusion Inventory report command: /usr/bin/fusioninventory-agent when: not first_inventory.stat.exists + tags: inventory - name: Start FusionInventory Agent service: name=fusioninventory-agent state=started enabled=yes + tags: inventory ...