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 in Ansible by Laila
63 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: "************"

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

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 30 in Ansible by Mahir
378 views
+1 vote
1 answer
0 votes
1 answer
0 votes
1 answer
+1 vote
1 answer

Is it possible to append a large amount of text to a file using Ansible?

Here is concept which you can follow. blockinfile is ...READ MORE

answered Jul 30, 2018 in Ansible by Atul
• 10,240 points
3,010 views
0 votes
1 answer