ansible-ffibk/roles/test-prerequisites/tasks/main.yml

26 lines
959 B
YAML
Raw Normal View History

2016-07-06 16:34:54 +02:00
---
- name: assert IPv4 DNS entry
local_action: shell dig A {{ inventory_hostname }} | egrep '^{{ inventory_hostname }}'
changed_when: False
2016-08-12 00:58:42 +02:00
when: "{{ require_dns | default('True') }}"
2016-07-06 16:34:54 +02:00
- name: assert IPv6 DNS entry
local_action: shell dig AAAA {{ inventory_hostname }} | egrep '^{{ inventory_hostname }}'
changed_when: False
2016-08-12 00:58:42 +02:00
when: "{{ require_dns | default('True') }}"
2016-07-06 16:34:54 +02:00
- name: test access to admin account (ssh key neccessary!)
command: "true"
changed_when: False
- name: test access to root account
command: "true"
changed_when: False
become: True
become_user: root
- name: fail on wrong OS type and version # TODO: include debian
fail: msg="unsupported OS type or version - {{ ansible_distribution }} {{ ansible_distribution_major_version }}"
2016-07-16 00:54:54 +02:00
when: not ( ( ansible_distribution=="Ubuntu" and ansible_distribution_major_version|int==14 ) or ( ansible_distribution=="Debian" and ansible_distribution_major_version|int==8 ) )