-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathrpmbuilder.yml
84 lines (83 loc) · 4.06 KB
/
rpmbuilder.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
---
- hosts: rpmbuilders
gather_facts: no
user: root
vars:
acs_ver: 4.3.0
acs_url: https://dist.apache.org/repos/dist/release/cloudstack/releases
tasks:
- name: Install deps and niceties
yum: name=$item state=latest
with_items:
- wget
- rpm-build
- java-1.6.0-openjdk-devel
- tomcat6
- screen
- vim-enhanced
- gcc
- genisoimage
- ws-commons-util
- glibc-devel
- MySQL-python
- libselinux-python
- createrepo
# Maven installation section
- name: Create /opt dir
file: path=/opt state=directory
- name: download Maven3
get_url: dest=/opt/maven3.tar.gz url=http://mirror.catn.com/pub/apache/maven/maven-3/3.1.1/binaries/apache-maven-3.1.1-bin.tar.gz
- name: Unpack Maven3
action: command creates=/opt/maven chdir=/opt tar zxvf /opt/maven3.tar.gz
- name: Create Maven3 directory link
file: path=/opt/maven src=/opt/apache-maven-3.1.1 state=link
- name: Set mvn link
action: command update-alternatives --install /usr/bin/mvn mvn /opt/maven/bin/mvn 1
- name: create .m2 directory
file: path=/root/.m2 state=directory
- name: Copy in settings.xml to use ACS-specific Archiva repo
template: src=settings.xml dest=/root/.m2/settings.xml
# CloudStack source tarball download and manipulation
- name: Get KEYS
get_url: dest=/opt/KEYS url=http://www.apache.org/dist/cloudstack/KEYS
- name: Get CloudStack
get_url: dest=/opt/cs.tar.bz2 url={{acs_url}}/{{acs_ver}}/apache-cloudstack-{{acs_ver}}-src.tar.bz2
- name: Get md5
get_url: dest=/opt/cs.tar.bz2.md5 url={{acs_url}}/{{acs_ver}}/apache-cloudstack-{{acs_ver}}-src.tar.bz2.md5
- name: Get sha
get_url: dest=/opt/cs.tar.bz2.sha256 url={{acs_url}}/{{acs_ver}}/apache-cloudstack-{{acs_ver}}-src.tar.bz2.sha
- name: Get sigs
get_url: dest=/opt/cs.tar.bz2.asc url={{acs_url}}/{{acs_ver}}/apache-cloudstack-{{acs_ver}}-src.tar.bz2.asc
- name: import KEYS
shell: gpg --import /opt/KEYS
- name: verify sigs
shell: gpg --verify /opt/cs.tar.bz2.asc
# Below isn't working because of hash formatting, not an ansible problem.
# - name: verify md5
# shell: chdir=/opt md5sum -c ./cs.tar.bz2.md5
# - name: verify sha256sum
# shell: chdir=/opt sha256sum -c ./cs.tar.bz2.sha256
- name: unpack CloudStack
action: command creates=/opt/apache-cloudstack-{{acs_ver}}-src chdir=/opt tar xjvf /opt/cs.tar.bz2
- name: Get iControl.jar
get_url: dest=/opt/apache-cloudstack-{{acs_ver}}-src/deps/cloud-iControl.jar url=http://zooi.widodh.nl/cloudstack/build-dep/cloud-iControl.jar
- name: Get manageontap.jar
get_url: dest=/opt/apache-cloudstack-{{acs_ver}}-src/deps/manageontap.jar url=http://zooi.widodh.nl/cloudstack/build-dep/cloud-manageontap.jar
- name: Get VMware VIM.jar
get_url: dest=/opt/apache-cloudstack-{{acs_ver}}-src/deps/vim.jar url=http://zooi.widodh.nl/cloudstack/build-dep/vmware-vim.jar
- name: get apputils.jar
get_url: dest=/opt/apache-cloudstack-{{acs_ver}}-src/deps/apputils.jar url=http://zooi.widodh.nl/cloudstack/build-dep/vmware-apputils.jar
- name: get netscaler jar 1
get_url: dest=/opt/apache-cloudstack-{{acs_ver}}-src/deps/cloud-netscaler.jar url=https://s3.amazonaws.com/deps.cloudstack.org/cloud-netscaler.jar
- name: get netscaler jar 2
get_url: dest=/opt/apache-cloudstack-{{acs_ver}}-src/deps/cloud-netscaler-sdx.jar url=https://s3.amazonaws.com/deps.cloudstack.org/cloud-netscaler-sdx.jar
- name: get vim25_51
get_url: dest=/opt/apache-cloudstack-{{acs_ver}}-src/deps/vim25_51.jar url=https://s3.amazonaws.com/deps.cloudstack.org/vim25.jar
- name: Install the deps
action: command chdir=/opt/apache-cloudstack-{{acs_ver}}-src/deps ./install-non-oss.sh
- name: build rpms
action: command chdir=/opt/apache-cloudstack-{{acs_ver}}-src/packaging/centos63 ./package.sh -p noredist
- name: build repo
action: command chdir=/opt/apache-cloudstack-{{acs_ver}}-src/dist/rpmbuild/RPMS/ createrepo ./x86_64
- name: tarball creation
action: command chdir=/opt/apache-cloudstack-{{acs_ver}}-src/dist/rpmbuild/RPMS/ tar -cjf /root/csyum.bz2 ./x86_64