is it possible to set "name" of instance with ec2 module

19 views
Skip to first unread message

esxi...@gmail.com

unread,
Nov 9, 2020, 8:11:58 PM11/9/20
to Ansible Project
Hi,

      - name: Provision instance(s)
        ec2:
          key_name: "{{ key_name }}"
          id: "{{ id }}"
          group_id: "{{ result_sec_group.group_id }}"
          image: "{{ image }}"
          instance_type: t2.micro
          region: "{{ region }}"
          wait: true
          count: 1
          # exact_count: 2
          # count_tag:
          #   Name: App
          # instance_tags:
          #   Name: App

      tags: ['never', 'create_ec2']


Will result in



Any suggestions Please how can i set this during creation & hence it will get me Idempotence ... else my playbook create new EC2 each time


Thanks

Reply all
Reply to author
Forward
0 new messages