Role - kubeinit_registry

Role Documentation

Welcome to the “kubeinit_registry” role documentation.

Role Defaults

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

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

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

kubeinit_registry_enabled: true

kubeinit_registry_user: registryusername
kubeinit_registry_password: registrypassword
kubeinit_registry_email: [email protected]
# The space after the first single quote is required, do not remove
# Something in Ansible appears to be recognizing this as valid Python,
# so it's getting transformed into a Python list and then serialized
# using Python's str(), which is why we end up with the single-quoted values.
kubeinit_registry_pullsecret: '  { "auths": {} }'

kubeinit_registry_required_packages_aux: "{% if ( kubeinit_inventory_cluster_distro\
  \ == 'rke' or kubeinit_inventory_cluster_distro == 'cdk' ) %} podman, python3, python3-dns,\
  \ jq, apache2-utils, skopeo {% else %} podman, python3, python3-dns, jq, httpd-tools,\
  \ skopeo {% endif %}"
kubeinit_registry_required_packages: "{{ kubeinit_registry_required_packages_aux.split(',')\
  \ }}"

kubeinit_registry_directory: /var/kubeinit/local_registry
kubeinit_registry_directory_auth: '{{ kubeinit_registry_directory }}/auth'
kubeinit_registry_directory_cert: '{{ kubeinit_registry_directory }}/certs'
kubeinit_registry_directory_data: '{{ kubeinit_registry_directory }}/data'

kubeinit_registry_port: 5000
kubeinit_registry_host: "{{ hostvars[ groups['all'] | map('regex_search','^.*service.*$')\
  \ | select('string') | list | first ].inventory_hostname }}"
kubeinit_registry_fqdn: '{{ kubeinit_registry_host }}.{{ kubeinit_inventory_cluster_name
  }}.{{ kubeinit_inventory_cluster_domain }}'
kubeinit_registry_fqdn_alt: registry.{{ kubeinit_inventory_cluster_name }}.{{ kubeinit_inventory_cluster_domain
  }}
kubeinit_registry_uri: '{{ kubeinit_registry_fqdn }}:{{ kubeinit_registry_port }}'

kubeinit_registry_auth_file: registry-auths.json
kubeinit_registry_pod_name: kubeinit-registry

kubeinit_registry_certificate_country: US
kubeinit_registry_certificate_state: MyState
kubeinit_registry_certificate_locality: MyCity
kubeinit_registry_certificate_organization: MyCompany
kubeinit_registry_certificate_organizational_unit: MyDepartment

Role Variables: main.yml

null
...

Molecule Scenarios

Molecule is being used to test the “kubeinit_registry” 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_registry"
  tasks:
  - name: Message for "kubeinit_registry"
    debug:
      msg: Finishing molecule for "kubeinit_registry"