summaryrefslogtreecommitdiffstats
path: root/xci/playbooks/configure-localhost.yml
diff options
context:
space:
mode:
authorMarkos Chandras <mchandras@suse.de>2018-03-28 10:24:47 +0100
committerMarkos Chandras <mchandras@suse.de>2018-03-28 22:05:21 +0100
commite6b6001274cafea8374a06e8b17fb22fa20eb096 (patch)
tree4ee39c57aaf38f653f008f8b62859b72ef3bf3a8 /xci/playbooks/configure-localhost.yml
parent455ea6c732384de5616be9c8c5cb006ae38e6716 (diff)
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 <mchandras@suse.de>
Diffstat (limited to 'xci/playbooks/configure-localhost.yml')
-rw-r--r--xci/playbooks/configure-localhost.yml14
1 files changed, 14 insertions, 0 deletions
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: