Usage in System Test

System test server need Zprem repo for automated setup

This repository houses Ansible automation code designed to streamline the setup of provider keys, Kubernetes (K8s) clusters, Rancher & Grafana. It serves as a critical resource utilized by the system test server to automate these essential tasks.

The Ansible scripts within the repository are configured to handle the provisioning of provider keys securely.

Moreover, the Ansible automation in this repository extends to the orchestration of K8s clusters. It automates the deployment, configuration, and management of K8s clusters, making it easier for system test servers to create and manage these environments consistently.

ZPREM main.yaml FOR SYSTEM TEST -

Below attached is the main.yaml used for the system test server configuration.

  • For Kubernetes configuration internally it is using Kubespray so that on Hetzner dedicated servers we can have a k8s cluster in running state.

- hosts: all
  tasks: []

- name: Setup k8s on remote server
  hosts: localhost
  become: false
  vars_files:
    - input.yaml
  tasks:
    - name: Create Inventory
      include_role:
        name: create-inventory

    - name: Clone Kubespray
      include_role:
        name: clone-kubespray

    - name: install helm on remote server
      include_role:
        name: tools

- name: fetch kubeconfig
  hosts: kubespray
  gather_facts: false
  vars_files:
    - input.yaml
  tasks:
    - name: fetch-kubeconfig from remote server
      include_role:
        name: fetch-kubeconfig

    - name: install helm on remote server
      include_role:
        name: tools

- name: Setup 0prem
  hosts: localhost
  become: false
#  vars:
#    ansible_python_interpreter: /usr/bin/python3
  vars_files:
    - input.yaml
    - kubeconfig.conf
    - aws-credentials.yaml
  tasks:
    # - set_fact:
    #     zchain_ranc_string: "{{ lookup('password', '/dev/null chars=ascii_lowercase,digits length=13') }}"
    # - set_fact:
    #     zchain_graf_string: "{{ lookup('password', '/dev/null chars=ascii_lowercase,digits length=13') }}"

    - name: label nodes
      include_role:
        name: label-nodes

    - name: Map DNS
      include_role:
        name: dns-mapping

    - name: Create {{ cluster }} namespace and regcred
      include_role:
        name: secret

    - name: Launch openebs
      include_role:
        name: openebs

    - name: Launch helm
      include_role:
        name: helm

    - name: Launch LoadBalancer
      include_role:
        name: loadbalancer

    - name: Launch cert-manager
      include_role:
        name: cert-manager

    - name: Launch grafana
      include_role:
        name: grafana

    - name: Launch rancher
      include_role:
        name: rancher

    - name: Launch Keygen and create configmap
      include_role:
        name: Keygen

    - name: Launch magicBlock and create configmap
      include_role:
        name: magicBlock

    - name: Update Rancher Password
      include_role:
        name: rancherpassword

    - name: Update Grafana Dashboards
      include_role:
        name: GrafanaDashboard

Run the Ansible Playbook

Your current directory should be ~/0ansible :

ansible-playbook main.yaml

if you want to check broader logs then run :

ansible-playbook main.yaml -v

By integrating Ansible automation, the system test server can efficiently and reliably handle the complex tasks of setting up provider keys and K8s clusters, thereby contributing to a streamlined and automated infrastructure deployment process.

  • Check Grafana doc for monitoring & logging.

  • Check Rancher doc for k8s Management.

Last updated