Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ubuntu18 #88

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Build 'virtualbox-iso' errored: ISO download failed.
```

* Run `cd virtualbox`
* Run `vagrant box add ubuntu-14.04.6-server-amd64-appserver_virtualbox.box --name devops-appserver`
* Run `vagrant box add ubuntu-18.04.3-live-server-amd64-appserver_virtualbox.box --name devops-appserver`
* Run `vagrant up`
* Run `vagrant ssh` to connect to the server

Expand Down
17 changes: 9 additions & 8 deletions packer-templates/application-server.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"variables": {
"PACKER_OS_FLAVOUR": "ubuntu",
"PACKER_BOX_NAME": "ubuntu-14.04.6-server-amd64",
[
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra [

"PACKER_BOX_NAME": "ubuntu-18.04.3-live-server-amd64",
"AWS_ACCESS_KEY_ID": "{{env `AWS_ACCESS_KEY_ID`}}",
"AWS_SECRET_ACCESS_KEY": "{{env `AWS_SECRET_ACCESS_KEY`}}",
"DIGITALOCEAN_API_TOKEN": "{{env `DIGITALOCEAN_API_TOKEN`}}"
Expand Down Expand Up @@ -39,9 +40,9 @@
"guest_additions_path": "VBoxGuestAdditions_{{.Version}}.iso",
"guest_os_type": "Ubuntu_64",
"http_directory": "http",
"iso_checksum": "b17d7c1e9d0321ad5810ba77b69aef43f0f29a5422b08120e6ee0576c4527c0e",
"iso_checksum": "b9beac143e36226aa8a0b03fc1cbb5921cff80123866e718aaeba4edb81cfa63",
"iso_checksum_type": "sha256",
"iso_url": "http://releases.ubuntu.com/trusty/{{ user `PACKER_BOX_NAME` }}.iso",
"iso_url": "http://releases.ubuntu.com/18.04/{{ user `PACKER_BOX_NAME` }}.iso",
"shutdown_command": "echo 'vagrant'|sudo -S shutdown -P now",
"ssh_password": "vagrant",
"ssh_port": 22,
Expand All @@ -59,7 +60,7 @@
"access_key": "{{ user `AWS_ACCESS_KEY_ID` }}",
"secret_key": "{{ user `AWS_SECRET_ACCESS_KEY` }}",
"region": "us-east-1",
"source_ami": "ami-10b68a78",
"source_ami": "ami-0ac019f4fcb7cb7e6s",
"instance_type": "t1.micro",
"ssh_username": "ubuntu",
"ami_name": "packer-app-server {{timestamp}}"
Expand All @@ -68,16 +69,16 @@
"type": "googlecompute",
"account_file": "account.json",
"project_id": "devops-intro-project",
"source_image": "ubuntu-1404-trusty-v20150316",
"source_image": "ubuntu-1804-bionic-v20181222",
"zone": "us-central1-a",
"image_name": "application-ubuntu-1404-{{timestamp}}",
"image_name": "application-ubuntu-1804-{{timestamp}}",
"machine_type": "n1-standard-1",
"ssh_username": "ubuntu"
},
{
"type": "digitalocean",
"api_token": "{{ user `DIGITALOCEAN_API_TOKEN` }}",
"image": "ubuntu-14-04-x64",
"image": "ubuntu-18.04.3-live-server-amd64",
"region": "tor1",
"size": "512mb",
"droplet_name": "udacity-devops",
Expand Down Expand Up @@ -121,4 +122,4 @@
}
]
]
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: New line missing.

59 changes: 28 additions & 31 deletions packer-templates/control-server.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{
"variables": {
"PACKER_OS_FLAVOUR": "ubuntu",
"PACKER_BOX_NAME": "ubuntu-14.04.6-server-amd64",

"PACKER_BOX_NAME": "ubuntu-18.04.3-live-server-amd64",
"AWS_ACCESS_KEY_ID": "{{env `AWS_ACCESS_KEY_ID`}}",
"AWS_SECRET_ACCESS_KEY": "{{env `AWS_SECRET_ACCESS_KEY`}}",
"DIGITALOCEAN_API_TOKEN": "{{env `DIGITALOCEAN_API_TOKEN`}}"
},
"builders": [
},
"builders": [
{
"type": "virtualbox-iso",
"boot_command": [
Expand Down Expand Up @@ -39,14 +40,16 @@
"guest_additions_path": "VBoxGuestAdditions_{{.Version}}.iso",
"guest_os_type": "Ubuntu_64",
"http_directory": "http",
"iso_checksum": "b17d7c1e9d0321ad5810ba77b69aef43f0f29a5422b08120e6ee0576c4527c0e",

"iso_checksum": "b9beac143e36226aa8a0b03fc1cbb5921cff80123866e718aaeba4edb81cfa63",
"iso_checksum_type": "sha256",
"iso_url": "http://releases.ubuntu.com/trusty/{{ user `PACKER_BOX_NAME` }}.iso",
"iso_url": "http://releases.ubuntu.com/18.04/{{ user `PACKER_BOX_NAME` }}.iso",
"shutdown_command": "echo 'vagrant'|sudo -S shutdown -P now",
"ssh_password": "vagrant",
"ssh_port": 22,
"ssh_username": "vagrant",
"ssh_wait_timeout": "10000s",
"type": "virtualbox-iso",
"vm_name": "control-{{ user `PACKER_BOX_NAME` }}",
"vboxmanage": [
["modifyvm", "{{.Name}}", "--memory", "1024"],
Expand All @@ -59,35 +62,36 @@
"access_key": "{{ user `AWS_ACCESS_KEY_ID` }}",
"secret_key": "{{ user `AWS_SECRET_ACCESS_KEY` }}",
"region": "us-east-1",
"source_ami": "ami-10b68a78",
"source_ami": "ami-0ac019f4fcb7cb7e6s",
"instance_type": "t1.micro",
"ssh_username": "ubuntu",
"ami_name": "control-{{ user `PACKER_BOX_NAME` }}-{{timestamp}}"
"ami_name": "packer-app-server {{timestamp}}"
},
{
"type": "googlecompute",
"account_file": "account.json",
"project_id": "devops-intro-project",
"source_image": "ubuntu-1404-trusty-v20150316",
"source_image": "ubuntu-1804-bionic-v20181222",
"zone": "us-central1-a",
"image_name": "control-ubuntu-1404-{{timestamp}}",
"image_name": "application-ubuntu-1804-{{timestamp}}",
"machine_type": "n1-standard-1",
"ssh_username": "ubuntu"
},
{
"type": "digitalocean",
"api_token": "{{ user `DIGITALOCEAN_API_TOKEN` }}",
"image": "ubuntu-14-04-x64",
"region": "tor1",
"size": "512mb",
"droplet_name": "udacity-devops",
"private_networking": true
}
"type": "digitalocean",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra spaces, this needs to be run through a formatter to make it consistent.

"api_token": "{{ user `DIGITALOCEAN_API_TOKEN` }}",
"image": "ubuntu-18.04.3-live-server-amd64",
"region": "tor1",
"size": "512mb",
"droplet_name": "udacity-devops",
"private_networking": true
}
],

"provisioners": [
{
"type": "shell",
"execute_command": "echo 'vagrant'|sudo -S -E bash '{{.Path}}'",
"execute_command": "echo 'vagrant'|{{.Vars}} sudo -S -E bash '{{.Path}}'",
"scripts": [
"scripts/update.sh"
]
Expand All @@ -97,22 +101,15 @@
"only": ["virtualbox-iso"],
"execute_command": "echo 'vagrant'|sudo -S -E bash '{{.Path}}'",
"scripts": [
"scripts/virtualbox.sh",
"scripts/vagrant.sh"
]
},
{
"type": "file",
"source": "../jenkins-config",
"destination": "/tmp"
"scripts/virtualbox.sh",
"scripts/vagrant.sh"
]
},
{
"type": "shell",
"execute_command": "echo 'vagrant'|sudo -S -E bash '{{.Path}}'",
"scripts": [
"scripts/jenkins.sh",
"scripts/graphite.sh",
"scripts/nginx.sh",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are jenkins, graphite and nginx removed?

"scripts/application.sh",
"scripts/cleanup.sh"
]
}
Expand All @@ -123,8 +120,8 @@
"type": "vagrant",
"except": ["googlecompute", "digitalocean"],
"compression_level": "9",
"output": "../output/{{.Provider}}/control-{{ user `PACKER_BOX_NAME` }}.box"
"output": "{{.Provider}}/{{ user `PACKER_BOX_NAME` }}-appserver_{{.Provider}}.box"
}
]
]
}
}
2 changes: 0 additions & 2 deletions packer-templates/scripts/virtualbox.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/bin/bash -eux
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't remove the hashbang


echo "Installing Virtualbox Guest Utils"
apt-get -y install dkms
VBOX_VERSION=$(cat /home/vagrant/.vbox_version)
Expand Down