-
Notifications
You must be signed in to change notification settings - Fork 23
Pulp tls update #1743
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
Open
jackhodgkiss
wants to merge
2
commits into
stackhpc/2025.1
Choose a base branch
from
pulp-tls-update
base: stackhpc/2025.1
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+146
−3
Open
Pulp tls update #1743
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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,47 @@ | ||
| --- | ||
| - name: Install certificate authorities and update trust | ||
| hosts: overcloud:seed:seed-hypervisor | ||
| # Avoid using facts because this may be used as a pre overcloud host | ||
| # configure hook, and we don't want to populate the fact cache (if one is in | ||
| # use) with the bootstrap user's context. | ||
| gather_facts: false | ||
| tags: | ||
| - install-ca | ||
| vars: | ||
| ansible_user: "{{ bootstrap_user }}" | ||
| # We can't assume that a virtualenv exists at this point, so use the system | ||
| # python interpreter. | ||
| ansible_python_interpreter: /usr/bin/python3 | ||
| # Work around no known_hosts entry on first boot. | ||
| ansible_ssh_common_args: -o StrictHostKeyChecking=no | ||
| # Don't assume facts are present. | ||
| os_family: "{{ ansible_facts.os_family | default('Debian' if os_distribution == 'ubuntu' else 'RedHat') }}" | ||
jackhodgkiss marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| become: true | ||
| tasks: | ||
| - name: Install certificate authorities on RedHat based distributions | ||
| when: os_family == 'RedHat' | ||
| block: | ||
| - name: Copy certificate authorities on RedHat family systems (Rocky, RHEL, CentOS) | ||
| ansible.builtin.copy: | ||
| src: "{{ kayobe_env_config_path }}/openbao/{{ item }}.pem" | ||
| dest: "/etc/pki/ca-trust/source/anchors/{{ item }}.crt" | ||
| mode: "0644" | ||
| loop: | ||
| - "OS-TLS-ROOT" | ||
|
|
||
| - name: Update CA trust on RedHat family systems | ||
| ansible.builtin.command: "update-ca-trust" | ||
|
|
||
| - name: Install certificate authorities on Debian based distributions | ||
| when: os_family == 'Debian' | ||
| block: | ||
| - name: Copy certificate authorities on Debian family systems (Ubuntu, Debian) | ||
| ansible.builtin.copy: | ||
| src: "{{ kayobe_env_config_path }}/openbao/{{ item }}.pem" | ||
| dest: "/usr/local/share/ca-certificates/{{ item }}.crt" | ||
| mode: "0644" | ||
| loop: | ||
| - "OS-TLS-ROOT" | ||
|
|
||
| - name: Update CA trust on Debian family systems | ||
| ansible.builtin.command: "update-ca-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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| --- | ||
| - name: Generate certificates | ||
| hosts: seed | ||
| run_once: true | ||
| vars: | ||
| openbao_api_addr: http://127.0.0.1:8200 | ||
| openbao_intermediate_ca_name: OS-TLS-INT | ||
| tasks: | ||
jackhodgkiss marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - name: Assert that stackhpc_ca_secret_store is 'openbao' | ||
| ansible.builtin.assert: | ||
| that: | ||
| - stackhpc_ca_secret_store == "openbao" | ||
| fail_msg: "stackhpc_ca_secret_store must be 'openbao'" | ||
|
|
||
| - name: Include OpenBao keys | ||
| ansible.builtin.include_vars: | ||
| file: "{{ kayobe_env_config_path }}/openbao/seed-openbao-keys.json" | ||
| name: openbao_keys | ||
|
|
||
| - name: Issue Pulp certificate | ||
| hashivault_pki_cert_issue: # noqa: fqcn | ||
| url: "{{ openbao_api_addr }}" | ||
| ca_cert: "{{ '/etc/pki/tls/certs/ca-bundle.crt' if ansible_facts.os_family == 'RedHat' else '/usr/local/share/ca-certificates/OS-TLS-ROOT.crt' }}" | ||
| token: "{{ openbao_keys.root_token }}" | ||
| mount_point: "{{ openbao_intermediate_ca_name }}" | ||
| role: "{{ overcloud_openbao_pki_default_role_name }}" | ||
| common_name: "{{ inventory_hostname }}" | ||
| extra_params: | ||
| ip_sans: "{{ admin_oc_net_name | net_ip(inventory_hostname=groups['seed'][0]) }}" | ||
| register: pulp_certificate | ||
|
|
||
| - name: Ensure Pulp certificates directory exists | ||
| ansible.builtin.file: | ||
| path: "{{ kayobe_env_config_path }}/pulp/certificates" | ||
| state: directory | ||
| delegate_to: localhost | ||
|
|
||
| - name: Write certificate to file | ||
| no_log: true | ||
| ansible.builtin.copy: | ||
| dest: "{{ kayobe_env_config_path }}/pulp/certificates/pulp.crt" | ||
| content: | | ||
| {{ pulp_certificate.data.certificate }} | ||
| {{ pulp_certificate.data.issuing_ca }} | ||
| mode: "0600" | ||
| delegate_to: localhost | ||
|
|
||
| - name: Write key to file | ||
| no_log: true | ||
| ansible.builtin.copy: | ||
| dest: "{{ kayobe_env_config_path }}/pulp/certificates/pulp.key" | ||
| content: | | ||
| {{ pulp_certificate.data.private_key }} | ||
| mode: "0600" | ||
| delegate_to: localhost | ||
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,5 @@ | ||
| --- | ||
| features: | ||
| - | | ||
| Add playbooks and configuration to enable the easy deployment of Pulp with | ||
| TLS support in combination with certificates generated via OpenBao. |
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.
Uh oh!
There was an error while loading. Please reload this page.