Skip to content

Commit f17205d

Browse files
belphegor666Tim Robinson
andauthored
Candidate for v2.0 based on RHEL 8.3 (#10)
* partial update - scripts broken * updated packer version * added check for RH env credentials * fixed unix linefeeds * removed 'cache' folder from packer provisioning, updated sbt rpm repo Co-authored-by: Tim Robinson <[email protected]>
1 parent d9b3af4 commit f17205d

File tree

91 files changed

+417
-1433
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+417
-1433
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
europa.iml
22
.idea/
33
cache/*
4+
iso/*
45
build/roles/europa/files/cache/*
56
packer_cache/
67
europa-vbox/
7-
.vagrant/
8+
.vagrant/
9+
packer.exe

Vagrantfile

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
$script = <<SCRIPT
22
echo 'Creating the Europa group'
3-
groupadd -g 501 europa
3+
groupadd -g 1000000001 europa
44
echo 'Creating the Europa user'
5-
useradd europa -u 501 -g europa -G wheel
5+
useradd europa -u 1000000001 -g europa -G wheel
66
echo 'Setting up a password for the user'
77
echo "eur0pa"|passwd --stdin europa
88
echo 'Adding the user to the sudoer list'
@@ -18,10 +18,11 @@ module OS
1818
end
1919

2020
Vagrant.configure(2) do |config|
21-
config.vm.box = "bento/centos-7.6"
22-
config.vm.box_version = "201812.27.0"
21+
config.vm.box = "generic/rhel8"
22+
config.vm.box_version = "3.2.12"
2323
config.ssh.insert_key = false
2424
config.vm.provider "virtualbox" do |vbox|
25+
vbox.gui = true
2526
vbox.memory = 4096
2627
vbox.cpus = 2
2728
vbox.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
@@ -31,10 +32,18 @@ Vagrant.configure(2) do |config|
3132
config.vm.hostname = "europa"
3233
config.vm.define :europa do |europa| end
3334
config.vm.provision "shell", inline: $script
35+
config.vm.provision "shell", inline: "sudo yum -y install epel-release"
36+
config.vm.provision "shell", inline: "set +e; sudo subscription-manager remove --all 2>&1 >/dev/null; sudo subscription-manager unregister 2>&1 >/dev/null; sudo subscription-manager clean 2>&1 >/dev/null"
37+
config.vm.provision "shell" do |s|
38+
s.env = {RH_USERNAME:ENV['RH_USERNAME'], RH_PASSWORD:ENV['RH_PASSWORD']}
39+
s.inline = "sudo subscription-manager register --username ${RH_USERNAME} --password ${RH_PASSWORD} --name europa --auto-attach"
40+
end
41+
config.vm.provision "shell", inline: "sudo subscription-manager repos --enable codeready-builder-for-rhel-8-x86_64-rpms"
3442

3543
# if not building in windows then
3644
if OS.windows?
37-
config.vm.synced_folder "./cache", "/vagrant/build/cache"
45+
# config.vm.synced_folder "./cache", "/vagrant/build/cache"
46+
config.vm.synced_folder ".", "/vagrant"
3847

3948
# use a local provisioner
4049
config.vm.provision "ansible_local" do |ansible|

build/cache

Lines changed: 0 additions & 1 deletion
This file was deleted.

build/fetch.sh

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
#
2121
# fetches all required packages and copies them to the ROOT folder
2222
#
23-
ROOT='../cache/'
23+
#ROOT='../cache/'
24+
ROOT='../iso/'
2425

2526
# creates the root folder if it does not exist
2627
if [[ ! -e $ROOT ]]; then
@@ -71,29 +72,6 @@ downloadTo() {
7172
remove_empty_files
7273

7374
# download the following files to the root folder if they do not exist
74-
download "https://dl.fedoraproject.org/pub/epel/" "epel-release-latest-7.noarch.rpm"
75-
#download "http://mirror.centos.org/centos/7/os/x86_64/Packages/" "unzip-6.0-19.el7.x86_64.rpm"
76-
download "http://mirror.centos.org/centos/7/os/x86_64/Packages/" "system-config-language-1.4.0-9.el7.noarch.rpm"
77-
#downloadTo "https://download.oracle.com/otn-pub/java/jdk/12.0.1+12/69cfe15208a647278a19ef0990eea691/jdk-12.0.1_linux-x64_bin.rpm?AuthParam=1556778291_d3af0749ba8b1728edb4afae9bfebec2" "jdk-12.0.1_linux-x64_bin.rpm"
78-
download "https://download.oracle.com/java/GA/jdk12.0.1/69cfe15208a647278a19ef0990eea691/12/GPL/" "openjdk-12.0.1_linux-x64_bin.tar.gz"
7975
# for future reference, alternate provider of 'free' OpenJDK
8076
# download "https://github.com/AdoptOpenJDK/openjdk12-binaries/releases/download/jdk-12.0.1%2B12/" "OpenJDK12U-jdk_x64_linux_hotspot_12.0.1_12.tar.gz"
81-
download "https://dl.google.com/linux/direct/" "google-chrome-stable_current_x86_64.rpm"
82-
downloadTo "https://piccolo.link/sbt-1.2.8.zip" "sbt-1.2.8.zip"
83-
download "https://services.gradle.org/distributions/" "gradle-5.4.1-bin.zip"
84-
download "http://www-eu.apache.org/dist/maven/maven-3/3.6.1/binaries/" "apache-maven-3.6.1-bin.zip"
85-
download "http://opensource.wandisco.com/centos/7/git/x86_64/" "wandisco-git-release-7-2.noarch.rpm"
86-
download "http://opensource.wandisco.com/centos/7/git/x86_64/" "git-2.18.0-1.WANdisco.402.x86_64.rpm"
87-
download "http://opensource.wandisco.com/centos/7/git/x86_64/" "perl-Git-2.18.0-1.WANdisco.402.noarch.rpm"
88-
download "http://dl.bintray.com/groovy/maven/" "apache-groovy-binary-2.5.6.zip"
89-
download "https://download-cf.jetbrains.com/idea/" "ideaIC-2019.1.1-jbr11.tar.gz"
90-
#download "http://downloads.typesafe.com/scalaide-pack/4.7.0-vfinal-oxygen-212-20170929/" "scala-SDK-4.7.0-vfinal-2.12-linux.gtk.x86_64.tar.gz"
91-
download "http://ftp.halifax.rwth-aachen.de/eclipse//technology/epp/downloads/release/2019-03/R/" "eclipse-jee-2019-03-R-linux-gtk-x86_64.tar.gz"
92-
download "https://cdn.mysql.com//Downloads/MySQLGUITools/" "mysql-workbench-community-8.0.16-1.el7.x86_64.rpm"
93-
download "https://github.com/atom/atom/releases/download/v1.36.1/" "atom.x86_64.rpm"
94-
# download "https://github.com/openshift/origin/releases/download/v3.6.0/" "openshift-origin-server-v3.6.0-c4dd4cf-linux-64bit.tar.gz"
95-
download "https://github.com/openshift/origin/releases/download/v3.11.0/" "openshift-origin-client-tools-v3.11.0-0cbc58b-linux-64bit.tar.gz"
96-
download "https://az764295.vo.msecnd.net/stable/51b0b28134d51361cf996d2f0a1c698247aeabd8/" "code-1.33.1-1554971173.el7.x86_64.rpm"
97-
#downloadTo "https://sourceforge.net/projects/cntlm/files/cntlm/cntlm%200.92.3/cntlm-0.92.3-1.x86_64.rpm/download" "cntlm-0.92.3-1.x86_64.rpm"
98-
download "http://downloads.jboss.org/forge/releases/3.9.2.Final/" "forge-distribution-3.9.2.Final-offline.zip"
99-
downloadTo "https://github.com/fabric8io/gofabric8/releases/download/v0.4.176/gofabric8-linux-amd64" "gofabric8"
77+
downloadTo "https://access.cdn.redhat.com/content/origin/files/sha256/23/2323ad44d75df1a1e83048a34e196ddfedcd6c0f6c49ea59bf08095e3bb9ef65/rhel-8.1-x86_64-dvd.iso?_auth_=1627149443_6ff7b4dfb1f3c10dd25b093c4a26da34" "rhel-8.3-x86_64-dvd.iso"

build/http/ks.cfg

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ lang en_GB.UTF-8
2626
keyboard uk
2727

2828
# The timezone for this system
29-
timezone --utc Europe/London
29+
timezone Europe/London --isUtc
3030

3131
# Configure one or more NICs
3232
network --onboot yes --device eth0 --bootproto dhcp --noipv6
@@ -59,7 +59,7 @@ clearpart --all --initlabel
5959
autopart
6060

6161
# Disable the firstboot programme
62-
firstboot --disabled
62+
firstboot --disable
6363

6464
# Accepts the End User License Agreement without user interaction
6565
eula --agreed
@@ -68,22 +68,32 @@ eula --agreed
6868
reboot
6969

7070
# Define online repositories for packages to install
71-
url --url http://mirror.centos.org/centos/7.6.1810/os/x86_64/
72-
repo --name=epel --baseurl=http://dl.fedoraproject.org/pub/epel/7/x86_64/
73-
repo --name=updates --baseurl=http://mirror.centos.org/centos/7.6.1810/updates/x86_64/
71+
#url --url http://mirror.centos.org/centos/7.6.1810/os/x86_64/
72+
#repo --name=epel --baseurl=https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
73+
#repo --name=updates --baseurl=http://mirror.centos.org/centos/7.6.1810/updates/x86_64/
74+
75+
# Define repositories for packages to install
76+
#repo --name="Base" --baseurl=file:///run/install/repo/Base
77+
#repo --name="AppStream" --baseurl=file:///run/install/repo/AppStream
78+
# Use CDROM installation media
79+
cdrom
7480

7581
# Define the manifest of rpm packages to install
7682
# %packages --nobase
7783
%packages
78-
@ Core #@core
79-
@ Base #@base
80-
@ X Window System #@x11
81-
@ GNOME #@gnome-desktop - A GNOME desktop
84+
#@ Core #@core
85+
#@ Base #@base
86+
#@ Server with GUI #@x11
87+
#@ GNOME #@gnome-desktop - A GNOME desktop
88+
@^graphical-server-environment
89+
@gnome-desktop
90+
@base-x
8291
# Required by Virtual Box Guest Additions
8392
kernel-devel
8493
kernel-headers
8594
make
86-
dkms
95+
gcc
96+
#dkms
8797
bzip2
8898
wget
8999
openssh-clients
@@ -112,8 +122,8 @@ repo --name=updates --baseurl=http://mirror.centos.org/centos/7.6.1810/updates/x
112122
chkconfig cupsd off
113123

114124
printf "\nCreating user Europa...\n"
115-
/usr/sbin/groupadd -g 501 europa
116-
/usr/sbin/useradd europa -u 501 -g europa -G wheel
125+
/usr/sbin/groupadd -g 1000000001 europa
126+
/usr/sbin/useradd europa -u 1000000001 -g europa -G wheel
117127
echo "eur0pa"|passwd --stdin europa
118128
echo "europa ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/europa
119129
chmod 0440 /etc/sudoers.d/europa

build/initialise.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,19 @@
1818
# of Ansible for the provisioning of the various required tools.
1919
# This script is executed by packer using a shell provisioner.
2020
#
21+
echo 'registering the system with Red Hat'
22+
subscription-manager register --username ${RH_USERNAME} --password ${RH_PASSWORD} --name europa --auto-attach
23+
subscription-manager repos --enable codeready-builder-for-rhel-8-x86_64-rpms
24+
2125
echo 'setting the the user'
2226
europauser='europa'
2327

2428
echo 'installing the EPEL repository'
25-
yum install -y epel-release
29+
dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
30+
#yum install -y epel-release
31+
32+
echo 'insalling dkms for Virtualbox Guest Additions'
33+
yum install -y dkms
2634

2735
echo 'recording the build time'
2836
date > /etc/europa_build_time
@@ -50,4 +58,4 @@ umount /mnt
5058
rm -rf /home/$europauser/VBoxGuestAdditions_*.iso
5159

5260
echo 'installing ansible'
53-
yum install -y ansible
61+
yum install -y ansible

build/origin-server-standalone.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

build/origin-server.yml

Lines changed: 0 additions & 8 deletions
This file was deleted.

build/postconfig.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,4 @@ sudo rm -rf /tmp/packer-provisioner-ansible-local
4343

4444
echo "Compacting the disk"
4545
sudo dd if=/dev/zero of=/EMPTY bs=1M
46-
sudo rm -f /EMPTY
46+
sudo rm -f /EMPTY
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
- name: Install Ansible community general modules
3+
shell: "ansible-galaxy collection install community.general"

0 commit comments

Comments
 (0)