Skip to content

Commit

Permalink
Added AIO installation playbook
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcr01 committed Aug 29, 2024
1 parent b701e90 commit eb0a973
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 1 deletion.
12 changes: 11 additions & 1 deletion .github/workflows/Test_installation_assistant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,24 @@ jobs:
-i /tmp/allocator_instance/inventory \
-l all \
-e "repository=$REPOSITORY_URL" \
-e "reference=$REFERENCE" \
-e "reference=4.9.0-testing" \
-e "tmp_path=$TMP_PATH" \
-e "pkg_repository=$PKG_REPOSITORY" \
-e "install_deps=$INSTALL_DEPS" \
-e "install_python=$INSTALL_PYTHON" \
-e "install_pip_deps=$INSTALL_PIP_DEPS" \
-v
- name: Execute AIO installation with assistant playbook
run: |
ansible-playbook .github/workflows/ansible-playbooks/aio.yml \
-i /tmp/allocator_instance/inventory \
-l all \
-e "tmp_path=$TMP_PATH" \
-e "logs_path=$LOGS_PATH"
-e "test_name=$TEST_NAME"
-v
- name: Delete allocated VM
if: always() && steps.allocator_instance.outcome == 'success'
run: python3 wazuh-automation/deployability/modules/allocation/main.py --action delete --track-output /tmp/allocator_instance/track.yml
47 changes: 47 additions & 0 deletions .github/workflows/ansible-playbooks/aio.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@

- hosts: all
become: true

vars:
script_path: "{{ tmp_path }}"
script_name: "wazuh-install.sh"
script_builder: "builder.sh"
test_name: "{{ test_name }}"
test_dir: "/{{ test_name }}"
logs_folder: "{{ logs_folder }}"

tasks:

- name: Create log directory
file:
path: "{{ test_dir }}"
state: directory

- name: Create log file
file:
dest: "{{ test_dir }}/{{ test_name }}.log"
state: touch

- name: Test assistant AIO install
block:
- name: Install assistant installer
command: "bash {{ script_name }} -a -v"
args:
chdir: "{{ script_path }}"
register: install_results

always:
- name: Save output
blockinfile:
marker: ""
path: "{{ test_dir }}/{{ test_name }}.log"
block: |
{{ install_results.stderr }}
--------------------------------
{{ install_results.stdout }}
- name: Fetch log
fetch:
src: "{{ test_dir }}/{{ test_name }}.log"
dest: "{{ logs_folder }}/"
flat: yes

0 comments on commit eb0a973

Please sign in to comment.