Skip to content
This repository has been archived by the owner on Apr 25, 2020. It is now read-only.

ansible syntax error - yaml #36

Open
TheSycamore opened this issue May 12, 2018 · 1 comment
Open

ansible syntax error - yaml #36

TheSycamore opened this issue May 12, 2018 · 1 comment

Comments

@TheSycamore
Copy link

Firstly, thank you for creating and maintaining all the ansible roles that you do! You are doing a great job.
I have posted the error over on stackoverflow: https://stackoverflow.com/questions/50305706/ansible-syntax-error-yaml-ansible-galaxy-role

I am trying to use the jdauphant.ssl-certs role from the ansible-galaxy. I am copying the example from their README (last example at bottom of page) exactly but I receive an syntax error message.

This is my playbook.yml file:

---
- name: Web01
  hosts: all
  become: yes

  gather_facts: true

  roles:
    - common
    - jdauphant.ssl-certs
      ssl_certs_generate_dh_param: true
    - role: jdauphant.nginx
      nginx_configs:
        ssl:
              - ssl_certificate_key {{ssl_certs_privkey_path}}
              - ssl_certificate     {{ssl_certs_cert_path}}
              - ssl_dhparam         {{ssl_certs_dhparam_path}}
      nginx_sites:
        default:
              - listen 443 ssl
              - server_name _
              - root "/usr/share/nginx/html"
              - index index.html

Here is the error message I receive:

ERROR! Syntax Error while loading YAML.
  mapping values are not allowed in this context

The error appears to have been in '/home/blah/example/provisioning/development.yml': line 11, column 34, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

    - jdauphant.ssl-certs
      ssl_certs_generate_dh_param: true
                                 ^ here

Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.
@TheSycamore
Copy link
Author

TheSycamore commented May 12, 2018

Ah, I fixed it prepending "role: " before the name of this galaxy role:

  roles:
    - common
    - jdauphant.ssl-certs
      ssl_certs_generate_dh_param: true

To:


  roles:
    - common
    - role: jdauphant.ssl-certs
      ssl_certs_generate_dh_param: true

Maybe update the documentation to add "role: " in the last example from this page:
https://github.com/jdauphant/ansible-role-ssl-certs

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant