-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.yml
45 lines (37 loc) · 858 Bytes
/
bootstrap.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
44
45
---
- hosts: all
become: true
pre_tasks:
- name: install updates (CentOS)
tags: always
dnf:
update_only: yes
update_cache: yes
when: ansible_distribution == "CentOS"
- name: install updates (Ubuntu)
tags: always
apt:
upgrade: dist
update_cache: yes
when: ansible_distribution == "Ubuntu"
- hosts: all
become: true
tasks:
- name: create vagrant user
tags: always
user:
name: vagrant
groups: root
- name: add ssh key for vagrant
tags: always
authorized_key:
user: vagrant
key: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDDFKXMIafzQFacLs0RyQoeTvjFrtR4R2FIlOsvQXOfg ansible"
- name: add sudoers file for vagrant
tags: always
copy:
src: sudoer_vagrant
dest: /etc/sudoers.d/vagrant
owner: root
group: root
mode: 0440