<commit_before>---
- import_tasks: sync_kube_master_certs.yml
  when: inventory_hostname in groups['kube-master']

- import_tasks: sync_kube_node_certs.yml
  when: inventory_hostname in groups['k8s-cluster']

# Issue admin certs to kube-master hosts
- include_tasks: ../../../vault/tasks/shared/issue_cert.yml
  vars:
    issue_cert_common_name: "admin"
    issue_cert_copy_ca: "{{ item == kube_admin_certs_needed|first }}"
    issue_cert_file_group: "{{ kube_cert_group }}"
    issue_cert_file_owner: kube
    issue_cert_hosts: "{{ groups['kube-master'] }}"
    issue_cert_path: "{{ item }}"
    issue_cert_role: kube-master
    issue_cert_url: "{{ hostvars[groups.vault|first]['vault_leader_url'] }}"
    issue_cert_mount_path: "{{ kube_vault_mount_path }}"
  with_items: "{{ kube_admin_certs_needed|d([]) }}"
  when: inventory_hostname in groups['kube-master']

- name: gen_certs_vault | Set fact about certificate alt names
  set_fact:
    kube_cert_alt_names: >-
      {{
      groups['kube-master'] +
      ['kubernetes.default.svc.cluster.local', 'kubernetes.default.svc', 'kubernetes.default', 'kubernetes'] +
      ['localhost']
      }}
  run_once: true

- name: gen_certs_vault | Add external load balancer domain name to certificate alt names
  set_fact:
    kube_cert_alt_names: "{{ kube_cert_alt_names + [apiserver_loadbalancer_domain_name] }}"
  when: loadbalancer_apiserver is defined
  run_once: true<commit_msg>Adding cluster_name to api cert alt name for vault<commit_after>---
- import_tasks: sync_kube_master_certs.yml
  when: inventory_hostname in groups['kube-master']

- import_tasks: sync_kube_node_certs.yml
  when: inventory_hostname in groups['k8s-cluster']

# Issue admin certs to kube-master hosts
- include_tasks: ../../../vault/tasks/shared/issue_cert.yml
  vars:
    issue_cert_common_name: "admin"
    issue_cert_copy_ca: "{{ item == kube_admin_certs_needed|first }}"
    issue_cert_file_group: "{{ kube_cert_group }}"
    issue_cert_file_owner: kube
    issue_cert_hosts: "{{ groups['kube-master'] }}"
    issue_cert_path: "{{ item }}"
    issue_cert_role: kube-master
    issue_cert_url: "{{ hostvars[groups.vault|first]['vault_leader_url'] }}"
    issue_cert_mount_path: "{{ kube_vault_mount_path }}"
  with_items: "{{ kube_admin_certs_needed|d([]) }}"
  when: inventory_hostname in groups['kube-master']

- name: gen_certs_vault | Set fact about certificate alt names
  set_fact:
    kube_cert_alt_names: >-
      {{
      groups['kube-master'] +
      ['kubernetes.default.svc.'+cluster_name, 'kubernetes.default.svc', 'kubernetes.default', 'kubernetes'] +
      ['localhost']
      }}
  run_once: true

- name: gen_certs_vault | Add external load balancer domain name to certificate alt names
  set_fact:
    kube_cert_alt_names: "{{ kube_cert_alt_names + [apiserver_loadbalancer_domain_name] }}"
  when: loadbalancer_apiserver is defined
  run_once: true
{'fraction_non_alphanumeric': 0.12642487046632125, 'fraction_numerical': 0.000690846286701209, 'mean_word_length': 4.612403100775194, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5894526', 'n_tokens_mistral': 1041, 'n_tokens_neox': 1021, 'n_words': 181}