Skip to content

Commit

Permalink
livemigration_user: use only livemigration_user variable
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
eroussy committed Apr 5, 2024
1 parent 605c2e5 commit 96b617e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions playbooks/cluster_setup_add_livemigration_user.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
4 changes: 2 additions & 2 deletions playbooks/deploy_vms_cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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) }}"
Expand Down

0 comments on commit 96b617e

Please sign in to comment.