From 5189fdfd939ea48459a28cffb1fb69df5d363a3c Mon Sep 17 00:00:00 2001 From: binary Date: Sun, 8 Nov 2020 21:07:40 +0100 Subject: Refactor inventory content --- inventory.yml | 11 +++++++---- playbooks/debug.yml | 8 ++------ roles/common/tasks/main.yml | 1 + 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/inventory.yml b/inventory.yml index 28fbe07..3cabf21 100644 --- a/inventory.yml +++ b/inventory.yml @@ -21,6 +21,7 @@ all: wget: "wget" figlet: "figlet" neovim: "neovim" + pip: "pip3" group: root: "root" @@ -53,11 +54,11 @@ all: vms: - { name: "vm0", iso: "alpine", memory: "2G", size: "4G", enabled: "true" } - { name: "vm1", iso: "alpine", memory: "2G", size: "4G", enabled: "true" } - - { name: "vm2", iso: "alpine", memory: "2G", size: "4G", enabled: "true" } - - { name: "vm3", iso: "alpine", memory: "2G", size: "4G", enabled: "true" } - - { name: "vm4", iso: "alpine", memory: "2G", size: "4G", enabled: "true" } - vm: + hypervisor: enabled: "true" + interface: "bnx0" + gateway: "192.168.5.1" + mask: "255.255.255.0" # SERVER for personnal file sync emb0: @@ -69,9 +70,11 @@ all: vm0: ansible_host: "vm0" + ip: { in: "", out: "192.168.5.60" } vm1: ansible_host: "vm1" + ip: { in: "", out: "192.168.5.61" } # --- diff --git a/playbooks/debug.yml b/playbooks/debug.yml index 432e317..c87d8aa 100644 --- a/playbooks/debug.yml +++ b/playbooks/debug.yml @@ -3,10 +3,6 @@ - name: Debug hosts: all tasks: - - name: A - debug: - var: ansible_facts["distribution"] | lower - - name: G - debug: - var: groups["all"] + - debug: + var: hostvars[ansible_host] diff --git a/roles/common/tasks/main.yml b/roles/common/tasks/main.yml index 28bf411..cc959d9 100644 --- a/roles/common/tasks/main.yml +++ b/roles/common/tasks/main.yml @@ -15,6 +15,7 @@ - "{{ packages.wget }}" - "{{ packages.figlet }}" - "{{ packages.neovim }}" + - "{{ packages.pip }}" ignore_errors: yes -- cgit v1.2.3