summaryrefslogtreecommitdiff
path: root/initial-deploy.yml
diff options
context:
space:
mode:
Diffstat (limited to 'initial-deploy.yml')
-rw-r--r--initial-deploy.yml19
1 files changed, 19 insertions, 0 deletions
diff --git a/initial-deploy.yml b/initial-deploy.yml
new file mode 100644
index 0000000..8fa7330
--- /dev/null
+++ b/initial-deploy.yml
@@ -0,0 +1,19 @@
+- name: Setup Ansible user and authorized keys
+ gather_facts: false
+ hosts: new
+ tasks:
+ - name: Install sudo package
+ package:
+ name: "sudo"
+ state: "present"
+ - name: setup ansible user
+ user:
+ name: "ansible"
+ groups: "sudo"
+ password: "{{ new | password_hash('sha512') }}"
+ - name: Setup Authorized keys
+ authorized_key:
+ user: "ansible"
+ state: present
+ key: "{{ lookup('file', '~/.ssh/ansible.pub') }}"
+