ansible-role-cmdb/tasks/main.yml

39 lines
981 B
YAML
Raw Normal View History

2023-06-19 15:12:18 +02:00
---
- name: Initiate cmdb
ansible.builtin.import_tasks: install.yml
delegate_to: "{{ cmdb.wiki_server }}"
2023-11-01 16:52:49 +01:00
tags: never, install
2023-06-19 15:12:18 +02:00
- name: Gather facts
ansible.builtin.package_facts:
manager: auto
tags: facts
2023-11-01 15:21:27 +01:00
when: inventory_hostname not in groups.storage_boxes
2023-06-19 15:12:18 +02:00
- name: Create hypervisor items
ansible.builtin.import_tasks: hypervisor.yml
2023-11-01 15:21:27 +01:00
when:
- "inventory_hostname not in groups.storage_boxes"
2023-11-01 15:30:04 +01:00
- "'qemu-system-x86' in ansible_facts.packages"
2023-06-19 15:12:18 +02:00
tags:
- hypervisor
- server
2023-11-01 15:36:50 +01:00
- name: Gather storage box facts
ansible.builtin.import_tasks: storage_box.yml
tags: storage_box
when: inventory_hostname in groups.storage_boxes
2023-06-19 15:12:18 +02:00
- name: Create server items
ansible.builtin.import_tasks: server.yml
delegate_to: "{{ cmdb.wiki_server }}"
tags: server
2023-11-01 17:12:56 +01:00
- name: Purging Dokuwiki cache
ansible.builtin.file:
path: "{{ cmdb.wiki_conf_file_path }}"
state: touch
run_once: true
delegate_to: "{{ cmdb.wiki_server }}"
tags: purge_cache