From 04d05a4e8b2b7d115bed54fc3b57218c81c01b5e Mon Sep 17 00:00:00 2001 From: Sandwich Date: Wed, 30 Oct 2024 16:58:22 +0100 Subject: [PATCH] Move hypervisor and disk variable from main playbook --- inventory_example.yml | 3 +++ main.yml | 18 ++---------------- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/inventory_example.yml b/inventory_example.yml index b34f5e0..01db918 100644 --- a/inventory_example.yml +++ b/inventory_example.yml @@ -1,4 +1,7 @@ all: + vars: + hypervisor: 'proxmox' + install_drive: '/dev/sda' children: promox-kvm: hosts: diff --git a/main.yml b/main.yml index 00263ff..e7c2c27 100644 --- a/main.yml +++ b/main.yml @@ -19,24 +19,10 @@ prompt: | What is your root password? confirm: true - - - name: hypervisor - prompt: | - Select an Hypervisor: - - libvirt - - proxmox - - vmware - private: false - default: proxmox - - - name: install_drive - prompt: | - "Enter the drive to install the system (default: /dev/sda)" - confirm: true - private: false - default: /dev/sda vars_files: vars.yml vars: + hypervisor: "{{ hypervisor }} | default('vmware')" + install_drive: "{{ install_drive }} | default('/dev/sda')" ansible_user: "{{ user_name }}" ansible_password: "{{ user_password }}" ansible_become_password: "{{ user_password }}"