-
Notifications
You must be signed in to change notification settings - Fork 3
/
before_roles_site.yml
61 lines (47 loc) · 1.1 KB
/
before_roles_site.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
46
47
48
49
50
51
52
53
54
55
56
57
58
---
- hosts: all
become: true
pre_tasks:
# name, status and update_cache ar all options for apt
- name: update repo cache
tags: always
apt:
update_cache: yes
changed_when: false
when: ansible_distribution in ["Debian", "Ubuntu"]
#user stuff
- hosts: all
become: true
tasks:
- name: add ssh key for simone
tags: always
authorized_key:
user: simone
key: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHEJgRcqFAbcKZHoQ7roda5/au2mYM1AzaBcpGo/ZN9e ansible"
# install packages
- hosts: desktop
become: true
tasks:
- name: copy default html file
tags: apache
copy:
src: default_site.html
dest: /home/pi/index.html
owner: root
group: root
mode: 0644
- name: change body line in html file
tags: apache
lineinfile:
path: /home/pi/change.txt
regexp: '^Now'
line: Ansible is can be awesome
# install packages
- name: install package
tags: debian, ubuntu, git, unzip
package:
name:
- git
- unzip
state: latest
when: ansible_distribution in ["Debian", "Ubuntu"]