Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
75 lines (60 sloc) 1.96 KB
- 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 }}"
You can’t perform that action at this time.