ERROR! no action detected in task

1,012 views
Skip to first unread message

S.Mahesh Kumar

unread,
Dec 6, 2019, 8:51:58 AM12/6/19
to Ansible Project
I am receiving error.
can someone pls help me. 
code
---
- hosts: all
  gather_facts: yes
  vars:
   aws_region: us-east-1b
  tasks:
  - import_tasks: ../Global/aws.yml
    vars:
    - aws_env: "{{ aws_env }}"
    - region: "{{ aws_region }}"
    
  - name: EC2 Facts
    ec2_instance_info:
      aws_access_key: "{{ AWS_ACCESS_KEY_ID }}"
      aws_secret_key: "{{ AWS_SECRET_ACCESS_KEY }}"
      security_token: "{{ AWS_SESSION_TOKEN }}"
      region: "{{ aws_region }}"
      filters:
       "tag:Name": TimeZone
       "tag:Value": IST_TEST
    register: ec2
    
  - name: Kill EC2 Instance
    ec2:
      instance_ids: "{{ ec2.instances[0].id }}"
      state: "{{ state }}"
      region: "{{ lookup('env', 'AWS_REGION') }}"
      aws_access_key: "{{ lookup('env', 'AWS_ACCESS_KEY_ID') }}"
      aws_secret_key: "{{ lookup('env', 'AWS_SECRET_ACCESS_KEY') }}"
      security_token: "{{ AWS_SESSION_TOKEN }}"


getting below error,

ERROR! no action detected in task. This often indicates a misspelled module name, or incorrect module path.
11
12
The error appears to be in '/tmp/awx_47171_pw8uryez/project/EC2/Ec2 scheduled stop.yml': line 12, column 5, but may
13
be elsewhere in the file depending on the exact syntax problem.
14
15
The offending line appears to be:
16
17
18
- name: EC2 Facts
19
^ here
20

Vandana Thakur

unread,
Dec 6, 2019, 8:55:09 AM12/6/19
to ansible...@googlegroups.com
I think there is indentation issue  on that line . Also do check the module supprttingbthis action is present. 

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/eb114ac0-9898-4471-9fec-3e7a20800da6%40googlegroups.com.

P. Varsha

unread,
Dec 6, 2019, 9:17:40 AM12/6/19
to ansible...@googlegroups.com
give one space before - name:EC2 Facts

Dick Visser

unread,
Dec 6, 2019, 12:13:58 PM12/6/19
to ansible...@googlegroups.com
that module has just been introduced (or more accurate renamed) so it may be that your ansible is pre 2.9 and doesn’t know about it. 
If so upgrade, or use the old module name (facts instead of info)

--
Sent from a mobile device - please excuse the brevity, spelling and punctuation.

S.Mahesh Kumar

unread,
Dec 6, 2019, 12:36:55 PM12/6/19
to Ansible Project
Thanks 
To unsubscribe from this group and stop receiving emails from it, send an email to ansible...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages