-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathundercloud.yml
110 lines (99 loc) · 4.27 KB
/
undercloud.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
- hosts: undercloud
tasks:
- name: configure undercloud for tls-everywhere
include_tasks: tasks/undercloud_tls_e_config.yml
when: tls_everywhere == true
- hosts: localhost
vars:
container_params: ""
tasks:
- name: set undercloud local interface
block:
- name: get undercloud_local_interface
shell: |
for i in /sys/class/net/*
do
udevcontent=`udevadm info -p $i --query property`
if [[ $udevcontent =~ {{ uc_ctlplane_interface }} ]]
then
undercloud_local_interface=`echo $i | cut -d '/' -f 5`
break
fi
done
echo $undercloud_local_interface
register: local_interface
delegate_to: "{{ undercloud_hostname }}"
vars:
uc_ctlplane_interface: "{{ (composable_roles == false) | ternary(ctlplane_interface, ctlplane_interfaces[0]) }}"
ansible_python_interpreter: "{{ python_interpreter }}"
ansible_user: "stack"
become: true
when: lab_name in ['scale', 'alias']
- name: set undercloud_local_interface
set_fact:
undercloud_local_interface: "{{ local_interface.stdout }}"
when: virtual_uc != true
- name: set undercloud_nameservers
block:
- name: Get IP address of IdM host
shell: |
ping {{ idm_host_fqdn }} -c 1 | head -1 | cut -d " " -f 3 | tr -d "(" | tr -d ")"
register: idm_host_ip_address
- name: set undercloud_nameservers
set_fact:
undercloud_nameservers: "{{ idm_host_ip_address.stdout }}"
when: tls_everywhere == true
- name: set undercloud_local_interface
set_fact:
undercloud_local_interface: "{{ undercloud_local_interface }}"
when: (virtual_uc == true) or (lab_name not in ['scale', 'alias'])
- name: Setup undercloud.conf
template:
src: undercloud.conf.j2
dest: "{{ undercloud_conf }}"
- name: Set container params
set_fact:
container_params: "--registry-mirror {{ registry_mirror }} --registry-namespace {{ registry_namespace }}"
when: osp_release|int > 13
- name: append time prefix to undercloud deploy script
lineinfile:
dest: ~/.infrared/plugins/tripleo-undercloud/templates/undercloud_deploy.sh.j2
regexp: 'openstack undercloud'
line: '(time openstack undercloud install) &> undercloud_install.log'
- name: run tripleo-undercloud
shell: |
source {{ infrared_dir }}/.venv/bin/activate
infrared tripleo-undercloud -vv \
--version {{ osp_release }} \
--build {{ osp_puddle }} \
--images-task rpm \
--config-file {{ undercloud_conf }} {{ container_params }} > {{ log_directory }}/undercloud_install.log 2>&1
args:
chdir: "{{ infrared_dir }}"
changed_when: false
when: osp_release|int < 17
- name: run tripleo-undercloud for osp17
shell: |
source {{ infrared_dir }}/.venv/bin/activate
infrared tripleo-undercloud -vv \
--version {{ osp_release }} \
--build {{ osp_puddle }} \
--images-task rpm \
--overcloud-image-name full \
--hieradata-config "ironic::conductor::default_boot_mode=bios,ironic::drivers::ilo::default_boot_mode=bios" \
--config-file {{ undercloud_conf }} {{ container_params }} > {{ log_directory }}/undercloud_install.log 2>&1
args:
chdir: "{{ infrared_dir }}"
changed_when: false
when: osp_release|int >= 17
- name: Run the undercloud-ipa-install.yml playbook
shell: |
source /home/stack/.bash_profile
ansible-playbook --ssh-extra-args "-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" /usr/share/ansible/tripleo-playbooks/undercloud-ipa-install.yaml
when: tls_everywhere == true
delegate_to: undercloud
- name: Update the undercloud for TLS-Everywhere
shell:
(time openstack undercloud install) &> undercloud_install_tls_e.log
when: tls_everywhere == true
delegate_to: undercloud