This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| # this is a demo of conditional executions using 'only_if', which can skip | |
| # certain tasks on machines/platforms/etc where they do not apply. | |
| - hosts: web-servers | |
| user: ubuntu | |
| sudo: True | |
| vars: | |
| favcolor: "red" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| - hosts: web-servers | |
| user: ubuntu | |
| sudo: True | |
| vars: | |
| http_port: "8080" | |
| tasks: | |
| - name: write some_random_foo configuration |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/library/slurp b/library/slurp | |
| index 8b80e5d..64bf2be 100755 | |
| --- a/library/slurp | |
| +++ b/library/slurp | |
| @@ -42,7 +42,7 @@ params = {} | |
| for x in items: | |
| (k, v) = x.split("=") | |
| params[k] = v | |
| -source = params['src'] | |
| +source = os.path.expanduser(params['src']) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cd /tmp | |
| git clone https://github.com/riptano/chef.git chef | |
| cd chef | |
| git subtree split -P cookbooks/cassandra/ -b cassandra | |
| cd /tmp | |
| mkdir cassandra | |
| git init | |
| git fetch ../chef cassandra |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| knife openstack server list | |
| ERROR: Excon::Errors::NotFound: Expected(200) <=> Actual(404 Not Found) | |
| request => {:connect_timeout=>60, :headers=>{"Content-Type"=>"application/x-www-form-urlencoded", "Host"=>"nova-api.trystack.org:5443", "Content-Length"=>209}, :instrumentor_name=>"excon", :mock=>false, :read_timeout=>60, :retry_limit=>4, :ssl_verify_peer=>false, :write_timeout=>60, :host=>"nova-api.trystack.org", :path=>"/v2.0/", :port=>"5443", :query=>nil, :scheme=>"https", :body=>"AWSAccessKeyId=xxxxxxxx&Action=DescribeInstances&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-02-28T13%3A20%3A02Z&Version=2010-08-31&Signature=BMowmUh4435Xw4imsJLb6SeJtZ7lw3U3nVvvw9wQT2g%3D", :expects=>200, :idempotent=>true, :method=>"POST"} | |
| response => #<Excon::Response:0x90146c8 @body="{\"itemNotFound\": {\"message\": \"Item not found.\", \"code\": 404, \"details\": \"Error Details...\"}}", @headers={"Date"=>"Tue, 28 Feb 2012 13:20:05 GMT", "Content-Type"=>"application/json; charset=UTF-8", "Content-Length"=> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "Version":"2008-10-17", | |
| "Id":"", | |
| "Statement":[{ | |
| "Sid":"Stmt1313741300912", | |
| "Effect":"Allow", | |
| "Principal":{ | |
| "AWS":"*" | |
| }, | |
| "Action":"s3:GetObject", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| log_format proxied_combined '$http_x_forwarded_for - $remote_user [$time_local] ' | |
| '"$request" $status $body_bytes_sent ' | |
| '"$http_referer" "$http_user_agent"'; | |
| access_log logdir/access.log proxied_combined; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # | |
| # Filaneme: ebs_backup | |
| # | |
| VOLUMES='' | |
| EBS_DIR=/nfs-raid | |
| ISMOUNTED=$(df -la | grep -c $EBS_DIR) | |
| if [ $ISMOUNTED -gt 0 ];then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Run this script on the instance to be bundled | |
| # tested with Canonical Ubuntu 9.10 base ami | |
| EBS_DEVICE=${1:-'/dev/sdh'} | |
| IMAGE_DIR=${2:-'/mnt/tmp'} | |
| EBS_MOUNT_POINT=${3:-'/mnt/ebs'} | |
| mkdir -p $EBS_MOUNT_POINT | |
| mkfs.ext3 ${EBS_DEVICE} -L uec-rootfs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Backup the File based image firstly, making sure it is not mounted nor running as a xen domU. | |
| dd if=/dev/zero of=file.img bs=1M conv=notrunc count=1 seek=2000 | |
| #This resizes the file.img to 2GB. | |
| losetup /dev/loop1 file.img | |
| #loop1 had to be used as xen was already running a different domU via loop0. | |
| e2fsck -f /dev/loop1 |