path: /etc/aliases
regexp: "^root: phd$"
line: "root: phd"
+ when: ansible_facts.os_family == 'Debian'
when: phd_exists.results|selectattr('stat.exists')|list|length != 2
+
+- name: Add alias
+ become: true
+ lineinfile:
+ path: /etc/aliases
+ regexp: "^root: phd$"
+ line: "root: phd"
+ when: ansible_facts.os_family == 'RedHat'