Skip to content

Fix quoting bug in redhat and ubuntu#26

Open
lawsontyler wants to merge 2 commits intocouchbaselabs:masterfrom
lawsontyler:master
Open

Fix quoting bug in redhat and ubuntu#26
lawsontyler wants to merge 2 commits intocouchbaselabs:masterfrom
lawsontyler:master

Conversation

@lawsontyler
Copy link

Ansible needs to be valid YAML first. By using double-quotes in the comparison, it looks like the YAML string is finished & has a bunch of trailing garbage, which causes this Ansible error:

TASK [ansible-couchbase-server : include] **************************************
fatal: [couchbase-host]: FAILED! => {"reason": "We were unable to read either as JSON nor YAML, these are the errors we got from each:\nJSON: Expecting value: line 1 column 1 (char 0)\n\nSyntax Error while loading YAML.\n  did not find expected key\n\nThe error appears to be in '/[REDACTED]/.ansible/roles/ansible-couchbase-server/tasks/install/redhat.yml': line 49, column 63, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n  yum:\n    name: \"couchbase-server{% if couchbase_server_edition == \"community\" %}-community{% endif %}-{{ couchbase_server_version }}\"\n                                                              ^ here\nWe could be wrong, but this one looks like it might be an issue with\nmissing quotes. Always quote template expression brackets when they\nstart a value. For instance:\n\n    with_items:\n      - {{ foo }}\n\nShould be written as:\n\n    with_items:\n      - \"{{ foo }}\"\n"}

Single quotes fix this issue & the install works as expected.

Tyler Lawson added 2 commits January 16, 2023 14:34
…eus' node_exporter

- Remove compression and max-ttl if it's not the enterprise server edition
- Don't include the eventing or analytics ramsize definitions if they're not enabled.  Causes an error.
- Change all the firewall stuff to loop over the ports in the variable instead of single tasks.
- Ensure that we create the directories.
  - This role installs couchbase, which creates the couchbase user...but the server won't start without the disk paths created with correct ownership.
  - Therefore, the paths can't effectively be created before or after the role...and must be done _in_ the role.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant