-
Notifications
You must be signed in to change notification settings - Fork 55
/
system.yml
74 lines (60 loc) · 1.96 KB
/
system.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
- name: Add cgroup for Memory limits to bootparams
lineinfile:
dest: /boot/cmdline.txt
regexp: '^(.*?)(\s*cgroup_enable=cpuset\s*)?$'
line: '\1 cgroup_enable=cpuset'
backrefs: true
state: present
- name: Add overlay filesystem module
lineinfile: dest=/etc/modules state=present line="overlay" insertafter="EOF"
- name: Load overlay module
modprobe: name=overlay state=present
- name: Setup profile
copy: src=docker_profile.sh dest=/etc/profile.d/docker.sh mode=0644
- name: Set timezone variables
copy:
content: "{{ timezone }}"
dest: /etc/timezone
owner: root
group: root
mode: 0644
backup: yes
- name: update timezone
command: dpkg-reconfigure --frontend noninteractive tzdata
- name: Add hosts
template: src=hosts dest=/etc/hosts
- stat: path=/etc/dhcp/dhclient-enter-hooks.d
register: dhclient_hooks
- name: Copy hosts to DHCP setup
template: src=hosts dest=/etc/dhcp
when: dhclient_hooks.stat.exists
- name: Add DHCP hook to copy etc hosts
copy: src=copy_hosts dest=/etc/dhcp/dhclient-enter-hooks.d/ mode=0755
- name: Set hostname
hostname: name="{{ name }}"
- name: Restart hostname
shell: "hostnamectl set-hostname {{ name }}"
- name: Check for ld-linux-armhf.so.3
stat: path=/lib/ld-linux-armhf.so.3
register: ld
- name: Link ld-linux-armhf.so.3 --> ld-linux.so.3
file:
src: /lib/ld-linux-armhf.so.3
dest: /lib/ld-linux.so.3
state: link
when: ld.stat.exists
# Needed only for hypriot
- stat: path=/boot/device-init.yaml
register: device_init_file
- name: Set hostname in boot configuration
lineinfile:
dest: /boot/device-init.yaml
regexp: '^(.*hostname:)\s*(.*?)\s*$'
line: '\1 {{ name }}'
backrefs: true
state: present
when: device_init_file.stat.exists
- name: Add useDns=no to /etc/ssh/sshd_config
lineinfile: dest=/etc/ssh/sshd_config state=present line="UseDNS no" insertafter="EOF"
- name: Restart hostname
shell: "hostnamectl set-hostname {{ name }}"