ansible-role-cmdb/tasks/main.yml

39 lines
1 KiB
YAML

---
- name: Initiate cmdb
ansible.builtin.import_tasks: install.yml
delegate_to: "{{ cmdb.wiki_server }}"
tags: never, install
- name: Gather facts
ansible.builtin.package_facts:
manager: auto
tags: facts
when: inventory_hostname not in groups.storage_boxes | default([])
- name: Create hypervisor items
ansible.builtin.import_tasks: hypervisor.yml
when:
- "inventory_hostname not in groups.storage_boxes | default([])"
- "'qemu-system-x86' in ansible_facts.packages"
tags:
- hypervisor
- server
- name: Gather storage box facts
ansible.builtin.import_tasks: storage_box.yml
tags: storage_box
when: inventory_hostname in groups.storage_boxes | default([])
- name: Create server items
ansible.builtin.import_tasks: server.yml
delegate_to: "{{ cmdb.wiki_server }}"
tags: server
- name: Purging Dokuwiki cache
ansible.builtin.file:
path: "{{ cmdb.wiki_conf_file_path }}"
state: touch
mode: "0644"
run_once: true
delegate_to: "{{ cmdb.wiki_server }}"
tags: purge_cache