-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path0.system_configuration.yml
More file actions
74 lines (59 loc) · 1.52 KB
/
0.system_configuration.yml
File metadata and controls
74 lines (59 loc) · 1.52 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
---
- name: "[system_configuration]"
hosts: localhost
become: yes
gather_facts: false
tasks:
- name: Set hostname -> {{ my_hostname }}
hostname:
name: "{{ my_hostname }}"
- name: Set timezone -> {{ my_timezone }}
timezone:
name: "{{ my_timezone }}"
- name: Set localisation files -> '{{ my_locale }}'
locale_gen:
name: "{{ my_locale }}"
state: present
- name: Copy /etc/hosts
template:
src: system_configuration/hosts.j2
dest: /etc/hosts
owner: root
group: root
mode: '0664'
- name: Change /etc/dhcpcd.conf
blockinfile:
path: /etc/dhcpcd.conf
block: |
interface eth0
static ip_address={{ my_ip_address }}/24
static routers={{ box_ip_address }}
static domain_name_servers={{ dns1 }} {{ dns2 }}
notify: restart network
- name: Enable sshd service
service:
name: sshd
state: started
enabled: yes
- name: Install missing packages
apt:
name: "{{ item }}"
loop:
- ca-certificates
- curl
- net-tools
loop_control:
label: "{{ item }}"
- name: Create a crontab job to update Raspbian
cron:
name: "OS auto updates"
special_time: weekly
job: "apt-get -y full-upgrade"
handlers:
- name: restart network
service:
name: "{{ item }}"
state: restarted
with_items:
- dhcpcd
- networking