65fa37fb84
When bootstrap compute hosts for XenAPI, it will generate a facts file for each compute node. It contains some XenAPI specific variables for both the compute host and the XenServer where the compute host run on. This commit is to fetch the facts file into deployment host and put it under a centralized directory - each compute host will have a separate sub-dir which is named with its *inventory_hostname*. In this way, the following tasks can use proper variable from the proper facts file which exactly belongs to the host they running on. Change-Id: I68d1a2d098d38c8e6bf4db76cdaf1f0465831822 blueprint: xenserver-support
26 lines
722 B
YAML
26 lines
722 B
YAML
- name: Install package python-os-xenapi
|
|
package:
|
|
name: python-os-xenapi
|
|
state: present
|
|
become: True
|
|
|
|
- name: Ensure XenAPI root path
|
|
file:
|
|
path: "{{ xenapi_facts_root }}"
|
|
state: directory
|
|
mode: "0770"
|
|
become: True
|
|
|
|
- name: Bootstrap XenAPI compute node
|
|
vars:
|
|
xenapi_facts_path: "{{ xenapi_facts_root + '/' + xenapi_facts_file }}"
|
|
command: xenapi_bootstrap -i {{ xenserver_himn_ip }} -u {{ xenserver_username }} -p {{ xenserver_password }} -f {{ xenapi_facts_path }}
|
|
become: True
|
|
|
|
- name: Fetching XenAPI facts file
|
|
fetch:
|
|
src: "{{ xenapi_facts_root + '/' + xenapi_facts_file }}"
|
|
dest: "{{ xenapi_facts_root + '/' + inventory_hostname + '/' }}"
|
|
flat: yes
|
|
become: True
|