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

Fix vhosts extra_parameters indentation #195

Merged

Conversation

paulgration
Copy link
Contributor

Uses the indent Jinja filter to ensure that all lines of the extra_parameters variable are indented to the same level (2 to match the rest of the vhosts template)

Example playbook snippet:

- name: Example play
  become: true
  vars:
    apache_vhosts:
      - servername: example.com
        extra_parameters: |
          Header always set Strict-Transport-Security "max-age=63072000; includeSubDomains; preload"
          Header always set X-Content-Type-Options: "nosniff"
          Header always set X-Frame-Options: "SAMEORIGIN"

Would previously produce this output:

<VirtualHost *:80>
  ServerName example.com

  Header always set Strict-Transport-Security "max-age=63072000; includeSubDomains; preload"
Header always set X-Content-Type-Options: "nosniff"
Header always set X-Frame-Options: "SAMEORIGIN"

</VirtualHost>

With this change the output is:

<VirtualHost *:80>
  ServerName example.com

  Header always set Strict-Transport-Security "max-age=63072000; includeSubDomains; preload"
  Header always set X-Content-Type-Options: "nosniff"
  Header always set X-Frame-Options: "SAMEORIGIN"

</VirtualHost>

I added first and indentfirst keyword arguments to cover all bases (indentfirst was renamed to first in Jinja 2.10).

@stale
Copy link

stale bot commented Nov 25, 2020

This pull request has been marked 'stale' due to lack of recent activity. If there is no further activity, the PR will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark pull requests as stale.

@stale stale bot added the stale label Nov 25, 2020
@stale
Copy link

stale bot commented Dec 25, 2020

This pull request has been closed due to inactivity. If you feel this is in error, please reopen the pull request or file a new PR with the relevant details.

@stale stale bot closed this Dec 25, 2020
@jpiron
Copy link
Contributor

jpiron commented Jul 28, 2021

The indentation issue is still here.
Is there anyway to reopen this PR ?

@paulgration
Copy link
Contributor Author

paulgration commented Jul 28, 2021

The indentation issue is still here.
Is there anyway to reopen this PR ?

Not that I can see - shame the stale bot closed it before review

@jpiron
Copy link
Contributor

jpiron commented Jul 29, 2021

Indeed, I can understand the usage of a stale bot for the issues but for MRs it discourages people from submitting !

@paulgration
Copy link
Contributor Author

@geerlingguy are you able to review?

@geerlingguy geerlingguy reopened this Aug 27, 2021
@stale
Copy link

stale bot commented Aug 27, 2021

This pull request is no longer marked for closure.

@stale stale bot removed the stale label Aug 27, 2021
@geerlingguy
Copy link
Owner

Letting tests run on it again. Sorry about that—issues like this are issues I do want to merge (they fix actual bugs/broken-ish functionality in the role), but sometimes they seemingly get lost in the barrage.

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

3 participants