Update roles/demolamp/tasks/precheck.yml

This commit is contained in:
2024-02-21 16:21:28 +08:00
parent 3987df4a64
commit 7571a2367a

View File

@@ -4,33 +4,3 @@
- name: Check inputs - name: Check inputs
ansible.builtin.fail: msg="Missing ansTagVer, ansAction or ansENV." ansible.builtin.fail: msg="Missing ansTagVer, ansAction or ansENV."
when: ansTagVer is undefined or ansAction is undefined or ansENV is undefined 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