# ecs\_taskdefinition module not creating new revision

**URL:** <https://forum.ansible.com/t/ecs-taskdefinition-module-not-creating-new-revision/21899>\
**Category:** Ansible Project\
**Tags:** aws\
**Created:** [June 30, 2016, 11:24am UTC](https://forum.ansible.com/t/ecs-taskdefinition-module-not-creating-new-revision/21899 "2016-06-30T11:24:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Niko\_Ruotsalainen](https://avatars.discourse-cdn.com/v4/letter/n/aeb1de/32.png) [@Niko\_Ruotsalainen](https://forum.ansible.com/u/Niko_Ruotsalainen)\
**Post date:** [June 30, 2016, 11:24am UTC](https://forum.ansible.com/t/ecs-taskdefinition-module-not-creating-new-revision/21899/1 "2016-06-30T11:24:25Z")

</div>

Hi,

I’m trying to use ecs\_taskdefinition module to create task definitions to ECS.

I’m using example from [https://docs.ansible.com/ansible/ecs\_taskdefinition\_module.html](https://docs.ansible.com/ansible/ecs_taskdefinition_module.html)

`

```auto
---

- hosts: localhost
  tasks:
    - name: "Create task definition"
      ecs_taskdefinition:
        containers:
        - name: simple-app
          cpu: 10
          essential: true
          image: "httpd:2.4"
          memory: 300
          mountPoints:
          - containerPath: /usr/local/apache2/htdocs
            sourceVolume: my-vol
          portMappings:
          - containerPort: 80
            hostPort: 80
        - name: busybox
          command:
            - "echo 'LOL'"
          cpu: 10
          entryPoint:
          - sh
          - "-c"
          essential: false
          image: busybox
          memory: 200
          volumesFrom:
          - sourceContainer: simple-app
        volumes:
        - name: my-vol
        family: test-cluster-taskdef
        state: present
      register: task_output

    - debug: var=task_output

```

`

And output is:

`

$ ansible-playbook playbooks/create-ecs-taskdefinition.yml

PLAY [localhost] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK [setup] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [localhost]

TASK [Create task definition] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [localhost]

TASK [debug] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [localhost] =\> {  
“task\_output”: {  
“changed”: false,  
“taskdefinition”: {  
“containerDefinitions”: [  
{  
“cpu”: 10,  
“environment”: ,  
“essential”: true,  
“image”: “httpd:2.4”,  
“memory”: 300,  
“mountPoints”: [  
{  
“containerPath”: “/usr/local/apache2/htdocs”,  
“sourceVolume”: “my-vol”  
}  
],  
“name”: “simple-app”,  
“portMappings”: [  
{  
“containerPort”: 80,  
“hostPort”: 80,  
“protocol”: “tcp”  
}  
],  
“volumesFrom”:   
},  
{  
“command”: [  
“echo ‘LOL’”  
],  
“cpu”: 10,  
“entryPoint”: [  
“sh”,  
“-c”  
],  
“environment”: ,  
“essential”: false,  
“image”: “busybox”,  
“memory”: 200,  
“mountPoints”: ,  
“name”: “busybox”,  
“portMappings”: ,  
“volumesFrom”: [  
{  
“sourceContainer”: “simple-app”  
}  
]  
}  
],  
“family”: “test-cluster-taskdef”,  
“revision”: 1,  
“status”: “ACTIVE”,  
“taskDefinitionArn”: “arn:aws:ecs:eu-west-1:123456789012:task-definition/test-cluster-taskdef:1”,  
“volumes”: [  
{  
“host”: {},  
“name”: “my-vol”  
}  
]  
}  
}  
}

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
localhost : ok=3 changed=0 unreachable=0 failed=0

`

So far all good. But when I run script again, it does not create new revision of task definition what I would expect to happen and output is exactly the same. Am I missing something or is this some kind of bug?

`

$ ansible --version  
ansible 2.1.0.0

`

I also tried creating task definition with AWS CLI and it work as expected. Second run create new revision of task definition. So thats why I’m asking this question here.

BR,  
Niko

---

<div class="post-metadata">

**Author:** ![Gallo](https://avatars.discourse-cdn.com/v4/letter/g/cab0a1/32.png) [@Gallo](https://forum.ansible.com/u/Gallo)\
**Post date:** [October 5, 2016, 8:10pm UTC](https://forum.ansible.com/t/ecs-taskdefinition-module-not-creating-new-revision/21899/2 "2016-10-05T20:10:50Z")

</div>

Did you find an answer im having the same issue.

---

<div class="post-metadata">

**Author:** ![Brian\_Jackson](https://avatars.discourse-cdn.com/v4/letter/b/dfb087/32.png) [@Brian\_Jackson](https://forum.ansible.com/u/Brian_Jackson)\
**Post date:** [November 22, 2016, 11:56pm UTC](https://forum.ansible.com/t/ecs-taskdefinition-module-not-creating-new-revision/21899/3 "2016-11-22T23:56:01Z")

</div>

If nothing has changed on the second run then it’s behaving correctly. I’m have a related problem (which lead me to this thread) where I do change the definition in the playbook but Ansible doesn’t create a new revision. In my case I’m updating the tag in the image. In your example I’d be updating  
`image: "http:2.4"`  
to  
`image: "http:2.5"`

Has anyone else seen this issue before?

---

<div class="post-metadata">

**Author:** ![Chaminda\_Delpagodage](https://avatars.discourse-cdn.com/v4/letter/c/9dc877/32.png) [@Chaminda\_Delpagodage](https://forum.ansible.com/u/Chaminda_Delpagodage)\
**Post date:** [April 24, 2017, 9:16pm UTC](https://forum.ansible.com/t/ecs-taskdefinition-module-not-creating-new-revision/21899/4 "2017-04-24T21:16:39Z")

</div>

I’m having the same issue. Updating the image URL, or even updating a volume name doesn’t create a new revision. Appreciate any pointers.

Thanks

---

<div class="post-metadata">

**Author:** ![Saurabh\_Agrawal](https://avatars.discourse-cdn.com/v4/letter/s/d26b3c/32.png) [@Saurabh\_Agrawal](https://forum.ansible.com/u/Saurabh_Agrawal)\
**Post date:** [August 7, 2019, 2:46pm UTC](https://forum.ansible.com/t/ecs-taskdefinition-module-not-creating-new-revision/21899/5 "2019-08-07T14:46:33Z")

</div>

does anyone have a solution for this issue? I could not able to register a new version of the task definition.
