ansible-role-cmdb/tasks/main.yml

32 lines
859 B
YAML

---
- name: Initiate cmdb
ansible.builtin.import_tasks: install.yml
delegate_to: "{{ cmdb.wiki_server }}"
tags: install
- name: Gather facts
ansible.builtin.package_facts:
manager: auto
tags: facts
when: inventory_hostname not in groups.storage_boxes
- name: Set facts for storage storage boxes
ansible.builtin.set_fact:
ansible_date_time:
date: "{{ '%Y-%m-%d' | strftime }}"
time: "{{ '%H:%M:%S' | strftime }}"
when: inventory_hostname in groups.storage_boxes
- name: Create hypervisor items
ansible.builtin.import_tasks: hypervisor.yml
when:
- "inventory_hostname not in groups.storage_boxes"
- "'qemu-system-x86' in ansible_facts.packages"
tags:
- hypervisor
- server
- name: Create server items
ansible.builtin.import_tasks: server.yml
delegate_to: "{{ cmdb.wiki_server }}"
tags: server