diff --git a/tasks/locales.yml b/tasks/locales.yml index 21d8abb..9174a08 100644 --- a/tasks/locales.yml +++ b/tasks/locales.yml @@ -2,7 +2,8 @@ - name: set locales locale_gen: name="{{ item.name }}" state="{{ item.state | default('present') }}" with_items: "{{ common_locales }}" + when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu' - name: set default locale lineinfile: dest="/etc/default/locale" regexp="LANG=" line="LANG={{ common_locales_default }}" - when: common_locales_default + when: common_locales_default and (ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu') diff --git a/tasks/main.yml b/tasks/main.yml index 36ce58c..e632ef3 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -44,3 +44,7 @@ - include_tasks: rcfiles.yml when: common_rcfiles tags: ['common', 'rcfiles'] + +- include_tasks: tty.yml + when: common_tty + tags: ['common', 'tty'] diff --git a/tasks/openssh.yml b/tasks/openssh.yml index 5f0f143..bc68e7c 100644 --- a/tasks/openssh.yml +++ b/tasks/openssh.yml @@ -1,9 +1,19 @@ --- - name: openssh - install package: name=openssh-server + when: ansible_os_family == "Debian" + +- name: openssh - install + package: name=openssh + when: ansible_os_family != "Debian" - name: openssh - start and enable service: name=ssh state=started enabled=yes + when: ansible_os_family == "Debian" + +- name: openssh - start and enable + service: name=sshd state=started enabled=yes + when: ansible_os_family != "Debian" - name: openssh - config template: diff --git a/tasks/rsyslog.yml b/tasks/rsyslog.yml index 2e03b65..34450b5 100644 --- a/tasks/rsyslog.yml +++ b/tasks/rsyslog.yml @@ -17,3 +17,8 @@ - name: rsyslog - start and enable service: name=rsyslog state=started enabled=yes + when: ansible_os_family == "Debian" + +- name: rsyslog - start and enable + service: name=rsyslogd state=started enabled=yes + when: ansible_os_family != "Debian" diff --git a/tasks/tty.yml b/tasks/tty.yml new file mode 100644 index 0000000..6d913c7 --- /dev/null +++ b/tasks/tty.yml @@ -0,0 +1,10 @@ +--- +- name: tty - disable all but one + service: name="{{ item }}" enabled=no + when: ansible_os_family != "Debian" + with_items: + - agetty-tty2 + - agetty-tty3 + - agetty-tty4 + - agetty-tty5 + - agetty-tty6