summaryrefslogtreecommitdiff
path: root/initial-deploy.yml
blob: 8fa73302e2804794b17787fcf0724f1f231909b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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') }}"