ansible-personal/roles/common/tasks/main.yml

44 lines
1.2 KiB
YAML
Raw Normal View History

---
# not needed on OpenStack images...
#- name: Set hostname
# hostname: name={{ inventory_hostname }}
# tags: hostname
#
#- name: Add hostname to /etc/hosts
# lineinfile: dest=/etc/hosts insertafter=^127.0.0.1 line='127.0.1.1 {{ inventory_hostname }}'
# tags: hostname
- include: packages_Ubuntu.yml
when: ansible_distribution == 'Ubuntu'
tags: packages
- include: packages_Debian.yml
when: ansible_distribution == 'Debian'
tags: packages
- include: iptables_Debian.yml
when: ansible_os_family == 'Debian'
tags: firewall
- include: sshd.yml
tags: sshd
- name: Reconfigure /etc/sysctl.conf
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_{{ ansible_distribution }}.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: