v3
This commit is contained in:
36
roles/demolamp/tasks/precheck.yml
Normal file
36
roles/demolamp/tasks/precheck.yml
Normal file
@@ -0,0 +1,36 @@
|
||||
---
|
||||
# tasks file for Redis-HA (Prechecking inputs and packages for all nodes)
|
||||
|
||||
- name: Check inputs
|
||||
ansible.builtin.fail: msg="Missing ansTagVer, ansAction or ansENV."
|
||||
when: ansTagVer is undefined or ansAction is undefined or ansENV is undefined
|
||||
|
||||
- name: Check and intall Python 3
|
||||
ansible.builtin.yum:
|
||||
name: python3
|
||||
state: present
|
||||
when: ansible_os_family == 'RedHat' or ansible_os_family == 'Rocky'
|
||||
register: py3_result
|
||||
|
||||
- name: Set python_interpreter to 3 if Python 3 installed
|
||||
ansible.builtin.set_fact:
|
||||
ansible_python_interpreter: /usr/bin/python3
|
||||
when: py3_result.rc == 0
|
||||
|
||||
- name: Check and install Python's SDK
|
||||
ansible.builtin.pip:
|
||||
name:
|
||||
- docker==5.0.3
|
||||
- jsondiff==1.3.0
|
||||
- pyyaml==6.0
|
||||
- docker-compose==1.29.2
|
||||
executable: pip3
|
||||
when: py3_result.rc == 0
|
||||
|
||||
- name: Set Kernel parameter - vm.overcommit_memory to 1
|
||||
ansible.posix.sysctl:
|
||||
name: vm.overcommit_memory
|
||||
value: '1'
|
||||
sysctl_set: yes
|
||||
state: present
|
||||
reload: yes
|
||||
Reference in New Issue
Block a user