|
{ |
|
"variables": { |
|
"aws_access_key": "", |
|
"aws_secret_key": "", |
|
"aws_region": "us-east-1", |
|
"aws_ami_image": "ami-6d1c2007", |
|
"aws_instance_type": "m4.large" |
|
}, |
|
"builders": [ |
|
{ |
|
"type": "amazon-ebs", |
|
"access_key": "{{user `aws_access_key`}}", |
|
"secret_key": "{{user `aws_secret_key`}}", |
|
"region": "{{user `aws_region`}}", |
|
"source_ami": "{{user `aws_ami_image`}}", |
|
"instance_type": "{{user `aws_instance_type`}}", |
|
"ssh_username": "centos", |
|
"ami_name": "base-centos-7-dcos-{{timestamp}}", |
|
"tags": { |
|
"Name": "ami-centos7-dcos-v1", |
|
"OS_Version": "LinuxCentOs7", |
|
"Release": "7", |
|
"Description": "Base CentOs7 image with prerequisites for DC/OS" |
|
}, |
|
"user_data_file": "files/user-data.txt" |
|
} |
|
], |
|
"provisioners": [ |
|
{ |
|
"type": "file", |
|
"source": "files/overlay.conf", |
|
"destination": "/home/centos/install/overlay.conf" |
|
}, |
|
{ |
|
"type": "shell", |
|
"inline": [ |
|
"sudo mkdir -p /etc/modules-load.d", |
|
"sudo mv /home/centos/install/overlay.conf /etc/modules-load.d/overlay.conf", |
|
"sudo reboot" |
|
] |
|
}, |
|
{ |
|
"type": "file", |
|
"source": "files/docker.repo", |
|
"destination": "/home/centos/install/docker.repo" |
|
}, |
|
{ |
|
"type": "file", |
|
"source": "files/override.conf", |
|
"destination": "/home/centos/install/override.conf" |
|
}, |
|
{ |
|
"type": "shell", |
|
"inline": [ |
|
"echo installing Docker -----------------------------------", |
|
"sudo mkdir -p /etc/systemd/system/docker.service.d", |
|
"sudo mv /home/centos/install/override.conf /etc/systemd/system/docker.service.d/override.conf", |
|
"sudo mv /home/centos/install/docker.repo /etc/yum.repos.d/docker.repo", |
|
"sudo yum install -y docker-engine-1.11.2", |
|
"sudo systemctl start docker", |
|
"sudo systemctl enable docker", |
|
"sudo docker ps", |
|
"echo DONE installing Docker -----------------------------", |
|
"sudo yum install -y tar xz unzip curl ipset nano tree", |
|
"sudo sed -i s/SELINUX=enforcing/SELINUX=permissive/g /etc/selinux/config", |
|
"sudo groupadd nogroup", |
|
"sudo reboot" |
|
] |
|
}, |
|
{ |
|
"type": "shell", |
|
"inline": [ |
|
"echo installing aws cli -------------------------------", |
|
"mkdir /tmp/awscli", |
|
"cd /tmp/awscli", |
|
"curl https://s3.amazonaws.com/aws-cli/awscli-bundle.zip -o awscli-bundle.zip", |
|
"unzip awscli-bundle.zip", |
|
"sudo ./awscli-bundle/install -i /usr/lib/aws -b /usr/bin/aws", |
|
"echo DONE installing aws cli -------------------------------" |
|
] |
|
}, |
|
{ |
|
"type": "shell", |
|
"inline": [ |
|
"echo DONE installing packages for CentOS7 DC/OS" |
|
] |
|
} |
|
] |
|
} |