[libvirt] [jenkins-ci PATCH 0/2] guests: Minor fixes and tweaks

1/2 is a bug fix, 2/2 a small improvement. Andrea Bolognani (2): guests: Reorder configuration steps for root authentication guests: Don't warn when bootstrapping package manager guests/tasks/base.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) -- 2.13.6

Key-based SSH authentication for root should be enabled before changing the password, because if that fails (for example because the user hasn't generated an SSH key pair yet) having changed the root password will result in subsequent 'lcitool prepare' runs failing to access the guest. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- guests/tasks/base.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/guests/tasks/base.yml b/guests/tasks/base.yml index b220bb0..acdcc11 100644 --- a/guests/tasks/base.yml +++ b/guests/tasks/base.yml @@ -96,18 +96,18 @@ hostname: name: '{{ inventory_hostname }}' -- name: Configure root password and shell - user: - name: root - password: '{{ lookup("file", lookup("env", "HOME") + "/.config/lcitool/.root-password.hash") }}' - shell: '{{ bash }}' - - name: Configure ssh access for the root user authorized_key: user: root key: '{{ lookup("file", lookup("env", "HOME") + "/.ssh/id_rsa.pub") }}' state: present +- name: Configure root password and shell + user: + name: root + password: '{{ lookup("file", lookup("env", "HOME") + "/.config/lcitool/.root-password.hash") }}' + shell: '{{ bash }}' + - name: Disable password authentication for the root user lineinfile: path: /etc/ssh/sshd_config -- 2.13.6

Ansible will try to get us to use the apt or dnf modules, but we can't really do that when we are bootstrapping said modules, so just silence the warning. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- guests/tasks/base.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/guests/tasks/base.yml b/guests/tasks/base.yml index acdcc11..6acd967 100644 --- a/guests/tasks/base.yml +++ b/guests/tasks/base.yml @@ -37,6 +37,7 @@ command: apt-get install -y python-apt args: creates: /usr/lib/python2*/*-packages/apt + warn: no when: - package_format == 'deb' @@ -44,6 +45,7 @@ command: dnf install -y python2-dnf args: creates: /usr/lib*/python2*/*-packages/dnf + warn: no when: - os_name == 'Fedora' -- 2.13.6

On Fri, Oct 20, 2017 at 01:31:17PM +0200, Andrea Bolognani wrote:
1/2 is a bug fix, 2/2 a small improvement.
Andrea Bolognani (2): guests: Reorder configuration steps for root authentication guests: Don't warn when bootstrapping package manager
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
participants (2)
-
Andrea Bolognani
-
Pavel Hrdina