IBM-Security / isam-ansible-roles

Ansible Custom Modules, Handlers and Tasks for ISAM. Requires "ibmsecurity" python package.
Apache License 2.0
24 stars 43 forks source link

add_oauth_definition YAML syntax error due to a tab #91

Closed kalemontes closed 5 years ago

kalemontes commented 5 years ago

Hi i found a small bug when using the add_oauth_definition role :

ERROR! Syntax Error while loading YAML.
  found character '\t' that cannot start any token

The error appears to have been in '/etc/ansible/roles/isam-ansible-roles/add_oauth_definition/tasks/main.yml': line 28, column 43, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

      tokenCharSet                                : "{{ add_oauth_definition_tokenCharSet }}"
      oidc                                        : "{{ add_oauth_definition_oidc }}"
                                          ^ here
There appears to be a tab character at the start of the line.

YAML does not use tabs for formatting. Tabs should be replaced with spaces.

For example:
    - name: update tooling
      vars:
        version: 1.2.3
#    ^--- there is a tab there.

Should be written as:
    - name: update tooling
      vars:
        version: 1.2.3
# ^--- all spaces here.
We could be wrong, but this one looks like it might be an issue with
missing quotes.  Always quote template expression brackets when they
start a value. For instance:

    with_items:
      - {{ foo }}

Should be written as:

    with_items:
      - "{{ foo }}"

After checkin that file there is infact a hidden tab in line https://github.com/IBM-Security/isam-ansible-roles/blob/c783e1c0cb776960f2f2ee8aa7bceeffeeeafde1/add_oauth_definition/tasks/main.yml#L28 as shown by the following screenshot :

image

ram-ibm commented 5 years ago

I made the fix. Thanks for catching this!