Skip to content

Commit

Permalink
Adding Python install in CentOS 8
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcr01 committed Aug 29, 2024
1 parent 08b193e commit eae9a6c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/Test_installation_assistant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,6 @@ jobs:
TMP_PATH="/tmp/test"
PKG_REPOSITORY="${{ inputs.REPOSITORY }}"
ANSIBLE_PYTHON_INTERPRETER=""
if [ "${{ inputs.SYSTEM }}" == "CentOS 8" ]; then
ANSIBLE_PYTHON_INTERPRETER="/usr/bin/python3"
fi
ansible-playbook .github/workflows/ansible-playbooks/provision.yml \
-i /tmp/allocator_instance/inventory \
-l all \
Expand All @@ -172,7 +167,6 @@ jobs:
-e "install_deps=$INSTALL_DEPS" \
-e "install_python=$INSTALL_PYTHON" \
-e "install_pip_deps=$INSTALL_PIP_DEPS" \
${ANSIBLE_PYTHON_INTERPRETER:+-e "ansible_python_interpreter=$ANSIBLE_PYTHON_INTERPRETER"} \
-v
- name: Delete allocated VM
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/ansible-playbooks/provision.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
- hosts: all
become: true
gather_facts: no
vars:
script_path: "{{ tmp_path }}"
script_name: "wazuh-install.sh"
Expand Down Expand Up @@ -31,7 +32,21 @@
- beautifulsoup4
- urllib3==1.26.6

pre_tasks:
- name: Check if the system is CentOS 8 and install Python if necessary
raw: |
if [ -f /etc/centos-release ]; then
if grep -q -i -E "centos.*8" /etc/centos-release; then
if ! command -v python3 &> /dev/null; then
dnf install -y python3
fi
fi
fi
tasks:
- name: Gather facts
ansible.builtin.setup:

- name: Make tmp folder directory
file:
path: "{{ tmp_path }}"
Expand Down

0 comments on commit eae9a6c

Please sign in to comment.