There are too many OS names to recognize: Debian, (K/X)Ubuntu,
CentOS, Fedora, RedHat...
name: ['adjtimex', 'ntpdate-debian']
state: latest
update_cache: yes
- when: ansible_facts.distribution == "Debian"
+ when: ansible_facts.os_family == 'Debian'
- name: Install adjtimex and ntpdate
become: true
name: ['adjtimex', 'ntpdate']
state: latest
update_cache: yes
- when: ansible_facts.distribution != "Debian"
+ when: ansible_facts.os_family == 'RedHat'
- name: Copy the script adjtimex.sh
become: true
- name: Reload sshd
become: true
service:
- name: "ssh{{ ansible_facts.distribution != 'Debian' and 'd' or '' }}"
+ name: "ssh{{ ansible_facts.os_family == 'RedHat' and 'd' or '' }}"
state: reloaded