CORD-1401 Don't overwrite existing keypair, CiaB PCU setup roles
Change-Id: Ia0fe60315ed09ba39634ed5c25e50e7bfd51d1ab
diff --git a/roles/maas-user-pubkey/tasks/main.yml b/roles/maas-user-pubkey/tasks/main.yml
new file mode 100644
index 0000000..5fb3492
--- /dev/null
+++ b/roles/maas-user-pubkey/tasks/main.yml
@@ -0,0 +1,14 @@
+---
+# roles/maas-user-pubkey/tasks/main.yml
+
+- name: Create maas user
+ user:
+ name: maas
+ groups: "{{ maas_groups }}"
+ state: present
+
+- name: Authorize generated key for maas user
+ authorized_key:
+ user: maas
+ key: "{{ lookup('file', pub_ssh_key_file_location+'/cord_rsa.pub') }}"
+ state: present