From 96b617edf9854ed493f0c1ffede8dec8f9cade20 Mon Sep 17 00:00:00 2001 From: Erwann Roussy Date: Thu, 28 Mar 2024 13:24:29 +0100 Subject: [PATCH] livemigration_user: use only livemigration_user variable The livemigration user is now only defined by the livemigration_user variable. This simplifies the inventory. This commit also remove the default 'root' user for livemigration. Signed-off-by: Erwann Roussy --- playbooks/cluster_setup_add_livemigration_user.yaml | 5 ++--- playbooks/deploy_vms_cluster.yaml | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/playbooks/cluster_setup_add_livemigration_user.yaml b/playbooks/cluster_setup_add_livemigration_user.yaml index a93722269..9bc4743f1 100644 --- a/playbooks/cluster_setup_add_livemigration_user.yaml +++ b/playbooks/cluster_setup_add_livemigration_user.yaml @@ -1,4 +1,5 @@ # Copyright (C) 2022, RTE (http://www.rte-france.com) +# Copyright (C) 2024, SFL (https://savoirfairelinux.com) # SPDX-License-Identifier: Apache-2.0 # This playbook adds and configures the virtu user. This user is used by libvirt @@ -8,8 +9,6 @@ - name: Configure ssh keys between hosts hosts: hypervisors gather_facts: true - vars: - livemigration_user: "{{ livemigrationuser | default('virtu') }}" tasks: - block: - name: Create live migration user @@ -63,4 +62,4 @@ name: "{{ item }}" key: "{{ item }} {{ lookup('file','buffer/' + item + '-ssh_host_ed25519_key.pub') }}" with_items: "{{ groups['hypervisors'] }}" - when: create_livemigration_user is defined + when: livemigration_user is defined diff --git a/playbooks/deploy_vms_cluster.yaml b/playbooks/deploy_vms_cluster.yaml index e99ce2261..630fc4ad2 100644 --- a/playbooks/deploy_vms_cluster.yaml +++ b/playbooks/deploy_vms_cluster.yaml @@ -21,8 +21,8 @@ command: create system_image: /tmp/os_{{ item }}.qcow2 force: true - live_migration: "{{ livemigration | default(false) }}" - migration_user: "{{ livemigration_user | default('root') }}" + live_migration: "{{ livemigration_user is defined }}" + migration_user: "{{ livemigration_user | default(omit) }}" migrate_to_timeout: "{{ hostvars[item].migrate_to_timeout | default('') }}" enable: true pinned_host: "{{ hostvars[item].pinned_host | default(omit) }}"