Ansible error ERROR Variables must be specified as a dictionary or a list of dictionaries

0 votes

I am trying to create an s3 bucket using ansible. The following is my playbook:

---
- hosts: localhost
  gather_facts: no
  connection: local
  vars_files:
   - aws-creds.yml
  vars:
    bucketname: shenllbucket01
  tasks:
    - name: To Create An S3 Bucket
      s3:
       aws_access_key: "{{ access_key }}"
       aws_secret_key: "{{ secret_key }}"
       bucket: "{{ bucketname }}"
       mode: create
Aug 26, 2019 in Ansible by Laila
6,981 views
Can you show me your variable file? The issue seems there as everything looks fine on your playbook.
cat aws-creds.yml
access_key:*********************
secret_key:*********

The syntax seems wrong. 

access_key: "**********"
secret_key: "************"

1 answer to this question.

0 votes
the correct syntax for the var file / vault is

aws_access_key: SECRETVWG72JTDHIFGK
aws_secret_key: OJMSECRETvTZSJlHtJnotXSEGces
answered Jun 2, 2020 by yehuda

Related Questions In Ansible

0 votes
1 answer

How do I get a list of all Ansible variables?

Ansible by default gathers facts about machines ...READ MORE

answered Jan 31, 2019 in Ansible by Mahir
5,996 views
+1 vote
1 answer
0 votes
1 answer
0 votes
1 answer

Error saying "ERROR: ec2_vpc_subnet is not a legal parameter of an Ansible Play"

ec2_vpc_subnet is support from Ansible version 2.0 and ...READ MORE

answered Feb 8, 2019 in Ansible by Dee
1,028 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP