Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions docs/user/certificates.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ foremanctl deploy --certificate-source=installer
After deployment, certificates are available at:

**Default Source:**
- CA Certificate: `/root/certificates/certs/ca.crt`
- Server Certificate: `/root/certificates/certs/<hostname>.crt`
- Client Certificate: `/root/certificates/certs/<hostname>-client.crt`
- CA Certificate: `/var/lib/foremanctl/certs/certs/ca.crt`
- Server Certificate: `/var/lib/foremanctl/certs/certs/<hostname>.crt`
- Client Certificate: `/var/lib/foremanctl/certs/certs/<hostname>-client.crt`

**Custom Server Source:**
- CA Certificate: `/root/certificates/certs/ca.crt` (internal CA)
Expand Down Expand Up @@ -234,10 +234,10 @@ The `certificate_checks` role uses `foreman-certificate-check` binary to validat

**Directory Structure:**
```
/root/certificates/
├── certs/ # Public certificates (ca.crt, server-ca.crt, ca-bundle.crt, *.crt)
├── private/ # Private keys and passwords (ca.key, ca.pwd, *.key)
└── requests/ # Certificate signing requests (*.csr)
/var/lib/foremanctl/certs/
├── certs/ # Public certificates
├── private/ # Private keys and passwords
└── requests/ # Certificate signing requests
```

**SANs and CNAMEs:**
Expand Down
2 changes: 1 addition & 1 deletion src/roles/certificates/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
certificates_source: default
certificates_ca: true
certificates_ca_directory: /root/certificates # Change this to /var/lib?
certificates_ca_directory: /var/lib/foremanctl/certs
certificates_ca_directory_keys: "{{ certificates_ca_directory }}/private"
certificates_ca_directory_certs: "{{ certificates_ca_directory }}/certs"
certificates_ca_directory_requests: "{{ certificates_ca_directory }}/requests"
Expand Down
2 changes: 1 addition & 1 deletion src/vars/default_certificates.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
certificates_ca_directory: /root/certificates
certificates_ca_directory: /var/lib/foremanctl/certs
ca_key_password: "{{ certificates_ca_directory }}/private/ca.pwd"
ca_certificate: "{{ certificates_ca_directory }}/certs/ca.crt"
ca_key: "{{ certificates_ca_directory }}/private/ca.key"
Expand Down
3 changes: 2 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ def client_fqdn(client_hostname):
def certificates(certificate_source, server_fqdn):
env = Environment(loader=FileSystemLoader("."), autoescape=select_autoescape())
template = env.get_template(f"./src/vars/{certificate_source}_certificates.yml")
context = {'ansible_facts': {'fqdn': server_fqdn}}
context = {'certificates_ca_directory': '/var/lib/foremanctl/certs',
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not needed after e645479

'ansible_facts': {'fqdn': server_fqdn}}
# we have vars that refer to other vars, so load them once and then re-render the template
context.update(yaml.safe_load(template.render(context)))
return yaml.safe_load(template.render(context))
Expand Down