Packer
-
Packer is used to build image from a base image, perform provisions and store (commit) the final image.
-
We use provisioners and Packer templates to do the actual work to create the final image.
-
We use Ansible for provisioning.
Packer
Packer is used to build image from a base image, perform provisions and store (commit) the final image.
We use provisioners and Packer templates to do the actual work to create the final image.
We use Ansible for provisioning.
| --- | |
| hosts: all | |
| tasks: | |
| - name: add github ssh key | |
| copy: > | |
| src=files/id_rsa.github | |
| dest=/root/.ssh/id_rsa.github | |
| owner=root | |
| group=root |
| var fs = require('fs'); | |
| var net = require('net'); | |
| var http = require('http'); | |
| var https = require('https'); | |
| var httpAddress = '/path/to/http.sock'; | |
| var httpsAddress = '/path/to/https.sock'; | |
| fs.unlinkSync(httpAddress); | |
| fs.unlinkSync(httpsAddress); |
| #!/bin/sh | |
| ### BEGIN INIT INFO | |
| # Provides: haproxy | |
| # Required-Start: $local_fs $network $remote_fs | |
| # Required-Stop: $local_fs $remote_fs | |
| # Default-Start: 2 3 4 5 | |
| # Default-Stop: 0 1 6 | |
| # Short-Description: fast and reliable load balancing reverse proxy | |
| # Description: This file should be used to start and stop haproxy. | |
| ### END INIT INFO |
| #!/usr/bin/env bash | |
| # | |
| # Install HAProxy | |
| # Script works on Ubuntu 12.04 and 14.04 only | |
| set -e | |
| set -u | |
| set -o pipefail |
| import io | |
| import os | |
| # export GOOGLE_APPLICATION_CREDENTIALS=/home/oops/github/gcloud/GCP-ML-8492a87b7f32.json | |
| # Imports the Google Cloud client library | |
| from google.cloud import vision | |
| # Instantiates a client | |
| vision_client = vision.Client() |
| #!/bin/bash | |
| ############################################################################## | |
| # | |
| # | |
| # FILE : linux-explorer.sh | |
| # Last Change Date : 04-07-2016 | |
| # Author(s) : Joe Santoro | |
| # Date Started : 15th April, 2004 | |
| # Email : linuxexplo [ at ] unix-consultants.com | |
| # Web : http://www.unix-consultants.com/examples/scripts/linux/linux-explorer |
| #!/bin/bash -e | |
| yum update -y | |
| yum install -y aws-cfn-bootstrap git aws-cli | |
| # Install the files and packages from the metadata | |
| /opt/aws/bin/cfn-init -v --stack "{{ aws_stack_name }}" \ | |
| --resource ECSInstanceLaunchConfiguration \ | |
| --configsets ConfigCluster \ | |
| --region "{{ ref('AWS::Region') }}" |