Skip to content
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
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: dest=/etc/profile.d/ mode=0644
- name: Set timezone variables
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
stat: path=/lib/
register: ld
- name: Link -->
src: /lib/
dest: /lib/
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
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.