From 1f0b5925a8a78a40cdb8ff604e3cacc78ce9b3ff Mon Sep 17 00:00:00 2001 From: Tobias Hachmer Date: Tue, 5 Sep 2017 11:29:13 +0200 Subject: [PATCH] Role test-prerequisites: improve tasks; update OS to current debian stable --- roles/test-prerequisites/tasks/main.yml | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/roles/test-prerequisites/tasks/main.yml b/roles/test-prerequisites/tasks/main.yml index 912db2e..9b45590 100755 --- a/roles/test-prerequisites/tasks/main.yml +++ b/roles/test-prerequisites/tasks/main.yml @@ -1,25 +1,23 @@ --- - - name: assert IPv4 DNS entry - local_action: shell dig A {{ inventory_hostname }} | egrep '^{{ inventory_hostname }}' + local_action: shell dig +short A {{ inventory_hostname }} | egrep '^{{ ansible_default_ipv4.address }}' changed_when: False - when: "{{ require_dns | default('True') }}" - name: assert IPv6 DNS entry - local_action: shell dig AAAA {{ inventory_hostname }} | egrep '^{{ inventory_hostname }}' + local_action: shell dig +short AAAA {{ inventory_hostname }} | egrep '^{{ ansible_default_ipv6.address }}' changed_when: False - when: "{{ require_dns | default('True') }}" -- name: test access to admin account (ssh key neccessary!) +- name: Test access to admin account command: "true" changed_when: False -- name: test access to root account +- name: Test root access for admin account command: "true" changed_when: False become: True - become_user: root -- name: fail on wrong OS type and version # TODO: include debian +- name: Check for correct OS type and version fail: msg="unsupported OS type or version - {{ ansible_distribution }} {{ ansible_distribution_major_version }}" - when: not ( ( ansible_distribution=="Ubuntu" and ansible_distribution_major_version|int==14 ) or ( ansible_distribution=="Debian" and ansible_distribution_major_version|int==8 ) ) + when: + - ansible_distribution != "Debian" + - ansible_distribution_major_version|int != "9"