Role - kubeinit_prepare

Role Documentation

Please, refer to the kubeinit_prepare role official docs for further information.

Role Defaults

This section highlights all of the defaults and variables set within the “kubeinit_prepare” role.

# All variables intended for modification should be placed in this file.

# All variables within this role should have a prefix of "kubeinit_prepare_"
kubeinit_prepare_debug: '{{ (ansible_verbosity | int) >= 2 | bool }}'
kubeinit_prepare_hide_sensitive_logs: true

kubeinit_prepare_podman_dependencies:
- podman
- buildah
- skopeo
- netavark

Tasks files

This section highlights all the documentation available in the tasks files.

Task file: create_host_ssh_config.yml - Create an ssh config file for a list of hosts

Description:

This task has two params for the template task below
  - config_path      optional       default: '~/.ssh/config'
  - file_mode        optional       default: '0644'

and two passthrough params for the template itself
  - ssh_hosts        required       list of hosts
  - ssh_keytype      optional       default: 'rsa'
  - keypair_path     optional       default: '~/.ssh/id_' + ssh_keytype
  - include_paths    optional       default: empty list

The hosts are used as hostvars keys meeting the following expectations:

hostvars[host].ansible_host must be defined.

A stanza will be added to the ssh config pairing each host with the
corresponding ansible_host

hostvars[host].ssh_connection_address may be defined
hostvars[host].ssh_hostname may be defined

A stanza will be added to the ssh config pairing each ansible_host with either of
these, in the order listed. If neither is defined then the pairing will be omitted.

Examples:

- include_role:
    name: kubeinit.kubeinit.kubeinit_prepare
    tasks_from: create_host_ssh_config
  vars:
    ssh_hosts: "{{ groups['kubeinit_hypervisors'] }}"
    keypair_path: "{{ kubeinit_cluster_keypair_path }}"
    config_path: "{{ kubeinit_cluster_ssh_config }}"
    file_mode: '0644'

Molecule Scenarios

Molecule is being used to test the “kubeinit_prepare” role. The following section highlights the drivers in service and provides an example playbook showing how the role is leveraged.

Scenario: default

Driver: docker:
Example default playbook
- name: Converge
  hosts: all
  # roles:
  #   - role: "kubeinit_prepare"
  tasks:
  - name: Message for "kubeinit_prepare"
    ansible.builtin.debug:
      msg: Finishing molecule for "kubeinit_prepare"