From e6b6001274cafea8374a06e8b17fb22fa20eb096 Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Wed, 28 Mar 2018 10:24:47 +0100 Subject: xci: Use proper Ansible modules to manage SSH keys We can use the 'user', 'slurp' and 'authorized_key' modules to manage the various SSH configurations across the hosts instead of using command line tools. Change-Id: I2dde4d584fc336e267868607d5a58f5ee2c1feed Signed-off-by: Markos Chandras --- xci/playbooks/configure-localhost.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'xci/playbooks') diff --git a/xci/playbooks/configure-localhost.yml b/xci/playbooks/configure-localhost.yml index f64400e3..1f010528 100644 --- a/xci/playbooks/configure-localhost.yml +++ b/xci/playbooks/configure-localhost.yml @@ -99,6 +99,20 @@ when: - installer_type == "osa" + - name: Configure SSH key for local user + user: + name: "{{ ansible_env.USER }}" + createhome: yes + home: "/home/{{ ansible_env.USER }}" + move_home: yes + shell: /bin/bash + generate_ssh_key: yes + ssh_key_bits: 2048 + ssh_key_comment: xci + ssh_key_type: rsa + ssh_key_file: .ssh/id_rsa + state: present + - name: Dump XCI execution environment to a file shell: env > "{{ xci_path }}/.cache/xci.env" args: -- cgit 1.2.3-korg