-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.yml
109 lines (95 loc) · 3.74 KB
/
deploy.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
- name: Installing the undercloud
tags: deploy
hosts: undercloud
any_errors_fatal: true
tasks:
- name: apply pre deploy workarounds
command: bash ~/pre_undercloud_deploy_workarounds.sh
when: install.workarounds != ''
- name: apply workaround for BZ#1428608
lineinfile:
line: 'exclude=docker-distribution'
insertafter: EOF
dest: /etc/yum.conf
become: true
become_user: root
when:
- install.version|openstack_release == 10
- install.build|default('') == 'ga'
register: apply_workaround_bz1428608
- name: apply workaround for BZ#1671406
seboolean:
name: authlogin_nsswitch_use_ldap
state: yes
persistent: yes
become: true
become_user: root
when:
- install.version|openstack_distribution == 'OSP'
- install.version|openstack_release <= 10
- name: install the undercloud
command: bash ~/undercloud_deploy.sh
register: undercloud_deployment
ignore_errors: yes
- name: print the last 60 lines of the undercloud installation
command: tail -n60 undercloud_install.log
- name: print any nested error entries in undercloud installation
shell: "grep -B2 -A5 -i 'info:.*error:' undercloud_install.log || true"
- fail:
msg: "Undercloud deployment failed... :("
when: undercloud_deployment.rc != 0
- name: apply post deploy workarounds
command: bash ~/post_undercloud_deploy_workarounds.sh
when: install.workarounds != ''
- name: remove workaround for BZ#1428608
lineinfile:
line: 'exclude=docker-distribution'
state: absent
dest: /etc/yum.conf
become: true
become_user: root
when: not apply_workaround_bz1428608 is skipped
# even though bug is fixed this is still required for older OSP10 z streams
- name: "Workaround BZ#1553849 - iptables FORWARD DROP"
shell: |
set -ex
iptables -P FORWARD ACCEPT
sed -i "s/FORWARD DROP/FORWARD ACCEPT/" /etc/sysconfig/iptables
sed -i "s/FORWARD DROP/FORWARD ACCEPT/" /etc/sysconfig/iptables.save
become: true
become_user: root
when:
- install.version|openstack_distribution == 'OSP'
- install.version|openstack_release == 10
# rhosp-release provides /etc/rhosp-release, which is used in upgrade for version discovery.
- name: install rhosp-release
become: true
package:
state: latest
name: rhosp-release
when:
- install.version|openstack_distribution == 'OSP'
- install.version|openstack_release >= 10
- name: fetch the stackrc file
tags:
- fetch_rc_file
fetch:
src: "~/stackrc"
dest: "{{ inventory_dir }}/stackrc"
flat: yes
fail_on_missing: yes
- name: update clouds.yaml file
include_tasks: clouds.yml
vars:
auth_file_path: "/home/stack/stackrc"
cloudname: "{{ (auth_file_path|basename == 'stackrc') |ternary('undercloud','overcloud') }}"
- name: gathering new facts about the undercloud
setup:
- name: configure ironic direct deploy
shell: |
source ~/stackrc
openstack role add --user admin --project service ResellerAdmin
openstack --os-project-name service object store account set --property Temp-URL-Key=$(uuidgen | sha1sum | awk '{print $1}')
when:
- install.deploy_interface_default != 'iscsi'
- install.version|default(undercloud_version) | openstack_release == 13