Ansible Gotchas

For when I forget...

- Patterns for hosts with dynamic inventories:

- hosts: tag_Name_name_here:&tag_Whatever_whatevers

Find more here


- Get an instance-id from a list returned by ec2_remote_facts:

{{ item.1.id }} # if using with_indexed_items
{{ item.0.id }} # if using with_items.

...

read more

S3 bucket policy

Resource can take an array of resources. Useful when there are multiple actions like here:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "s3:*"
            ],
            "Resource": ["arn:aws:s3:::bucket_name", "arn:aws:s3:::bucket_name/*"] 
        }
    ]
}

...

read more

Express with passport and azure storage

I love azure for node.js app hosting. You get very good services, like azure storage, auto deployment from source control, domain, SSL etc. and all that for an affordable price (less than $50/month for auto scaling and backup). Performance is very good and it's rarely down (knocking on wood) even if you just go with basic apps.

As I wrote in a previous post, node.js works well with azure storage. Let's go further this time, and use azure storage to store our users and sessions for an express app.

...

read more

Yesod in devel mode

First, install yesod-bin. Check for the latest version at: https://hackage.haskell.org/package/yesod-bin

 Then do:

stack install yesod-bin-1.4.18.7 cabal-install

...

read more

Exporting PKCS7 certificate to Azure

An SSL certificate can't be directly exported into azure, it needs to be converted into PEM first and then PFX.


So for converting it to PEM:

openssl pkcs7 -print_certs -in cert.cer -out certificate.crt

 ...

read more

Azure storage with node.js

I finally managed to finish the blog module (this very page and everything under "Blog" on the menu). The posts are stored in azure storage, which is cheap, fast and pretty easy to integrate in node.js.

There are a some restrictions, like 1MB limit for an entity, 1KB limit for both the RowKey and PartitionKey.

More details here including some important design considerations.

First, install azure-storage and require it with:

var azure = require('azure-storage');

 ...

read more