Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove hardcoded references to branch in provision playbooks #5517

Merged
merged 30 commits into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
e2a692b
fix: remove hardcoded branch
santipadilla Jun 20, 2024
365b76b
fix: remove hardcoded branch
santipadilla Jun 20, 2024
40c0a94
fix: remove hardcode branch reference
santipadilla Jun 24, 2024
1c333bb
fix: temporal removal of macos
santipadilla Jun 24, 2024
70f1724
fix: add debug task
santipadilla Jun 24, 2024
ed291d2
fix: capital letters
santipadilla Jun 24, 2024
995d39b
fix: remove debug println
santipadilla Jun 24, 2024
9ff2f5b
fix: change variable name
santipadilla Jun 25, 2024
4cb7ed4
fix: change variable name
santipadilla Jun 25, 2024
1f6f8f5
fix: change variable name
santipadilla Jun 25, 2024
592ec66
fix: temporary agent removal
santipadilla Jun 26, 2024
0672d00
fix: reset packages version
santipadilla Jun 26, 2024
69affd3
docs: update changelog
santipadilla Jun 26, 2024
9c692d9
fix: change parameter
santipadilla Jun 26, 2024
b90480c
fix: change parameter name
santipadilla Jun 26, 2024
fdd09d0
Merge branch '4.8.1' into enhancement/5509-remove-hardcoded-branch-re…
santipadilla Jun 26, 2024
f391ccb
fix: reestablish all agents
santipadilla Jun 26, 2024
925d6fe
fix: remove unnecesary repository installation tasks
santipadilla Jun 27, 2024
98b5d31
fix: remove unnecesary repository installation
santipadilla Jun 27, 2024
fb60cce
fix: remove unnecessary repository installation tasks
santipadilla Jun 27, 2024
b87f54f
fix: remove unnecessary repository installation tasks
santipadilla Jun 27, 2024
04d324e
fix: change hardcode cert variable
santipadilla Jun 27, 2024
622d79d
fix: add commas
santipadilla Jun 27, 2024
a5a4cae
fix: restore source variables
santipadilla Jun 27, 2024
548f064
fix: temporal remove of agents
santipadilla Jun 27, 2024
2135afa
docs: update changelog
santipadilla Jun 28, 2024
331da44
fix: reestablish all test agents
santipadilla Jun 28, 2024
15d8c2c
Update CHANGELOG.md
santipadilla Jun 28, 2024
286fa11
fix: remove agents for testing
santipadilla Jul 1, 2024
c20dfd7
fix: reestablish all agents
santipadilla Jul 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ All notable changes to this project will be documented in this file.

### Changed

- Remove hardcoded references in provision playbook for E2E tests ([#5517](https://github.com/wazuh/wazuh-qa/pull/5517)) \- (Framework)
- Fix test_consistency_initial_scans by adding a 30-minute wait before collecting vulnerabilities. ([#5507](https://github.com/wazuh/wazuh-qa/pull/5507)) \- (Tests)

## [4.8.0] - 12/06/2024
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
filebeat_version: 7.10.2

wazuh_template_branch: 4.8.1
wazuh_template_branch: "{{ SOURCE_REFERENCE }}"

filebeat_node_name: node-1

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
---

wazuh_agent_version: 4.8.0

# Custom packages installation

wazuh_custom_packages_installation_agent_enabled: false
Expand Down Expand Up @@ -56,8 +54,6 @@ wazuh_winagent_config:
check_md5: True
md5: a03806b7302767d0470d65d3f103fabb

wazuh_winagent_config_url: https://packages.wazuh.com/4.x/windows/wazuh-agent-4.8.0-1.msi
wazuh_winagent_package_name: wazuh-agent-4.8.0-1.msi
wazuh_winagent_package_name_generic: wazuh-agent.msi
wazuh_dir: "/var/ossec"
macos_wazuh_dir: "/Library/Ossec"
Expand Down
25 changes: 0 additions & 25 deletions provisioning/roles/wazuh/ansible-wazuh-agent/tasks/Linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,6 @@
when:
- wazuh_custom_packages_installation_agent_enabled

- name: Linux CentOS/RedHat | Install wazuh-agent
yum:
name: wazuh-agent-{{ wazuh_agent_version }}
state: present
lock_timeout: '{{ wazuh_agent_yum_lock_timeout }}'
when:
- ansible_os_family|lower == "redhat"
- not wazuh_agent_sources_installation.enabled
- not wazuh_custom_packages_installation_agent_enabled
tags:
- init

- name: Linux Debian | Install wazuh-agent
apt:
name: "wazuh-agent={{ wazuh_agent_version }}-*"
state: present
cache_valid_time: 3600
when:
- ansible_os_family|lower != "redhat"
- not wazuh_agent_sources_installation.enabled
- not wazuh_custom_packages_installation_agent_enabled
- not ansible_check_mode
tags:
- init

- name: Linux | Check if client.keys exists
stat:
path: "{{ wazuh_dir }}/etc/client.keys"
Expand Down
37 changes: 0 additions & 37 deletions provisioning/roles/wazuh/ansible-wazuh-agent/tasks/Windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,38 +18,6 @@
when:
- not check_path.stat.exists

- name: Windows | Check if Wazuh installer is already downloaded
win_stat:
path: "{{ wazuh_winagent_config.download_dir }}{{ wazuh_winagent_package_name }}"
register: wazuh_package_downloaded

- name: Windows | Download Wazuh Agent package
win_get_url:
url: "{{ wazuh_winagent_config_url }}"
dest: "{{ wazuh_winagent_config.download_dir }}"
when:
- not wazuh_package_downloaded.stat.exists
- not wazuh_custom_packages_installation_agent_enabled

- name: Windows | Verify the Wazuh Agent installer
win_stat:
path: "{{ wazuh_winagent_config.download_dir }}{{ wazuh_winagent_package_name }}"
get_checksum: true
checksum_algorithm: md5
register: wazuh_agent_status
failed_when:
- wazuh_agent_status.stat.checksum != wazuh_winagent_config.md5
when:
- wazuh_winagent_config.check_md5
- not wazuh_custom_packages_installation_agent_enabled


- name: Windows | Install Agent if not already installed
win_package:
path: "{{ wazuh_winagent_config.download_dir }}{{ wazuh_winagent_package_name }}"
state: present
when: not wazuh_custom_packages_installation_agent_enabled

- name: Windows | Check if client.keys exists
win_stat:
path: "{{ wazuh_agent_win_path }}client.keys"
Expand Down Expand Up @@ -94,11 +62,6 @@
tags:
- config

- name: Windows | Delete downloaded Wazuh agent installer file
win_file:
path: "{{ wazuh_winagent_config.download_dir }}{{ wazuh_winagent_package_name }}"
state: absent

- include_tasks: "installation_from_custom_packages.yml"
when:
- wazuh_custom_packages_installation_agent_enabled
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
---

wazuh_manager_version: 4.8.0

wazuh_manager_fqdn: "wazuh-server"
wazuh_manager_package_state: present

Expand Down
10 changes: 0 additions & 10 deletions provisioning/roles/wazuh/ansible-wazuh-manager/tasks/Debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,6 @@
state: present
when: wazuh_manager_sources_installation.enabled

- name: Debian/Ubuntu | Install wazuh-manager
apt:
name:
- "wazuh-manager={{ wazuh_manager_version }}-*"
state: present
tags: init
when:
- not wazuh_manager_sources_installation.enabled
- not wazuh_custom_packages_installation_manager_enabled

- include_tasks: "installation_from_sources.yml"
when:
- wazuh_manager_sources_installation.enabled
Expand Down
13 changes: 0 additions & 13 deletions provisioning/roles/wazuh/ansible-wazuh-manager/tasks/RedHat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,19 +99,6 @@
state: present
when: wazuh_manager_sources_installation.enabled

- name: CentOS/RedHat/Amazon | Install wazuh-manager
package:
name: "wazuh-manager-{{ wazuh_manager_version }}"
state: "{{ wazuh_manager_package_state }}"
register: wazuh_manager_main_packages_installed
until: wazuh_manager_main_packages_installed is succeeded
when:
- ansible_os_family|lower == "redhat"
- not wazuh_manager_sources_installation.enabled
- not wazuh_custom_packages_installation_manager_enabled
tags:
- init

- include_tasks: "../tasks/installation_from_sources.yml"
when:
- wazuh_manager_sources_installation.enabled
Expand Down
2 changes: 0 additions & 2 deletions provisioning/roles/wazuh/check-packages/defaults/main.yml

This file was deleted.

80 changes: 0 additions & 80 deletions provisioning/roles/wazuh/check-packages/scripts/check_packages.sh

This file was deleted.

11 changes: 0 additions & 11 deletions provisioning/roles/wazuh/check-packages/tasks/main.yml

This file was deleted.

6 changes: 2 additions & 4 deletions provisioning/roles/wazuh/vars/repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ wazuh_repo:
yum: 'https://packages-dev.wazuh.com/4.x/yum/'
gpg: 'https://packages-dev.wazuh.com/key/GPG-KEY-WAZUH'
key_id: '0DCFCA5547B19D2A6099506096B3EE5F29111145'
wazuh_winagent_config_url: "https://packages.wazuh.com/4.x/windows/wazuh-agent-{{ wazuh_agent_version }}-1.msi"
wazuh_winagent_package_name: "wazuh-agent-{{ wazuh_agent_version }}-1.msi"

certs_gen_tool_version: 4.8
certs_gen_tool_version: "{{ CERTS_GEN_TOOL_VERSION }}"

# Url of certificates generator tool
certs_gen_tool_url: "https://packages-dev.wazuh.com/{{ certs_gen_tool_version }}/wazuh-certs-tool.sh"
certs_gen_tool_url: "https://packages-dev.wazuh.com/{{ certs_gen_tool_version }}/wazuh-certs-tool.sh"
6 changes: 2 additions & 4 deletions provisioning/roles/wazuh/vars/repo_pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ wazuh_repo:
yum: 'https://packages-dev.wazuh.com/pre-release/yum/'
gpg: 'https://packages-dev.wazuh.com/key/GPG-KEY-WAZUH'
key_id: '0DCFCA5547B19D2A6099506096B3EE5F29111145'
wazuh_winagent_config_url: "https://packages-dev.wazuh.com/pre-release/windows/wazuh-agent-{{ wazuh_agent_version }}-1.msi"
wazuh_winagent_package_name: "wazuh-agent-{{ wazuh_agent_version }}-1.msi"

certs_gen_tool_version: 4.8
certs_gen_tool_version: "{{ CERTS_GEN_TOOL_VERSION }}"

# Url of certificates generator tool
certs_gen_tool_url: "https://packages-dev.wazuh.com/{{ certs_gen_tool_version }}/wazuh-certs-tool.sh"
certs_gen_tool_url: "https://packages-dev.wazuh.com/{{ certs_gen_tool_version }}/wazuh-certs-tool.sh"
6 changes: 2 additions & 4 deletions provisioning/roles/wazuh/vars/repo_staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ wazuh_repo:
yum: 'https://packages-dev.wazuh.com/staging/yum/'
gpg: 'https://packages-dev.wazuh.com/key/GPG-KEY-WAZUH'
key_id: '0DCFCA5547B19D2A6099506096B3EE5F29111145'
wazuh_winagent_config_url: "https://packages-dev.wazuh.com/staging/windows/wazuh-agent-{{ wazuh_agent_version }}-1.msi"
wazuh_winagent_package_name: "wazuh-agent-{{ wazuh_agent_version }}-1.msi"

certs_gen_tool_version: 4.8
certs_gen_tool_version: "{{ CERTS_GEN_TOOL_VERSION }}"

# Url of certificates generator tool
certs_gen_tool_url: "https://packages-dev.wazuh.com/{{ certs_gen_tool_version }}/wazuh-certs-tool.sh"
certs_gen_tool_url: "https://packages-dev.wazuh.com/{{ certs_gen_tool_version }}/wazuh-certs-tool.sh"
4 changes: 0 additions & 4 deletions provisioning/roles/wazuh/wazuh-dashboard/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,9 @@ dashboard_node_name: node-1
dashboard_server_host: "0.0.0.0"
dashboard_server_port: "443"
dashboard_server_name: "dashboard"
wazuh_version: 4.8.0
indexer_cluster_nodes:
- 127.0.0.1

# The Wazuh dashboard package repository
dashboard_version: "4.8.0"

# API credentials
wazuh_api_credentials:
- id: "default"
Expand Down
11 changes: 0 additions & 11 deletions provisioning/roles/wazuh/wazuh-dashboard/tasks/Debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,6 @@
]
state: present

- name: Install Wazuh dashboard
apt:
name: "wazuh-dashboard={{ dashboard_version }}-*"
state: present
update_cache: yes
register: install

tags:
- install
when: not wazuh_custom_packages_installation_dashboard_enabled

- include_tasks: "install_from_custom_package.yml"
when:
- wazuh_custom_packages_installation_dashboard_enabled
11 changes: 0 additions & 11 deletions provisioning/roles/wazuh/wazuh-dashboard/tasks/RedHat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,6 @@
state: present
ignore_errors: yes

- name: Install Wazuh dashboard
package:
name: "wazuh-dashboard-{{ dashboard_version }}"
state: present
update_cache: yes
register: install

tags:
- install
when: not wazuh_custom_packages_installation_dashboard_enabled

- include_tasks: "install_from_custom_package.yml"
when:
- wazuh_custom_packages_installation_dashboard_enabled
2 changes: 0 additions & 2 deletions provisioning/roles/wazuh/wazuh-dashboard/vars/debian.yml

This file was deleted.

1 change: 0 additions & 1 deletion provisioning/roles/wazuh/wazuh-indexer/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ wazuh_custom_packages_installation_indexer_deb_url: ""
wazuh_custom_packages_installation_indexer_rpm_url: ""

# Cluster Settings
indexer_version: 4.8.0

single_node: false
indexer_node_name: node-1
Expand Down
24 changes: 0 additions & 24 deletions provisioning/roles/wazuh/wazuh-indexer/tasks/Debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,6 @@
]
state: present

- name: Install wazuh-indexer
block:
- name: Add Wazuh indexer repository
block:
- name: Add apt repository signing key
apt_key:
url: "{{ wazuh_repo.gpg }}"
state: present

- name: Add Wazuh indexer repository
apt_repository:
repo: "{{ wazuh_repo.apt }}"
state: present
filename: 'wazuh-indexer'
update_cache: yes

- name: Install Wazuh indexer
apt:
name: wazuh-indexer={{ indexer_version }}-1
state: present
register: install
tags: install
when: not wazuh_custom_packages_installation_indexer_enabled

- include_tasks: "install_from_custom_package.yml"
when:
- wazuh_custom_packages_installation_indexer_enabled
Loading
Loading