Fix for non-existing Ansible group
This commit is contained in:
parent
2aa8fc8981
commit
1e6f6056b7
2 changed files with 7 additions and 6 deletions
|
@ -8,12 +8,12 @@
|
||||||
ansible.builtin.package_facts:
|
ansible.builtin.package_facts:
|
||||||
manager: auto
|
manager: auto
|
||||||
tags: facts
|
tags: facts
|
||||||
when: inventory_hostname not in groups.storage_boxes
|
when: inventory_hostname not in groups.storage_boxes | default([])
|
||||||
|
|
||||||
- name: Create hypervisor items
|
- name: Create hypervisor items
|
||||||
ansible.builtin.import_tasks: hypervisor.yml
|
ansible.builtin.import_tasks: hypervisor.yml
|
||||||
when:
|
when:
|
||||||
- "inventory_hostname not in groups.storage_boxes"
|
- "inventory_hostname not in groups.storage_boxes | default([])"
|
||||||
- "'qemu-system-x86' in ansible_facts.packages"
|
- "'qemu-system-x86' in ansible_facts.packages"
|
||||||
tags:
|
tags:
|
||||||
- hypervisor
|
- hypervisor
|
||||||
|
@ -22,7 +22,7 @@
|
||||||
- name: Gather storage box facts
|
- name: Gather storage box facts
|
||||||
ansible.builtin.import_tasks: storage_box.yml
|
ansible.builtin.import_tasks: storage_box.yml
|
||||||
tags: storage_box
|
tags: storage_box
|
||||||
when: inventory_hostname in groups.storage_boxes
|
when: inventory_hostname in groups.storage_boxes | default([])
|
||||||
|
|
||||||
- name: Create server items
|
- name: Create server items
|
||||||
ansible.builtin.import_tasks: server.yml
|
ansible.builtin.import_tasks: server.yml
|
||||||
|
@ -33,6 +33,7 @@
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{ cmdb.wiki_conf_file_path }}"
|
path: "{{ cmdb.wiki_conf_file_path }}"
|
||||||
state: touch
|
state: touch
|
||||||
|
mode: "0644"
|
||||||
run_once: true
|
run_once: true
|
||||||
delegate_to: "{{ cmdb.wiki_server }}"
|
delegate_to: "{{ cmdb.wiki_server }}"
|
||||||
tags: purge_cache
|
tags: purge_cache
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{% set host_short = inventory_hostname.split('.')[0] %}
|
{% set host_short = inventory_hostname.split('.')[0] %}
|
||||||
{% if inventory_hostname not in groups.storage_boxes %}
|
{% if inventory_hostname not in groups.storage_boxes | default([] )%}
|
||||||
|
|
||||||
{%- if ansible_virtualization_role is defined %}{{'{{:cmdb:kvm.png?0x50|}}'}}{% endif %}
|
{%- if ansible_virtualization_role is defined %}{{'{{:cmdb:kvm.png?0x50|}}'}}{% endif %}
|
||||||
{%- if 'nginx' in ansible_facts.packages %}{{'{{:cmdb:nginx.png?0x50|}}'}}{% endif %}
|
{%- if 'nginx' in ansible_facts.packages %}{{'{{:cmdb:nginx.png?0x50|}}'}}{% endif %}
|
||||||
|
@ -21,7 +21,7 @@
|
||||||
{% include 'section_customer.txt.j2' %}
|
{% include 'section_customer.txt.j2' %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if inventory_hostname not in groups.storage_boxes %}
|
{% if inventory_hostname not in groups.storage_boxes | default([]) %}
|
||||||
{% include 'section_general.txt.j2' %}
|
{% include 'section_general.txt.j2' %}
|
||||||
|
|
||||||
{% include 'section_os-software.txt.j2' %}
|
{% include 'section_os-software.txt.j2' %}
|
||||||
|
@ -62,6 +62,6 @@
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% elif inventory_hostname in groups.storage_boxes %}
|
{% elif inventory_hostname in groups.storage_boxes | default([]) %}
|
||||||
{% include 'section_storage_boxes.txt.j2' %}
|
{% include 'section_storage_boxes.txt.j2' %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
Loading…
Reference in a new issue