2
0
Fork 0
This repository has been archived on 2023-10-25. You can view files and clone it, but cannot push or open issues or pull requests.
ansible.fusioninventory/tasks/main.yml

51 lines
1.5 KiB
YAML
Raw Normal View History

---
# .. vim: foldmarker=[[[,]]]:foldmethod=marker
#
# tasks file for fusioninventory
- name: Include package list per OS
include_vars: "{{ item }}"
with_first_found:
- "{{ ansible_distribution }}.yml"
- "{{ ansible_os_family }}.yml"
# Manage dependent packages [[[1
- name: Ensure dependent packages are installed
package:
name: '{{ item }}'
state: 'present'
with_flattened:
2018-09-17 11:27:26 +02:00
- '{{ fusioninventory__agent_depend_packages | to_nice_json }}'
register: pkg_dep_result
until: pkg_dep_result is success
when: fusioninventory__agent_deploy_state == "present"
# Manage agent package [[[1
# Specific tasks per OS will be in the include otherwise below
- include: "{{ item }}"
with_first_found:
- "{{ ansible_distribution }}.yml"
- "{{ ansible_os_family }}.yml"
2018-09-10 14:55:42 +02:00
- name: Ensure fusioninventory-agent package from REPOS
package:
name: '{{ fusioninventory__agent_packages }}'
state: '{{ "present" if (fusioninventory__agent_deploy_state == "present")
else "absent" }}'
register: pkg_agent_repo_result
until: pkg_agent_repo_result is success
2019-02-27 14:11:20 +01:00
when: ((not fusioninventory__agent_package_url) or
(fusioninventory__agent_deploy_state == "absent"))
2018-09-10 14:02:41 +02:00
# Manage agent configuration file [[[1
- name: Create Fusioninventory-agent configuration
template:
src: '{{ fusioninventory__agent_conf_src }}'
dest: "/etc/fusioninventory/agent.cfg"
owner: root
group: root
mode: '0644'
when: fusioninventory__agent_deploy_state == "present"
2018-09-10 14:55:42 +02:00
notify: ['restart fusioninventory-agent service']