I think there is indentation issue on that line . Also do check the module supprttingbthis action is present.
On Fri, 6 Dec 2019 at 19:22, S.Mahesh Kumar <[email protected]> wrote: > 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 > > -- > 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 [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/eb114ac0-9898-4471-9fec-3e7a20800da6%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/eb114ac0-9898-4471-9fec-3e7a20800da6%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CALJDb0n9_nX94zNLNDJJZZ-fJFJU_XJePtiA7yYXu57diewVBw%40mail.gmail.com.
