-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathinstall-openstack-ip-setup.sh
More file actions
167 lines (111 loc) · 3.58 KB
/
install-openstack-ip-setup.sh
File metadata and controls
167 lines (111 loc) · 3.58 KB
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
#!/bin/bash
bgreen='\033[1;32m'
red='\033[0;31m'
nc='\033[0m'
bold="\033[1m"
blink="\033[5m"
echo -e "${bgreen}Install OpenStack-PackStack on Almalinux 9 ${nc} "
# Set Hostname
#echo -e "${bgreen}Type Hostname : ${nc}"
#read hostname
echo
echo
read -p "$(echo -e "${bgreen}${bold}${blink}Type System Hostname: ${nc}")" hostname
hostnamectl set-hostname $hostname
echo -e "${bgreen} Enable PowerTools/CRB repository ${nc} "
#dnf install dnf-plugins-core -y
dnf config-manager --set-enabled crb -y
dnf install epel-release -y
dnf install nano -y
#sudo dnf install https://www.rdoproject.org/repos/rdo-release.el9.rpm -y
#dnf install centos-release-openstack-antelope -y
#dnf install centos-release-openstack-zed -y
#dnf install centos-release-openstack-bobcat -y
dnf install centos-release-openstack-yoga -y
dnf clean all
#dnf clean all
#dnf update -y
dnf install network-scripts -y
ls /etc/sysconfig/network-scripts/
#systemctl status network
systemctl start network
systemctl enable network
# Verifying IP & MAC Addresses
ip a
echo
echo
echo -e "${bgreen}${bold}${blink} Configure Static IP ${nc} "
read -p "Type static IP Interface Name: " STATIC_INTERFACE
read -p "Type MAC for static Interface: " MAC_ADDRESS
read -p "Type static IP Address: " IP_ADDRESS
read -p "Type IP PREFIX (CIDR): " IP_PREFIX
read -p "Type Gateway4: " GATEWAY
read -p "Type 1st DNS: " DNS
read -p "Type 2nd DNS: " DNS2
cat <<EOF | sudo tee /etc/sysconfig/network-scripts/ifcfg-$STATIC_INTERFACE
HWADRR=$MAC_ADDRESS
NM_CONTROLLED=no
BOOTPROTO=static
ONBOOT=yes
IPADDR=$IP_ADDRESS
PREFIX=$IP_PREFIX
GATEWAY=$GATEWAY
DNS1=$DNS
DNS2=$DNS2
DEVICE=$STATIC_INTERFACE
EOF
# Apply the Netplan configuration
nmcli connection up $STATIC_INTERFACE
ip a s $STATIC_INTERFACE
systemctl restart NetworkManager
ifup $STATIC_INTERFACE
cp /etc/sysconfig/network-scripts/ifcfg-$STATIC_INTERFACE /etc/sysconfig/network-scripts/ifcfg-$STATIC_INTERFACE.bak
cat /etc/sysconfig/network-scripts/ifcfg-$STATIC_INTERFACE
echo "$IP_ADDRESS $hostname.paulco.xyz $hostname" >> /etc/hosts
echo
echo
hostname -f
sed -i 's/^SELINUX=.*/SELINUX=disabled/g' /etc/selinux/config
systemctl disable firewalld
systemctl stop firewalld
#systemctl status NetworkManager
systemctl disable NetworkManager
systemctl stop NetworkManager
systemctl restart network
ifup $STATIC_INTERFACE
#dnf autoremove epel-release -y
#dnf autoremove openstack-packstack -y
#dnf clean all
dnf repolist
dnf update -y && dnf upgrade -y
systemctl daemon-reload
#reboot
#Install & Configure OpenStack-PackStack
#For AlmaLinux 9
#dnf config-manager --set-enabled crb -y
#Working On AlmaLinux 9
#dnf install centos-release-openstack-yoga -y
dnf install -y openstack-packstack -y
dnf repolist
dnf update -y
packstack --version
#packstack --help
#Generate Answers
#Pre-Installation with Generate Answers file
read -p "Type Your OpenStack Administrator Password: " apassword
packstack --os-neutron-ml2-tenant-network-types=vxlan \
--ntp-servers=0.asia.pool.ntp.org,1.asia.pool.ntp.org,2.asia.pool.ntp.org,3.asia.pool.ntp.org \
--os-neutron-ovs-bridge-interfaces=br-ex:$STATIC_INTERFACE \
--os-neutron-ml2-mechanism-drivers=openvswitch \
--os-neutron-ml2-type-drivers=vxlan,flat \
--os-neutron-l2-agent=openvswitch \
--keystone-admin-passwd=$apassword \
--provision-demo=n \
--os-heat-install=y \
--gen-answer-file /root/answers.txt
#Take Copy the answes file
cp /root/answers.txt /root/answers.copy.txt
#Installation OpenStack
packstack --answer-file /root/answers.txt | tee openstack-installation-log.txt
#To access Horizon Dashboard use the URL:
echo -e "${bgreen}http://$IP_ADDRESS/dashboard ${nc} "