[libvirt-jenkins-ci PATCH 5/6] guests: Hand root password location over to Ansible

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Instead of hard-coding the location in the playbook, we hand it
over at runtime when calling ansible-playbook, ensuring better
separation of concerns.

Signed-off-by: Andrea Bolognani <abologna@xxxxxxxxxx>
---
 guests/lcitool        | 2 +-
 guests/tasks/base.yml | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/guests/lcitool b/guests/lcitool
index 018640b..1efe7e5 100755
--- a/guests/lcitool
+++ b/guests/lcitool
@@ -197,7 +197,7 @@ do_prepare() {
 
     load_config
 
-    EXTRA_VARS="flavor=$FLAVOR"
+    EXTRA_VARS="flavor=$FLAVOR root_password_file=$ROOT_HASH_FILE"
 
     ansible-playbook \
         --vault-password-file "$VAULT_PASS_FILE" \
diff --git a/guests/tasks/base.yml b/guests/tasks/base.yml
index b220bb0..8949632 100644
--- a/guests/tasks/base.yml
+++ b/guests/tasks/base.yml
@@ -99,7 +99,7 @@
 - name: Configure root password and shell
   user:
     name: root
-    password: '{{ lookup("file", lookup("env", "HOME") + "/.config/lcitool/.root-password.hash") }}'
+    password: '{{ lookup("file", root_password_file) }}'
     shell: '{{ bash }}'
 
 - name: Configure ssh access for the root user
-- 
2.13.6

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux