ansible-personal/roles/common/tasks/main.yml
Alan Orth 5f656285c0
roles/common: Add a dedicated playbook for ntp tasks
Hosts with systemd should use its NTP client and explicitly remove
the `ntp` packages. Hosts with older init systems should use `ntp`.
2016-08-25 14:19:51 +03:00

43 lines
1.2 KiB
YAML

---
#- name: Add hostname to /etc/hosts
# lineinfile: dest=/etc/hosts insertafter=^127.0.0.1 line='127.0.1.1 {{ inventory_hostname }}'
# tags: hostname
- name: Set timezone
when: timezone is defined
command: /usr/bin/timedatectl set-timezone {{ timezone }}
tags: timezone
- include: ntp.yml
tags: ntp
- include: packages_{{ ansible_distribution }}.yml
tags: packages
- include: iptables_{{ ansible_distribution }}.yml
tags: firewall
- include: sshd.yml
tags: sshd
# containers identify as virtualization hosts, which makes this tricky, because we have actual Debian VM hosts!
- name: Reconfigure /etc/sysctl.conf
when: ansible_virtualization_role != 'host'
template: src=sysctl_{{ ansible_distribution }}.j2 dest=/etc/sysctl.conf owner=root group=root mode=0644
notify:
- reload sysctl
tags: sysctl
- name: Reconfigure /etc/rc.local
when: ansible_distribution == 'Ubuntu'
template: src=rc.local_Ubuntu.j2 dest=/etc/rc.local owner=root group=root mode=0755
- name: Set I/O scheduler
template: src=etc/udev/rules.d/60-scheduler.rules.j2 dest=/etc/udev/rules.d/60-scheduler.rules owner=root group=root mode=0644
tags: udev
- include: ssh-keys.yml
tags: ssh-keys
# vim: set sw=2 ts=2: