aboutsummaryrefslogtreecommitdiffstats
path: root/build/templates/RedHat_juno.tmpl
blob: 51cc0772ff8213565938158c9f55f8e07241c2d2 (plain)
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
#!/bin/bash
set -x

yum remove systemd -y
# add 163 repo
yum install wget -y
wget -O /etc/yum.repos.d/CentOS7-Base-163.repo  http://mirrors.163.com/.help/CentOS7-Base-163.repo
wget -O /epel-release-7-5.noarch.rpm http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
yum remove wget iptables-services -y
yum update -y
rm -f /etc/yum.repos.d/CentOS-*.repo
yum repolist
yum clean all
# add openstack juno repo
yum install yum-plugin-priorities -y
yum install http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm -y
yum install http://rdo.fedorapeople.org/openstack-juno/rdo-release-juno.rpm -y

# modify centos7 repo for workaround
sed -i 's/epel-Derived from Red Hat Enterprise Linux 7.1 (Source)/epel-7/g' /etc/yum.repos.d/rdo-release.repo

# add galeracluster repo
cat <<EOF >/etc/yum.repos.d/MariaDB.repo
[mariadb]
name =MariaDB
baseurl = http://yum.mariadb.org/5.5/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
EOF

cat <<EOF >/etc/yum.repos.d/syslog.repo
[rsyslog_v7]
name=rsyslog
baseurl="http://rpms.adiscon.com/v7-stable/epel-7/x86_64"
enabled=1
gpgcheck=0
gpgkey=http://rpms.adiscon.com/RPM-GPG-KEY-Adiscon
protect=1
EOF

cat <<EOF >/etc/yum.repos.d/ceph.repo
[ceph]
name=Ceph packages for x86_64
baseurl=http://ceph.com/rpm-hammer/rhel7/x86_64
enabled=1
priority=2
gpgcheck=1
type=rpm-md
gpgkey=https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/release.asc

[ceph-noarch]
name=Ceph noarch packages
baseurl=http://ceph.com/rpm-hammer/rhel7/noarch
enabled=1
priority=2
gpgcheck=1
type=rpm-md
gpgkey=https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/release.asc
EOF

yum update -y
yum install createrepo -y
yum install tar -y

#download packages
#set packages = $getVar('default_packages', [])
#for pkg in $packages
yum -y install $pkg --downloadonly
#end for
#set packages = $getVar('packages', [])
#for pkg in $packages
yum -y install $pkg --downloadonly
#end for

#make repo

mkdir -p /centos7-juno-ppa/{Packages,repodata}

find /var/cache/yum/ -name "*.rpm" | xargs -i cp {} /centos7-juno-ppa/Packages/

rm /centos7-juno-ppa/Packages/selinux-policy* -f
rm /centos7-juno-ppa/Packages/systemd* -f

mv /epel-release-7-5.noarch.rpm /centos7-juno-ppa/Packages/
cp /comps.xml /centos7-juno-ppa/
cp /ceph_key_release.asc /centos7-juno-ppa/
createrepo -g comps.xml /centos7-juno-ppa
mkdir /centos7-juno-ppa/noarch
mkdir /centos7-juno-ppa/noarch/Packages
cp -r /centos7-juno-ppa/Packages/ceph* /centos7-juno-ppa/noarch/Packages/
cp -r /centos7-juno-ppa/repodata/ /centos7-juno-ppa/noarch/
tar -zcvf /centos7-juno-ppa.tar.gz /centos7-juno-ppa