Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a README example with YAML magic for multiline strings #106

Merged
merged 1 commit into from
Mar 29, 2016

Conversation

wkielas
Copy link
Contributor

@wkielas wkielas commented Mar 25, 2016

This adds another example to the README which uses multiline strings.

I've spent some time searching how to achieve this for my long Nginx location blocks, so it could be helpful for others.

@jdauphant
Copy link
Owner

Oh thanks, I discover this new yaml, what's the difference with "|" ?

 nginx_sites:
        foo:
           - listen 443 ssl
           - server_name foo.example.com
           - set $myhost foo.example.com
           - |
             location / {
               proxy_set_header Host foo.example.com;
             }
          - |
             location ~ /v2/users/.+?/organizations {
               if ($request_method = PUT) {
                 set $myhost bar.example.com;
               }
               if ($request_method = DELETE) {
                 set $myhost bar.example.com;
               }
               proxy_set_header Host $myhost;
             }

@wkielas
Copy link
Contributor Author

wkielas commented Mar 25, 2016

It's pretty well explained here.

I used the > notation because it's the first one I've found and it looks okay in the config files.

@jdauphant
Copy link
Owner

I prefer recommends "|" , we will have better file output (it's well managed by the role, it's explain here : https://github.com/jdauphant/ansible-role-nginx/releases/tag/v1.2 ).
Is that ok for you to change it ?

@wkielas wkielas force-pushed the list_syntax_doc_improvements branch from 5d8d3e3 to 8471563 Compare March 29, 2016 09:56
@wkielas wkielas force-pushed the list_syntax_doc_improvements branch from 8471563 to c124841 Compare March 29, 2016 09:57
@wkielas
Copy link
Contributor Author

wkielas commented Mar 29, 2016

Sure, changed.

@jdauphant
Copy link
Owner

@wkielas Thanks !

@jdauphant jdauphant merged commit 54f228c into jdauphant:master Mar 29, 2016
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.

None yet

2 participants