ansible-ffibk/test-prerequisites.yml

30 lines
909 B
YAML
Raw Normal View History

2016-06-21 16:32:27 +02:00
#!/usr/bin/ansible-playbook
---
- hosts: ff-servers
remote_user: admin
strategy: free
tasks:
2016-07-05 13:42:55 +02:00
- name: assert IPv4 DNS entry
local_action: shell dig A {{ inventory_hostname }} | egrep '^{{ inventory_hostname }}'
changed_when: False
- name: assert IPv6 DNS entry
local_action: shell dig AAAA {{ inventory_hostname }} | egrep '^{{ inventory_hostname }}'
changed_when: False
2016-06-21 16:32:27 +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
2016-07-05 13:42:55 +02:00
- name: fail on wrong OS type and version # TODO: include debian
2016-06-21 16:32:27 +02:00
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 )