title: In Ansible, is there a way to force variable values to integer?
body: <p>I'm trying to use ecs_taskdefinition module for Ansible (v2.0), and I think I'm stuck in the basic Ansible YAML gotcha.</p>
  
  <p>As per the example for the module, if I provide integer values for <code>cpu</code> and <code>memory</code>, this works as expected:</p>
  
  <pre><code>- name: "Create task definition"
    ecs_taskdefinition:
      containers:
      - name: simple-app
        cpu: 10
        memory: 300
        essential: true
        image: "httpd:2.4"
        portMappings:
        - containerPort: 80
          hostPort: 80
  </code></pre>
  
  <p>Although, I would like the <code>memory</code> and <code>cpu</code> to be templatable. So that I will be able to use same container definition for different environments.</p>
  
  <pre><code>APP_ENV: "test"
  test:
    containers:
      simple_app:
        memory: 1920
        cpu: 2560
  
  - name: "Create task definition"
    ecs_taskdefinition:
      containers:
      - name: simple-app
        cpu: "{{vars.get(APP_ENV).containers.simple_app.cpu | int}}"
        memory: "{{vars.get(APP_ENV).containers.simple_app.memory | int}}"
        essential: true
        image: "httpd:2.4"
        portMappings:
        - containerPort: 80
          hostPort: 80
  </code></pre>
  
  <p>With above, I get error from the botocore API:</p>
  
  <pre><code>botocore.exceptions.ParamValidationError: Parameter validation failed:
  Invalid type for parameter containerDefinitions[0].memory, value: 1920, type: &lt;type 'str'&gt;, valid types: &lt;type 'int'&gt;, &lt;type 'long'&gt;
  Invalid type for parameter containerDefinitions[0].cpu, value: 2560, type: &lt;type 'str'&gt;, valid types: &lt;type 'int'&gt;, &lt;type 'long'&gt;
  </code></pre>
  
  <p>Is this fixable without having to update the Ansible module to actually try to convert these values to integers?</p>