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

New ssl provider: cloudflare-origin-ca #870

Closed
wants to merge 1 commit into from

Conversation

tangrufus
Copy link
Collaborator

@tangrufus tangrufus commented Aug 17, 2017

Usage:

vault_cloudflare_origin_ca_api_key: 'my_api_key'

wordpress_sites:
  example.com:
    site_hosts:
      - canonical: example.com
        redirects:
          - hi.example.com
          - bye.example.com
    ssl:
      enabled: true
      provider: cloudflare-origin-ca

This will generate and upload (to Cloudflare) a cert for example.com,hi.example.com,bye.example.com

This is Origin CA not Universal SSL

close #868

@partounian
Copy link
Contributor

Any update @swalkinshaw ?

@swalkinshaw
Copy link
Member

No, I'm undecided on this one. I don't know if Trellis should have a Cloudflare specific option like this built-in.

@partounian
Copy link
Contributor

No worries, really appreciate your updates through!

@tangrufus
Copy link
Collaborator Author

tangrufus commented Aug 25, 2017

perhaps publish it to ansible galaxy is a better idea

Question:
What is the best practice for ansible galaxy role to change Trellis's Nginx template (wordpress-site.conf.j2)?

@swalkinshaw
Copy link
Member

Good question, I think it would use Child templates.

Right now there's an https block. The new template would use that block and call {{ super() }} then just add the new certificate stuff after that.

tangrufus added a commit to typisttech/trellis-cloudflare-origin-ca that referenced this pull request Aug 29, 2017
tangrufus added a commit to typisttech/trellis-cloudflare-origin-ca that referenced this pull request Aug 29, 2017
tangrufus added a commit to typisttech/trellis-cloudflare-origin-ca that referenced this pull request Aug 29, 2017
tangrufus added a commit to typisttech/trellis-cloudflare-origin-ca that referenced this pull request Aug 29, 2017
tangrufus added a commit to typisttech/trellis-cloudflare-origin-ca that referenced this pull request Aug 29, 2017
tangrufus added a commit to typisttech/trellis-cloudflare-origin-ca that referenced this pull request Aug 29, 2017
tangrufus added a commit to typisttech/trellis-cloudflare-origin-ca that referenced this pull request Aug 29, 2017
tangrufus added a commit to typisttech/trellis-cloudflare-origin-ca that referenced this pull request Aug 29, 2017
@tangrufus
Copy link
Collaborator Author

@tangrufus tangrufus closed this Aug 29, 2017
@swalkinshaw
Copy link
Member

@tangrufus thanks, took a quick look at that and it looks great.

This is one of the first 3rd party roles like this so it was interesting to see how the implementation went. Most of it looks fairly straightforward. Other than the playbook hack 😔 .

Something like #830 might be able to help that.

@tangrufus
Copy link
Collaborator Author

Other than #830, we need better way for galaxy roles to override Nginx templates.

Telling users use templats in vendor doesn't feel right:

nginx_wordpress_site_conf: vendor/roles/TypistTech.trellis-cloudflare-origin-ca/templates/wordpress-site.conf.child

But it the only way I could think of.

Adding to includes.d/{{ item.key }}/ directory:
It doesn't get included for redirect domains..... :(

@swalkinshaw
Copy link
Member

Yeah I did notice that and thought it wasn't ideal either but honestly I'm not so sure how much it matters.

In any language with packages, it would be equivalent to include vendor/roles/TypistTech.trellis-cloudflare-origin-ca/templates/wordpress-site.conf.child which most languages would allow include TypistTech.trellis-cloudflare-origin-ca/templates/wordpress-site.conf.child. It's still coming from the same place /shrug

@tangrufus
Copy link
Collaborator Author

What to do when another galaxy role need to extend wordpress-site.conf.j2 as well?

@swalkinshaw
Copy link
Member

Good question. I'm just not sure we can reasonably expect a solution for that.

@tangrufus
Copy link
Collaborator Author

For current state of Trellis, would it be better to use regexp replace instead of jinja2 template override?

typisttech/trellis-cloudflare-origin-ca#8

@swalkinshaw
Copy link
Member

Up to you ultimately. Usually I wouldn't like regexp for things like this, but at least the template output is predictable since it's not a manually created file.

@tangrufus tangrufus deleted the ssl-cloudflare branch September 1, 2017 11:14
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.

Feature Request: New SSL provider CloudFlare Origin CA
3 participants