-
Notifications
You must be signed in to change notification settings - Fork 0
/
database_setup.yml
27 lines (27 loc) · 1007 Bytes
/
database_setup.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
---
- name: Database Setup play
hosts: database_servers
vars:
min_ram_size_bytes: 2000000000
supported_distros:
- RedHat
#- Centos
tasks:
- name: Setup Database tasks on supported hosts w/ Min. RAM
include_tasks: "{{ ansible_distribution }}_database_tasks.yml"
when:
- ansible_distribution in supported_distros
- ansible_memtotal_mb*1024*1024 >= min_ram_size_bytes
- name: Print a message for unsupported Distros
debug:
msg: >
{{ inventory_hostname }} is a
{{ ansible_distribution }}-based host, which is not one
of the supported distributions ({{ supported_distros }})
when: ansible_distribution not in supported_distros
- name: Print a message for systems with insufficient RAM
debug:
msg: >
{{ inventory_hostname }} does not meet the minimum
RAM requirements of {{ min_ram_size_bytes }} bytes.
when: ansible_memtotal_mb*1024*1024 < min_ram_size_bytes