-
Notifications
You must be signed in to change notification settings - Fork 2
/
deploy-user.yml
43 lines (39 loc) · 966 Bytes
/
deploy-user.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
---
- hosts: linux-servers
become: true
become_user: root
gather_facts: false
tasks:
- name: Criando usuario remoto
user:
name: remoto
comment: Usuario padrao de acesso remoto SSH
groups: wheel
shell: /bin/bash
password: $1$rn9Ymc7F$mklifBH7GuAOWGy06NfUm1
tags: user
- name: Setando chave ssh key
authorized_key:
user: remoto
state: present
key: "{{ lookup('file', 'remoto.pub') }}"
tags: ssh-key
- name: Copiando file sudoers
copy:
src: sudoers
dest: /etc/sudoers
owner: root
group: root
mode: 0444
tags: sudo
- name: Padrinozando senha de root
user:
name: root
password: $1$rn9Ymc7F$mklifBH7GuAOWGy06NfUm1
tags: user
- name: Setando chaves ssh key
authorized_key:
user: root
state: present
key: "{{ lookup('file', 'ansible.pub') }}"
tags: ssh-key