diff --git a/iworkflow-2.1.0-x86_64/Makefile b/iworkflow-2.1.0-x86_64/Makefile new file mode 100644 index 0000000..c0cdbdc --- /dev/null +++ b/iworkflow-2.1.0-x86_64/Makefile @@ -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 diff --git a/iworkflow-2.1.0-x86_64/README.md b/iworkflow-2.1.0-x86_64/README.md new file mode 100644 index 0000000..9841eeb --- /dev/null +++ b/iworkflow-2.1.0-x86_64/README.md @@ -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. diff --git a/iworkflow-2.1.0-x86_64/files/setuptools-0.6c11-py2.4.egg b/iworkflow-2.1.0-x86_64/files/setuptools-0.6c11-py2.4.egg new file mode 100644 index 0000000..b2c1592 Binary files /dev/null and b/iworkflow-2.1.0-x86_64/files/setuptools-0.6c11-py2.4.egg differ diff --git a/iworkflow-2.1.0-x86_64/files/simplejson-2.1.0.tar.gz b/iworkflow-2.1.0-x86_64/files/simplejson-2.1.0.tar.gz new file mode 100644 index 0000000..dbba0b2 Binary files /dev/null and b/iworkflow-2.1.0-x86_64/files/simplejson-2.1.0.tar.gz differ diff --git a/iworkflow-2.1.0-x86_64/files/sudo-1.8.16-1.el5.x86_64.rpm b/iworkflow-2.1.0-x86_64/files/sudo-1.8.16-1.el5.x86_64.rpm new file mode 100644 index 0000000..49d63d1 Binary files /dev/null and b/iworkflow-2.1.0-x86_64/files/sudo-1.8.16-1.el5.x86_64.rpm differ diff --git a/iworkflow-2.1.0-x86_64/files/vagrant.pub b/iworkflow-2.1.0-x86_64/files/vagrant.pub new file mode 100644 index 0000000..18a9c00 --- /dev/null +++ b/iworkflow-2.1.0-x86_64/files/vagrant.pub @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key diff --git a/iworkflow-2.1.0-x86_64/scripts/cleanup.sh b/iworkflow-2.1.0-x86_64/scripts/cleanup.sh new file mode 100644 index 0000000..032144c --- /dev/null +++ b/iworkflow-2.1.0-x86_64/scripts/cleanup.sh @@ -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 \ No newline at end of file diff --git a/iworkflow-2.1.0-x86_64/scripts/filesystem-rw.sh b/iworkflow-2.1.0-x86_64/scripts/filesystem-rw.sh new file mode 100644 index 0000000..f0660a9 --- /dev/null +++ b/iworkflow-2.1.0-x86_64/scripts/filesystem-rw.sh @@ -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 diff --git a/iworkflow-2.1.0-x86_64/scripts/save-bigip-conf.sh b/iworkflow-2.1.0-x86_64/scripts/save-bigip-conf.sh new file mode 100644 index 0000000..d913e07 --- /dev/null +++ b/iworkflow-2.1.0-x86_64/scripts/save-bigip-conf.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +tmsh save sys config diff --git a/iworkflow-2.1.0-x86_64/scripts/simplejson.sh b/iworkflow-2.1.0-x86_64/scripts/simplejson.sh new file mode 100644 index 0000000..4d5ba96 --- /dev/null +++ b/iworkflow-2.1.0-x86_64/scripts/simplejson.sh @@ -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 diff --git a/iworkflow-2.1.0-x86_64/scripts/sudo.sh b/iworkflow-2.1.0-x86_64/scripts/sudo.sh new file mode 100644 index 0000000..aa9ac88 --- /dev/null +++ b/iworkflow-2.1.0-x86_64/scripts/sudo.sh @@ -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 diff --git a/iworkflow-2.1.0-x86_64/scripts/vagrant.sh b/iworkflow-2.1.0-x86_64/scripts/vagrant.sh new file mode 100644 index 0000000..fe9efc9 --- /dev/null +++ b/iworkflow-2.1.0-x86_64/scripts/vagrant.sh @@ -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 diff --git a/iworkflow-2.1.0-x86_64/software/.gitignore b/iworkflow-2.1.0-x86_64/software/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/iworkflow-2.1.0-x86_64/template.json b/iworkflow-2.1.0-x86_64/template.json new file mode 100644 index 0000000..13c541c --- /dev/null +++ b/iworkflow-2.1.0-x86_64/template.json @@ -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": [ + "", + "", + "" + ], + "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" + } + ] +}