-
Notifications
You must be signed in to change notification settings - Fork 32
Add custom server certificate support #462
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| --- | ||
| - name: Generate custom certificates for testing | ||
| hosts: | ||
| - quadlet | ||
| become: true | ||
| vars: | ||
| certificates_ca_directory: /root/custom-certificates | ||
| certificates_ca_password: "CUSTOMCA" | ||
| certificates_ca_subject: 'Custom Test CA' | ||
| certificates_hostnames: | ||
| - "{{ ansible_facts['fqdn'] }}" | ||
| roles: | ||
| - role: certificates |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,9 @@ | ||
| --- | ||
| variables: | ||
| certificate_source: | ||
| help: Where certificates are coming from. Currently default Ansible role or the foreman-installer. | ||
| certificates_source: | ||
| help: Where certificates are coming from. Currently default Ansible role, the foreman-installer, or custom server certificates. | ||
| parameter: --certificate-source | ||
| choices: | ||
| - default | ||
| - installer | ||
| - custom_server | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| obsah >= 1.8.0 | ||
| obsah >= 1.8.1 | ||
| requests | ||
| requests-oauthlib |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| --- | ||
| - name: Copy custom server certificate | ||
| ansible.builtin.copy: | ||
| src: "{{ certificates_custom_server_certificate }}" | ||
| dest: "{{ certificates_ca_directory_certs }}/{{ ansible_facts['fqdn'] }}.crt" | ||
| remote_src: true | ||
| mode: '0444' | ||
|
|
||
| - name: Copy custom server key | ||
| ansible.builtin.copy: | ||
| src: "{{ certificates_custom_server_key }}" | ||
| dest: "{{ certificates_ca_directory_keys }}/{{ ansible_facts['fqdn'] }}.key" | ||
| remote_src: true | ||
| mode: '0440' | ||
|
|
||
| - name: Copy custom server CA certificate | ||
| ansible.builtin.copy: | ||
| src: "{{ certificates_custom_server_ca_certificate }}" | ||
| dest: "{{ certificates_ca_directory_certs }}/server-ca.crt" | ||
| remote_src: true | ||
| mode: '0444' | ||
|
|
||
| - name: Create CA bundle with internal CA and custom server CA | ||
| ansible.builtin.assemble: | ||
| src: "{{ certificates_ca_directory_certs }}" | ||
| dest: "{{ certificates_ca_directory_certs }}/ca-bundle.crt" | ||
| regexp: '(ca|server-ca)\.crt$' | ||
| mode: '0444' |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need this option explicitly? Can't we use the other two options, and if certificates_custom_server* options are specified, they will take precedence over the default paths specified by certificate-source?
This will also address my concern about combining installer client certs with custom server ones.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do, for this design to work where the user does not have to persist the certificates used as input on disk. We need some indicator of the mode they are operating in. I'll update the PR description as this design has deviated since I first opened it.