Input file:
$ cat foo
qwe
123
bar
| --- | |
| - name: coreos-01 | |
| box: coreos-alpha | |
| ram: 512 | |
| ip: 172.17.8.101 | |
| - name: coreos-02 | |
| box: coreos-alpha | |
| ram: 512 | |
| ip: 172.17.8.102 | |
| - name: coreos-03 |
| # lib/puppet/parser/functions/pw_hash.rb | |
| module Puppet::Parser::Functions | |
| newfunction(:pw_hash, type: :rvalue) do |args| | |
| raise Puppet::ParseError, "pw_hash takes exactly two arguments, #{args.length} provided" if args.length != 2 | |
| # SHA512 ($6), default number of rounds (5000) | |
| # rounds could be specified by prepending rounds=<n>$ parameter before the salt, i.e. | |
| # args[0].crypt("$6$rounds=50000$#{args[1]}") | |
| args[0].crypt("$6$#{args[1]}") | |
| end |
The repository below resizes the vagrant box automatically, and I prefer this way.
https://github.com/SydOps/vagrant-box-resize
Here are the manual tasks with my updates and fork from christopher-hopper/vm-resize-hard-disk.md. But one issue is, after I manually resize, I found I can't use packer to re-baker vagrant box again.
Our Virtual Machines are provisioned using Vagrant from a Linux base box to run using VirutalBox. If the Hard Disk space runs out and you cannot remove files to free-up space, you can resize the Hard Disk using some VirtualBox and Linux commands.
| #!/usr/bin/env python | |
| """ | |
| Recipe for creating and updating security groups programmatically. | |
| """ | |
| import collections | |
| import boto |
| console.log('Loading event'); | |
| var AWS = require('aws-sdk'); | |
| var dynamodb = new AWS.DynamoDB(); | |
| exports.handler = function(event, context) { | |
| console.log("Request received:\n", JSON.stringify(event)); | |
| console.log("Context received:\n", JSON.stringify(context)); | |
| var tableName = "OurBlogDemo"; | |
| var datetime = new Date().getTime().toString(); |
Installation
Check out the [Facter documentation|https://docs.puppetlabs.com/facter/2.3/custom_facts.html#loading-custom-facts]
Requirements
gem 'aws-sdk-core'
Instance must have an IAM Role with read-only permission for EC2 resources (at least ec2:Describe*). See here and here Usage:
| #!/bin/bash | |
| #!/bin/bash | |
| #Utility to log into the RunDeck server and store cookie file for later use | |
| errorMsg() { | |
| echo "$*" 1>&2 | |
| } |
| # This is a general-purpose function to ask Yes/No questions in Bash, either | |
| # with or without a default answer. It keeps repeating the question until it | |
| # gets a valid answer. | |
| ask() { | |
| # http://djm.me/ask | |
| while true; do | |
| if [ "${2:-}" = "Y" ]; then | |
| prompt="Y/n" |
| --- | |
| - name: Load NRPE variables from Hiera | |
| connection: local | |
| hiera: path=lib/hiera/bin/hiera key="{{ item.value }}" fact="{{ item.key }}" source=hiera.yaml | |
| args: | |
| context: | |
| environment: "{{ environment }}" | |
| sitecode_lc: "{{ sitecode_lc }}" | |
| with_dictionary: | |
| nrpe_server_port: "nrpe_server_port" |