This repository was archived by the owner on Jul 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
import of packerfiles to build iworkflow vagrant box
- Loading branch information
1 parent
58cfa7b
commit 09435fc
Showing
14 changed files
with
220 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#vim: set tabstop=8:softtabstop=8:shiftwidth=8:noexpandtab | ||
|
||
# Copyright 2017 F5 Networks | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
.DEFAULT_GOAL := all | ||
|
||
all: | ||
PACKER_LOG=1 packer build template.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# BIG-IP 12.1.1 Vagrant box | ||
|
||
This packer template can be used to build a BIG-IP vagrant box for version | ||
12.1.1. | ||
|
||
## Requirements | ||
|
||
This template requires that Virtualbox be installed on the machine | ||
the packer command is run on. | ||
|
||
## Usage | ||
|
||
Download copies of the following files | ||
|
||
* iWorkflow-2.1.0.0.0.10285.iso | ||
|
||
and place them in the following folder. | ||
|
||
* software/ | ||
|
||
Next, run the following command | ||
|
||
make | ||
|
||
and wait for it to finish. The resulting box will be found in your | ||
current working directory. |
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Copyright 2017 F5 Networks | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
rm -rf /shared/vagrant | ||
rm -rf /var/log/ltm | ||
rm -rf /root/.bash_history | ||
rm -rf /shared/images/*.iso | ||
rm -rf /var/named/config/rndc.key | ||
rm -rf /var/dnscached/config/rndc.key | ||
|
||
# Handle cleaning up SSH slightly differently because on BIG-IP | ||
# all of the SSH files are symlinks. So zero out the symlink targets | ||
> /var/ssh/root/authorized_keys | ||
> /var/ssh/root/identity | ||
> /var/ssh/root/identity.pub | ||
> /var/ssh/root/known_hosts | ||
|
||
dd if=/dev/zero of=/EMPTY bs=1M | ||
dd if=/dev/zero of=/config/EMPTY bs=1M | ||
dd if=/dev/zero of=/usr/EMPTY bs=1M | ||
dd if=/dev/zero of=/var/EMPTY bs=1M | ||
dd if=/dev/zero of=/shared/EMPTY bs=1M | ||
dd if=/dev/zero of=/var/log/EMPTY bs=1M | ||
|
||
rm -rf /EMPTY | ||
rm -rf /config/EMPTY | ||
rm -rf /usr/EMPTY | ||
rm -rf /var/EMPTY | ||
rm -rf /shared/EMPTY | ||
rm -rf /var/log/EMPTY | ||
|
||
sleep 60 | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Copyright 2017 F5 Networks | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
mount -o remount,rw /dev/mapper/vg--db--hda-set.1._usr /usr | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
|
||
tmsh save sys config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
cd /shared/vagrant/files | ||
|
||
tar zxvf simplejson-2.1.0.tar.gz | ||
mv setuptools-0.6c11-py2.4.egg simplejson-2.1.0/ | ||
cd simplejson-2.1.0 && python setup.py install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Copyright 2017 F5 Networks | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
rpm -Uvh /shared/vagrant/files/sudo-1.8.16-1.el5.x86_64.rpm | ||
sed -i 's/^.*requiretty/#Defaults requiretty/' /etc/sudoers | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
tmsh create auth user vagrant password vagrant partition-access add { all-partitions { role admin } } shell bash | ||
|
||
# This is added so that rsync synced_folder will work | ||
groupadd vagrant && usermod -a -G vagrant vagrant | ||
|
||
echo 'vagrant ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/vagrant | ||
mkdir -p /home/vagrant/.ssh | ||
chmod 0700 /home/vagrant/.ssh | ||
mv /shared/vagrant/files/vagrant.pub /home/vagrant/.ssh/authorized_keys | ||
chmod 0600 /home/vagrant/.ssh/authorized_keys | ||
chown -R vagrant:vagrant /home/vagrant/.ssh |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
{ | ||
"variables": { | ||
"F5_NAME": "iWorkflow-2.1.0.0.0.10285" | ||
}, | ||
"builders": [ | ||
{ | ||
"name": "{{ user `F5_NAME` }}", | ||
"type": "virtualbox-iso", | ||
"iso_url": "software/{{ user `F5_NAME` }}.iso", | ||
"iso_checksum": "806587ea1bf85ff040af5d88f93d55c5", | ||
"iso_checksum_type": "md5", | ||
"ssh_username": "root", | ||
"ssh_password": "default", | ||
"ssh_wait_timeout": "30000s", | ||
"headless": "false", | ||
"shutdown_command": "shutdown -h now", | ||
"guest_additions_mode": "disable", | ||
"guest_os_type": "Linux_64", | ||
"vm_name": "{{ user `F5_NAME` }}", | ||
"boot_wait": "60s", | ||
"boot_command": [ | ||
"<enter><wait5>", | ||
"<enter><wait5>", | ||
"<enter>" | ||
], | ||
"disk_size": "160000", | ||
"format": "ovf", | ||
"vboxmanage": [ | ||
["modifyvm","{{.Name}}","--memory","4096"], | ||
["modifyvm","{{.Name}}","--cpus","2"], | ||
["modifyvm","{{.Name}}","--nic1","NAT"], | ||
["modifyvm","{{.Name}}","--boot1","disk"] | ||
] | ||
} | ||
], | ||
"post-processors": [ | ||
{ | ||
"type": "vagrant", | ||
"compression_level": 9, | ||
"output": "{{ build_name }}.box" | ||
} | ||
], | ||
"provisioners": [ | ||
{ | ||
"type": "shell", | ||
"inline": [ | ||
"mkdir /shared/vagrant" | ||
] | ||
}, | ||
{ | ||
"type": "file", | ||
"source": "files", | ||
"destination": "/shared/vagrant" | ||
}, | ||
{ | ||
"type": "shell", | ||
"scripts": [ | ||
"scripts/filesystem-rw.sh", | ||
"scripts/sudo.sh", | ||
"scripts/vagrant.sh", | ||
"scripts/save-bigip-conf.sh", | ||
"scripts/cleanup.sh" | ||
], | ||
"start_retry_timeout": "30m" | ||
} | ||
] | ||
} |