<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Ansible - Tag - Filipe Felisbino</title><link>https://felisbino.dev/tags/ansible/</link><description>Ansible - Tag - Filipe Felisbino</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Sat, 10 Sep 2016 00:00:00 +0000</lastBuildDate><atom:link href="https://felisbino.dev/tags/ansible/" rel="self" type="application/rss+xml"/><item><title>Docker: Service discovery for docker containers on AWS</title><link>https://felisbino.dev/posts/docker-service-discovery-on-aws/</link><pubDate>Sat, 10 Sep 2016 00:00:00 +0000</pubDate><author>Filipe Felisbino</author><guid>https://felisbino.dev/posts/docker-service-discovery-on-aws/</guid><description>&lt;p>These days we see lots of fancy ways to do service discovery with docker. You see examples of people using
etcd, zookeeper, consul and so on. I recently had a project to migrate some solr clusters to docker and I
started looking at some of those tools and how they would fit that our current infrastructure.&lt;/p>
&lt;p>After some researching I found that the KISS way of doing service discovery on our environment was to use route53.
The main reasons for this decision were:&lt;/p></description></item><item><title>Ansible: Data structure handling and transformation</title><link>https://felisbino.dev/posts/ansible-data-structures/</link><pubDate>Fri, 02 Sep 2016 00:00:00 +0000</pubDate><author>Filipe Felisbino</author><guid>https://felisbino.dev/posts/ansible-data-structures/</guid><description><![CDATA[<p>From time to time I had some dificulties with handling data structures with ansible. Things like converting
a list of dicts to a list of values ( inside a dict ) or even filtering a list aren&rsquo;t always trivial.</p>
<p>Because of that, I&rsquo;ve written a small filter plugin called <code>json_query</code>, that allows you to do some cool
transformations with ansible. The filter uses jmespath ( <a href="http://jmespath.org/" target="_blank" rel="noopener noreffer ">http://jmespath.org/</a> ) a query language for
json data. The plugin is already merged to <code>devel</code> branch and will be released on 2.2 version of ansible.</p>]]></description></item><item><title>AWS custom-crafted load balancer with haproxy</title><link>https://felisbino.dev/posts/aws-load-balancer/</link><pubDate>Sat, 06 Aug 2016 00:00:00 +0000</pubDate><author>Filipe Felisbino</author><guid>https://felisbino.dev/posts/aws-load-balancer/</guid><description><![CDATA[<p>Today&rsquo;s tip is on how to launch a custom-crafted load balancer on AWS as a replacement for ELBs.</p>
<h2 id="motivation">Motivation</h2>
<p>First of all I need to say that I love AWS&rsquo; ELB. It is cost-effective and works just fine for most of the cases.</p>
<p>So why would I create a custom-crafted ELB? Well, there are some features that AWS&rsquo; ELB just don&rsquo;t support. Things like:</p>
<ul>
<li>A static IP or elastic IP entry point</li>
<li>UDP load balancing</li>
<li>Customized balancing strategy</li>
<li>Custom backend routing</li>
<li>One load balancer for multiple backends</li>
<li>SNI resolution(SSL routing)</li>
</ul>
<p>So if the ELB is not suited for your use case, do it yourself :-)</p>]]></description></item><item><title>Ansible: Using with_nested to merge a list with a dict</title><link>https://felisbino.dev/posts/ansible-nested-example/</link><pubDate>Wed, 20 Jan 2016 00:00:00 +0000</pubDate><author>Filipe Felisbino</author><guid>https://felisbino.dev/posts/ansible-nested-example/</guid><description><![CDATA[<p>I make heavy use of Ansible for AWS infrastructure provisioning. From creating VPCs, subnets, EC2 instances, security groups and so on.</p>
<p>Because we have a central point where we define per-environment networks, I recently got stuck with having to convert a list of subnets (just strings) to a list of dicts to be used by the <code>ec2_group</code> module. My list of subnets was something like:</p>
<div class="code-block code-line-numbers open" style="counter-reset: code-block 0">
    <div class="code-header language-">
        <span class="code-title"><i class="arrow fas fa-angle-right" aria-hidden="true"></i></span>
        <span class="ellipses"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></span>
        <span class="copy" title="Copy to clipboard"><i class="far fa-copy" aria-hidden="true"></i></span>
    </div><pre tabindex="0"><code>internal_networks:
  - 10.100.32.0/20
  - 10.100.128.0/20
  - 10.100.144.0/20
  - 10.50.128.0/20
  - 10.50.144.0/20</code></pre></div>
<p>While the <code>ec2_group</code> expects its rules to be something like:</p>]]></description></item><item><title>Ansible: Flattening a list of dicts to a single dict</title><link>https://felisbino.dev/posts/ansible-flattening-list-of-dicts/</link><pubDate>Thu, 03 Dec 2015 00:00:00 +0000</pubDate><author>Filipe Felisbino</author><guid>https://felisbino.dev/posts/ansible-flattening-list-of-dicts/</guid><description><![CDATA[<p>Ansible is a great tool for automation. It has lots of modules that makes our lives easier. As a heavy-user of ansible for infrastructure provisioning on AWS, I sometimes get frustrated to have to deal with different data structures used by modules.</p>
<p>One example I had to deal with recently was the tags attribute of ec2_asg and ec2_tag. You cannot just pass the same value for both of them because ec2_asg tags attribute expects a list of dicts, while ec2_tag expects just a dict. That difference is because ec2_asg&rsquo;s dicts have an optional attribute called <em>propagate_at_launch</em>.</p>]]></description></item></channel></rss>