Commit 201484fe authored by Sergio Gimenez's avatar Sergio Gimenez
Browse files

docs(ansible): simplify Homer dashboard and service playbook usage

parent 450fb70c
Loading
Loading
Loading
Loading
+0 −78
Original line number Diff line number Diff line
---
{% set current_host_name = inventory_hostname %}
{% set current_host_ip = external_host_ip | default(host_ip) | default(ansible_host) | default("HOST_IP") %}
{% set peer_host_name = none %}
{% set peer_host_ip = none %}
{% set has_peer_platform = false %}
{% set show_lite2edge = edgecloud_platform | default('none') == 'lite2edge' %}
{% set show_i2edge = edgecloud_platform | default('none') == 'i2edge' %}
{% if groups['op1_nodes'] is defined and groups['op2_nodes'] is defined %}
{% if inventory_hostname in groups['op1_nodes'] %}
{% set peer_host_name = groups['op2_nodes'][0] %}
{% elif inventory_hostname in groups['op2_nodes'] %}
{% set peer_host_name = groups['op1_nodes'][0] %}
{% endif %}
{% if peer_host_name in hostvars %}
{% set peer_host_ip = hostvars[peer_host_name].external_host_ip | default(hostvars[peer_host_name].host_ip) | default(hostvars[peer_host_name].ansible_host) | default("HOST_IP") %}
{% set has_peer_platform = true %}
{% endif %}
{% endif %}
title: "{{ homer_title }}"
subtitle: "{{ homer_subtitle }} · {{ current_host_name }}"
logo: "{{ homer_logo }}"
@@ -107,67 +93,3 @@ services:
        url: "http://{{ current_host_ip }}:{{ i2edge_nodeport | default(30769) }}/docs"
        target: "_blank"
{% endif %}

{% if has_peer_platform %}
  - name: "Peer Operator Platform ({{ peer_host_name }})"
    icon: "fas fa-server"
    items:
      - name: "Federation Manager"
        logo: "assets/tools/sample.png"
        subtitle: "{{ peer_host_name }} · Manage federation"
        tag: "app"
        url: "http://{{ peer_host_ip }}:{{ federation_manager_local.nodeport | default(30989) }}"
        target: "_blank"
      - name: "Keycloak"
        logo: "assets/tools/sample.png"
        subtitle: "{{ peer_host_name }} · Identity and access"
        tag: "auth"
        url: "http://{{ peer_host_ip }}:{{ federation_manager_local.keycloak_nodeport | default(30082) }}"
        target: "_blank"
      - name: "SRM"
        logo: "assets/tools/sample.png"
        subtitle: "{{ peer_host_name }} · Service Resource Manager"
        tag: "oop"
        url: "http://{{ peer_host_ip }}:{{ srm_nodeport | default(32415) }}/srm/1.0.0/ui/"
        target: "_blank"
      - name: "OEG"
        logo: "assets/tools/sample.png"
        subtitle: "{{ peer_host_name }} · Open Exposure Gateway"
        tag: "oop"
        url: "http://{{ peer_host_ip }}:{{ oeg_nodeport | default(32263) }}/oeg/1.0.0/docs/"
        target: "_blank"
      - name: "Artefact Manager"
        logo: "assets/tools/sample.png"
        subtitle: "{{ peer_host_name }} · Manage artefacts"
        tag: "app"
        url: "http://{{ peer_host_ip }}:{{ artefact_manager_nodeport | default(30080) }}/docs"
        target: "_blank"
      - name: "Homer"
        logo: "assets/tools/sample.png"
        subtitle: "{{ peer_host_name }} · Dashboard"
        tag: "infra"
        url: "http://{{ peer_host_ip }}:{{ homer_nodeport }}"
        target: "_blank"
      - name: "Zot"
        logo: "assets/tools/sample.png"
        subtitle: "{{ peer_host_name }} · Container registry"
        tag: "infra"
        url: "http://{{ peer_host_ip }}:{{ zot_http_nodeport }}"
        target: "_blank"
{% if show_lite2edge %}
      - name: "Lite2Edge"
        logo: "assets/tools/sample.png"
        subtitle: "{{ peer_host_name }} · Edge platform"
        tag: "edge"
        url: "http://{{ peer_host_ip }}:{{ lite2edge_nodeport | default(30081) }}/docs"
        target: "_blank"
{% endif %}
{% if show_i2edge %}
      - name: "i2Edge"
        logo: "assets/tools/sample.png"
        subtitle: "{{ peer_host_name }} · Edge platform"
        tag: "edge"
        url: "http://{{ peer_host_ip }}:{{ i2edge_nodeport | default(30769) }}/docs"
        target: "_blank"
{% endif %}
{% endif %}
+42 −0
Original line number Diff line number Diff line
@@ -39,6 +39,48 @@ Use this for one complete Operator Platform on one host.
ansible-playbook playbooks/scenarios/full_oop/deploy.yml --limit openop_3
```

## Deploy, redeploy, or undeploy one service

Use tool playbooks under `ansible/playbooks/tools/<service>/`.

Examples:

- deploy or reconcile Homer on both sides

```bash
ansible-playbook playbooks/tools/homer/deploy.yml -e target_hosts=openop_2,openop_3
```

- undeploy Homer on both sides of `dual_oop`

```bash
ansible-playbook playbooks/tools/homer/undeploy.yml -e target_hosts=openop_2,openop_3
```

- undeploy Homer only on OP1

```bash
ansible-playbook playbooks/tools/homer/undeploy.yml -e target_hosts=openop_3
```

- deploy or update SRM only on both sides, keeping custom image tag

```bash
ansible-playbook playbooks/tools/srm/deploy.yml \
  -e target_hosts=openop_2,openop_3 \
  -e srm_controller_image_tag=feature-srm-fm-integration-srmfix2-fb67c92
```

Notes:

- available tool playbooks include: `homer`, `srm`, `oeg`, `federation-manager`, `artefact-manager`, `zot`, `lite2edge`, `i2edge`
- use `-e target_hosts=openop_3` or `-e target_hosts=openop_2` for one side only
- use `-e target_hosts=openop_2,openop_3` to update both sides in `dual_oop`
- `/deploy.yml` is idempotent: if nothing changed, Ansible usually reports `ok` and does not restart or recreate service
- to apply changed templates, image tags, manifests, or vars, rerun same tool `/deploy.yml` command with those updated inputs
- tool playbooks use inventory host variables, including remote kubeconfig paths and filenames
- if you want to use scenario playbooks instead, `--tags <service>` works for deploy/reconcile, but dedicated tool `undeploy.yml` is clearer for removal

## Where kubeconfigs go

For remote deployments, playbooks fetch kubeconfigs locally to:
+16 −0
Original line number Diff line number Diff line
@@ -90,6 +90,22 @@ Single-host complete platform:
ansible-playbook playbooks/scenarios/full_oop/deploy.yml --limit openop_3
```

Apply one service only:

```bash
ansible-playbook playbooks/tools/homer/deploy.yml -e target_hosts=openop_2,openop_3
```

Undeploy one service only:

```bash
ansible-playbook playbooks/tools/homer/undeploy.yml -e target_hosts=openop_2,openop_3
```

If nothing changed, rerunning tool `/deploy.yml` is usually a no-op.

More single-service examples: `docs/deployment.md`.

## 6. Verify the result

For remote deployments, kubeconfigs are fetched locally to: