HenryGP / om_ansible

Minimalistic, disposable Ops Manager environment with Ansible
19 stars 17 forks source link

X.509 certificates in `/certs/` directory of n1, n2, n3 does not contain O / OU / DC attributes #81

Closed Airgunster closed 3 years ago

Airgunster commented 3 years ago

This is required for MongoDB Server when you run it with clusterAuthMode: x509,

The Distinguished Name (DN), found in the member certificate’s subject, must specify a non-empty value for at least one of the following attributes: Organization (O), the Organizational Unit (OU) or the Domain Component (DC).

emisca commented 3 years ago
$ git diff tasks/ssl-creation.yaml
diff --git a/tasks/ssl-creation.yaml b/tasks/ssl-creation.yaml
index 1fca369..a08b987 100644
--- a/tasks/ssl-creation.yaml
+++ b/tasks/ssl-creation.yaml
@@ -15,7 +15,9 @@
   openssl_csr:
     path: /root/files/ssl/{{ item }}_client.csr
     privatekey_path: /root/files/ssl/{{ item }}.key
-    common_name: "{{ item }}"
+    common_name: "{{ item }}-clientcert"
+    organization_name: omansible
+    organizational_unit_name: clients
     subject_alt_name: "DNS:{{ item }},DNS:{{ item }}.omansible.int"
     extended_key_usage: clientAuth
   with_items:
@@ -39,6 +41,8 @@
     path: /root/files/ssl/{{ item }}_server.csr
     privatekey_path: /root/files/ssl/{{ item }}.key
     common_name: "{{ item }}"
+    organization_name: omansible
+    organizational_unit_name: servers
     subject_alt_name: "DNS:{{ item }},DNS:{{ item }}.omansible.int"
     extended_key_usage: serverAuth
   with_items:
@@ -55,6 +59,8 @@
     path: /root/files/ssl/{{ item }}_internal.csr
     privatekey_path: /root/files/ssl/{{ item }}.key
     common_name: "{{ item }}"
+    organization_name: omansible
+    organizational_unit_name: internal
     subject_alt_name: "DNS:{{ item }},DNS:{{ item }}.omansible.int"
     extended_key_usage:
       - serverAuth

This patch fixes this.