<commit_before>---
- name: certs | make sure the certificate directory exits
  file:
    path={{ kube_cert_dir }}
    state=directory
    mode=o-rwx
    group={{ kube_cert_group }}

- name: tokens | make sure the tokens directory exits
  file:
    path={{ kube_token_dir }}
    state=directory
    mode=o-rwx
    group={{ kube_cert_group }}

- include: gen_certs.yml
  run_once: true
  when: inventory_hostname == groups['kube-master'][0]

- include: gen_tokens.yml

# Sync certs between nodes
- user:
    name: '{{ansible_user_id}}'
    generate_ssh_key: yes
  delegate_to: "{{ groups['kube-master'][0] }}"
  run_once: yes

- name: 'get ssh keypair'
  slurp: path=~/.ssh/id_rsa.pub
  register: public_key<commit_msg>run_once only works if master[0] is first in inventory list of all nodes.<commit_after>---
- name: certs | make sure the certificate directory exits
  file:
    path={{ kube_cert_dir }}
    state=directory
    mode=o-rwx
    group={{ kube_cert_group }}

- name: tokens | make sure the tokens directory exits
  file:
    path={{ kube_token_dir }}
    state=directory
    mode=o-rwx
    group={{ kube_cert_group }}

- include: gen_certs.yml
  when: inventory_hostname == groups['kube-master'][0]

- include: gen_tokens.yml

# Sync certs between nodes
- user:
    name: '{{ansible_user_id}}'
    generate_ssh_key: yes
  delegate_to: "{{ groups['kube-master'][0] }}"
  run_once: yes

- name: 'get ssh keypair'
  slurp: path=~/.ssh/id_rsa.pub
  register: public_key
{'fraction_non_alphanumeric': 0.12999322951929587, 'fraction_numerical': 0.003385240352064997, 'mean_word_length': 3.590062111801242, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7544053', 'n_tokens_mistral': 539, 'n_tokens_neox': 534, 'n_words': 131}