Hero Image

Blog

Concatenate a complex string in Ansible

Concatenate a complex string in Ansible

Constructing a long, complex string in Ansible can be achieved quite easily utilising Python string subsitution syntax.

Suppose you have the following variables:

app_protocol: http
app_host: 12.34.56.78
app_port: 8080
app_path: api/v2/testing

You could construct a string with all the component...

4th Jul 2018 - IronicBadger
Query instance specific information on AWS

Query instance specific information on AWS

When working in a dynamic environment you can use the following syntax to query an instance for information about itself.

I found this very useful when needing to discover which availability zone an instance was running in, for example.

curl http://169.254.169.254/latest/dynamic/instance-identit...

21st Jun 2018 - IronicBadger