Skip to content

Commit

Permalink
With usage video
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesWoolfenden committed Nov 17, 2019
1 parent 7732bc1 commit 536b800
Show file tree
Hide file tree
Showing 29 changed files with 1,100 additions and 1,120 deletions.
44 changes: 22 additions & 22 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
{
"cSpell.words": [
"Cloudposse",
"Mgmt",
"RHEL",
"albp",
"awscli",
"convertfrom",
"diskio",
"googleplus",
"iowait",
"jameswoolfenden",
"jmeter",
"killall",
"nginx",
"openjdk",
"reddit",
"redhat",
"stunnel",
"syslog",
"totalcpu",
"urite"
]
"cSpell.words": [
"Cloudposse",
"Mgmt",
"RHEL",
"albp",
"awscli",
"convertfrom",
"diskio",
"googleplus",
"iowait",
"jameswoolfenden",
"jmeter",
"killall",
"nginx",
"openjdk",
"reddit",
"redhat",
"stunnel",
"syslog",
"totalcpu",
"urite"
]
}
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[![Slalom][logo]](https://slalom.com)

# packer-by-example [![Build Status](https://travis-ci.com/JamesWoolfenden/packer-by-example.svg?branch=master)](https://travis-ci.com/JamesWoolfenden/packer-by-example) [![Latest Release](https://img.shields.io/github/release/JamesWoolfenden/packer-by-example.svg)](https://github.com/JamesWoolfenden/packer-by-example/releases/latest)
# Packer by Example [![Latest Release](https://img.shields.io/github/v/tag/JamesWoolfenden/packer-by-example.svg)](https://github.com/JamesWoolfenden/packer-by-example)

By [James Woolfenden](https://www.linkedin.com/in/jameswoolfenden/)

Packer-by-example is a collection of Scripts, Ansible, Makefiles and Packer files to building images in the Public Cloud.
It's designed to work with CI/CD systems such as Travis CI, CircleCI and Jenkins, or even at your console.
Expand Down
8 changes: 4 additions & 4 deletions environment/slalom-azure.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"location": "uksouth",
"vm_size": "Standard_A2",
"resourcegroup": "packer",
"storageaccount": "packerfiles"
"location": "uksouth",
"vm_size": "Standard_A2",
"resourcegroup": "packer",
"storageaccount": "packerfiles"
}
10 changes: 5 additions & 5 deletions environment/template-aws.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"instance_type": "t2.micro",
"vpc_id": "",
"subnet_id": "",
"ami_users": "",
"aws_region": ""
"instance_type": "t2.micro",
"vpc_id": "",
"subnet_id": "",
"ami_users": "",
"aws_region": ""
}
8 changes: 4 additions & 4 deletions environment/template-azure.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"location": "uksouth",
"vm_size": "Standard_A2",
"resourcegroup": "packer",
"storageaccount": "packerfiles"
"location": "uksouth",
"vm_size": "Standard_A2",
"resourcegroup": "packer",
"storageaccount": "packerfiles"
}
2 changes: 1 addition & 1 deletion environment/template-gcp.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"project_id": ""
"project_id": ""
}
92 changes: 46 additions & 46 deletions packfiles/CentOS/centos-azure.json
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
{
"variables": {
"client_id": "{{env `ARM_CLIENT_ID`}}",
"client_secret": "{{env `ARM_CLIENT_SECRET`}}",
"subscription_id": "{{env `ARM_SUBSCRIPTION_ID`}}",
"tenant_id": "{{env `ARM_TENANT_ID`}}",
"ssh_user": "centos",
"ssh_pass": "{{env `ARM_SSH_PASS`}}"
},
"builders": [
{
"type": "azure-arm",
"client_id": "{{ user `client_id` }}",
"client_secret": "{{ user `client_secret` }}",
"subscription_id": "{{ user `subscription_id` }}",
"tenant_id": "{{ user `tenant_id` }}",
"resource_group_name": "{{ user `resourcegroup` }}",
"storage_account": "{{ user `storageaccount` }}",
"capture_container_name": "images",
"capture_name_prefix": "packer",
"ssh_username": "{{user `ssh_user`}}",
"ssh_password": "{{user `ssh_pass`}}",
"os_type": "Linux",
"image_publisher": "OpenLogic",
"image_offer": "CentOS",
"image_sku": "7.3",
"azure_tags": {
"dept": "engineering"
},
"image_version": "latest",
"ssh_pty": "true",
"location": "{{ user `location` }}",
"vm_size": "{{ user `vm_size` }}"
}
],
"provisioners": [
{
"execute_command": "echo '{{user `ssh_pass`}}' | {{ .Vars }} sudo -S -E sh '{{ .Path }}'",
"inline": [
"yum update -y",
"/usr/sbin/waagent -force -deprovision+user && export HISTSIZE=0 && sync"
],
"inline_shebang": "/bin/sh -x",
"type": "shell",
"skip_clean": true
}
]
"variables": {
"client_id": "{{env `ARM_CLIENT_ID`}}",
"client_secret": "{{env `ARM_CLIENT_SECRET`}}",
"subscription_id": "{{env `ARM_SUBSCRIPTION_ID`}}",
"tenant_id": "{{env `ARM_TENANT_ID`}}",
"ssh_user": "centos",
"ssh_pass": "{{env `ARM_SSH_PASS`}}"
},
"builders": [
{
"type": "azure-arm",
"client_id": "{{ user `client_id` }}",
"client_secret": "{{ user `client_secret` }}",
"subscription_id": "{{ user `subscription_id` }}",
"tenant_id": "{{ user `tenant_id` }}",
"resource_group_name": "{{ user `resourcegroup` }}",
"storage_account": "{{ user `storageaccount` }}",
"capture_container_name": "images",
"capture_name_prefix": "packer",
"ssh_username": "{{user `ssh_user`}}",
"ssh_password": "{{user `ssh_pass`}}",
"os_type": "Linux",
"image_publisher": "OpenLogic",
"image_offer": "CentOS",
"image_sku": "7.3",
"azure_tags": {
"dept": "engineering"
},
"image_version": "latest",
"ssh_pty": "true",
"location": "{{ user `location` }}",
"vm_size": "{{ user `vm_size` }}"
}
],
"provisioners": [
{
"execute_command": "echo '{{user `ssh_pass`}}' | {{ .Vars }} sudo -S -E sh '{{ .Path }}'",
"inline": [
"yum update -y",
"/usr/sbin/waagent -force -deprovision+user && export HISTSIZE=0 && sync"
],
"inline_shebang": "/bin/sh -x",
"type": "shell",
"skip_clean": true
}
]
}
82 changes: 41 additions & 41 deletions packfiles/Ubuntu/base-azure.json
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
{
"variables": {
"client_id": "{{env `ARM_CLIENT_ID`}}",
"client_secret": "{{env `ARM_CLIENT_SECRET`}}",
"subscription_id": "{{env `ARM_SUBSCRIPTION_ID`}}",
"tenant_id": "{{env `ARM_TENANT_ID`}}"
},
"builders": [
{
"type": "azure-arm",
"client_id": "{{ user `client_id` }}",
"client_secret": "{{ user `client_secret` }}",
"subscription_id": "{{ user `subscription_id` }}",
"tenant_id": "{{ user `tenant_id` }}",
"resource_group_name": "{{ user `resourcegroup` }}",
"storage_account": "{{ user `storageaccount` }}",
"capture_container_name": "images",
"capture_name_prefix": "packer",
"os_type": "Linux",
"image_publisher": "Canonical",
"image_offer": "UbuntuServer",
"image_sku": "14.04.4-LTS",
"azure_tags": {
"dept": "engineering"
},
"location": "{{ user `location` }}",
"vm_size": "{{ user `vm_size` }}"
}
],
"provisioners": [
{
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'",
"inline": [
"apt-get update",
"apt-get upgrade -y",
"apt-get -y install nginx",
"/usr/sbin/waagent -force -deprovision+user && export HISTSIZE=0 && sync"
],
"inline_shebang": "/bin/sh -x",
"type": "shell"
}
]
"variables": {
"client_id": "{{env `ARM_CLIENT_ID`}}",
"client_secret": "{{env `ARM_CLIENT_SECRET`}}",
"subscription_id": "{{env `ARM_SUBSCRIPTION_ID`}}",
"tenant_id": "{{env `ARM_TENANT_ID`}}"
},
"builders": [
{
"type": "azure-arm",
"client_id": "{{ user `client_id` }}",
"client_secret": "{{ user `client_secret` }}",
"subscription_id": "{{ user `subscription_id` }}",
"tenant_id": "{{ user `tenant_id` }}",
"resource_group_name": "{{ user `resourcegroup` }}",
"storage_account": "{{ user `storageaccount` }}",
"capture_container_name": "images",
"capture_name_prefix": "packer",
"os_type": "Linux",
"image_publisher": "Canonical",
"image_offer": "UbuntuServer",
"image_sku": "14.04.4-LTS",
"azure_tags": {
"dept": "engineering"
},
"location": "{{ user `location` }}",
"vm_size": "{{ user `vm_size` }}"
}
],
"provisioners": [
{
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'",
"inline": [
"apt-get update",
"apt-get upgrade -y",
"apt-get -y install nginx",
"/usr/sbin/waagent -force -deprovision+user && export HISTSIZE=0 && sync"
],
"inline_shebang": "/bin/sh -x",
"type": "shell"
}
]
}
68 changes: 34 additions & 34 deletions packfiles/Ubuntu/server-azure.json
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
{
"builders": [
{
"type": "azure-arm",
"client_id": "f5b6a5cf-fbdf-4a9f-b3b8-3c2cd00225a4",
"client_secret": "0e760437-bf34-4aad-9f8d-870be799c55d",
"tenant_id": "72f988bf-86f1-41af-91ab-2d7cd011db47",
"subscription_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx",
"managed_image_resource_group_name": "myResourceGroup",
"managed_image_name": "myPackerImage",
"os_type": "Linux",
"image_publisher": "Canonical",
"image_offer": "UbuntuServer",
"image_sku": "16.04-LTS",
"azure_tags": {
"dept": "Engineering",
"task": "Image deployment"
},
"location": "{{ user `location` }}",
"vm_size": "{{ user `vm_size` }}"
}
],
"provisioners": [
{
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'",
"inline": [
"apt-get update",
"apt-get upgrade -y",
"apt-get -y install nginx",
"/usr/sbin/waagent -force -deprovision+user && export HISTSIZE=0 && sync"
],
"inline_shebang": "/bin/sh -x",
"type": "shell"
}
]
"builders": [
{
"type": "azure-arm",
"client_id": "f5b6a5cf-fbdf-4a9f-b3b8-3c2cd00225a4",
"client_secret": "0e760437-bf34-4aad-9f8d-870be799c55d",
"tenant_id": "72f988bf-86f1-41af-91ab-2d7cd011db47",
"subscription_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx",
"managed_image_resource_group_name": "myResourceGroup",
"managed_image_name": "myPackerImage",
"os_type": "Linux",
"image_publisher": "Canonical",
"image_offer": "UbuntuServer",
"image_sku": "16.04-LTS",
"azure_tags": {
"dept": "Engineering",
"task": "Image deployment"
},
"location": "{{ user `location` }}",
"vm_size": "{{ user `vm_size` }}"
}
],
"provisioners": [
{
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'",
"inline": [
"apt-get update",
"apt-get upgrade -y",
"apt-get -y install nginx",
"/usr/sbin/waagent -force -deprovision+user && export HISTSIZE=0 && sync"
],
"inline_shebang": "/bin/sh -x",
"type": "shell"
}
]
}
Loading

0 comments on commit 536b800

Please sign in to comment.