-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvalidate.yml
64 lines (55 loc) · 2.43 KB
/
validate.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
- name: Perform pre-deployment validations
hosts: localhost
gather_facts: yes
any_errors_fatal: true
tasks:
- name: "Install/Upgrade are mutually exclusive"
fail:
msg: "Options '--deploy' and '--upgrade' and '--ocupdate' are mutually exclusive"
when:
- ( install.deploy|default('') and install.upgrade|default('')) or
( install.deploy|default('') and install.ocupdate|default(False)) or
( install.upgrade|default('') and install.ocupdate|default(False))
- name: validate storage nodes
fail:
msg: "To many storage nodes to discover storage backend. Provide --storage-backend cli option with the backend to use. "
when:
- install.deploy|default('')
- not (install.storage|default({})).backend|default(False)
- "'swift' in groups"
- "'ceph' in groups"
- name: set default storage config file location
set_fact:
install_storage_config_file: "vars/storage/config/{{ install.storage.config }}.yml"
- when:
- install.deploy|default('')
- install.storage.external
block:
- name: validate storage-config option is provided
fail:
msg: "The --storage-config cli option should be provided for external storage backend when --storage-external is used. "
when:
- install.storage.config == 'internal'
- name: download storage config file
get_url:
url: "{{ install.storage.config }}"
dest: ./storage-config.yml.tmp
force: yes
when: install.storage.config is match("http[s]?://.*")
- name: lookup for external storage config
set_fact:
install_storage_config_file: "{{ lookup('first_found', findme) }}"
vars:
findme:
- ./storage-config.yml.tmp
- "{{ install.storage.config }}"
- "vars/storage/config/{{ install.storage.config }}.yml"
- debug: msg="install_storage_config_file set to {{ install_storage_config_file }}"
- name: Perform pre-deployment validations on undercloud
hosts: undercloud
gather_facts: no
any_errors_fatal: true
tasks:
- name: validate and copy environment plan file
include_tasks: tasks/environment_plan.yml
when: (install.environment|default({})).plan|default(false)