Skip to content

Commit

Permalink
Adding ability to build grouper, and to share results
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim Van Fleet committed Sep 6, 2016
1 parent d94425e commit b99759b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
17 changes: 17 additions & 0 deletions bin/perms.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

aws_acct_id="823003027569"
bucket="internet2-tier-appliance-us-west-1"
vagrant_key=$(aws s3api list-objects-v2 --bucket $bucket --query 'reverse(sort_by(Contents[?contains(Key, `vagrant`)], &LastModified))[0].[Key]' --output text | tr -d '\n' )
ova_key=$(aws s3api list-objects-v2 --bucket $bucket --query 'reverse(sort_by(Contents[?contains(Key, `ova`)], &LastModified))[0].[Key]' --output text | tr -d '\n' )

echo "Found $vagrant_key"
aws s3api put-object-acl --bucket $bucket --key $vagrant_key --acl public-read

echo "Found $ova_key"
aws s3api put-object-acl --bucket $bucket --key $ova_key --acl public-read

ami_id=$(aws ec2 describe-images --owners $aws_acct_id --query 'reverse(sort_by(Images[?starts_with(Name, `import-ami`)], &CreationDate))[0].[ImageId]' --output text | tr -d '\n' )
echo "Found $ami_id"

aws ec2 modify-image-attribute --image-id $ami_id --launch-permission "{\"Add\":[{\"UserId\":\"$aws_acct_id\"}]}"
10 changes: 6 additions & 4 deletions grouper-appliance.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
"variables": {
"profile": "xfs",
"disk_size": "8192",
"memory": "6122",
"cpus": "2",
"memory": "2048",
"cpus": "1",
"guest_os_type": "RedHat_64",
"ssh_username": "centos",
"ssh_password": "centos",
"region": "us-west-1",
Expand Down Expand Up @@ -39,7 +40,8 @@
"disk_size": "{{user `disk_size`}}",
"vboxmanage": [
["modifyvm", "{{.Name}}", "--memory", "{{user `memory`}}"],
["modifyvm", "{{.Name}}", "--cpus", "{{user `cpus`}}"]
["modifyvm", "{{.Name}}", "--cpus", "{{user `cpus`}}"],
["modifyvm", "{{.Name}}", "--ostype", "{{user `guest_os_type`}}"]
],
"iso_url": "http://mirror.vcu.edu/pub/gnu+linux/centos/7/isos/x86_64/CentOS-7-x86_64-Minimal-1511.iso",
"iso_checksum": "f90e4d28fa377669b2db16cbcb451fcb9a89d2460e3645993e30e137ac37d284",
Expand Down Expand Up @@ -73,7 +75,7 @@
"access_key": "{{user `aws_access_key`}}",
"secret_key": "{{user `aws_secret_key`}}",
"region": "{{user `region`}}",
"s3_bucket_name": "internet2-ami-import-us-west-1",
"s3_bucket_name": "internet2-tier-ami-import-us-west-1",
"tags": {
"Description": "packer amazon-import-grouper-appliance {{user `timestamper`}}"
}
Expand Down

0 comments on commit b99759b

Please sign in to comment.