Skip to content

Commit

Permalink
Merge pull request #5213 from wazuh/fix/5210-Fixing-yaml-examples
Browse files Browse the repository at this point in the history
Fixing examples in the release of DTT1
  • Loading branch information
davidjiglesias authored Apr 17, 2024
2 parents 48401ac + 318679a commit 81dccd5
Show file tree
Hide file tree
Showing 17 changed files with 472 additions and 267 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ tasks:
- track-output: "{working-dir}/manager-{manager-os}/track.yaml"
- label-termination-date: "1d"
- label-team: "qa"
on-error: "abort-all"
cleanup:
this: process
with:
Expand All @@ -63,6 +64,7 @@ tasks:
- track-output: "{working-dir}/agent-{agent}/track.yaml"
- label-termination-date: "1d"
- label-team: "qa"
on-error: "abort-all"
foreach:
- variable: agent-os
as: agent
Expand Down Expand Up @@ -94,7 +96,7 @@ tasks:
live: True
depends-on:
- "allocate-manager-{manager-os}"

on-error: "abort-all"

# Generic agent test task
- task: "run-agent-{agent}-tests"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ tasks:
- track-output: "{working-dir}/agent-{agent}/track.yaml"
- label-termination-date: "1d"
- label-team: "qa"
on-error: "abort-all"
foreach:
- variable: agent-os
as: agent
Expand Down Expand Up @@ -115,6 +116,7 @@ tasks:
depends-on:
- "allocate-agent-{agent}"
- "provision-manager-{manager-os}"
on-error: "abort-all"
foreach:
- variable: agent-os
as: agent
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
version: 0.1
description: Test agent stop with provisioning agents' with provision module
description: Test agent restart with provisioning agents' with provision module
variables:
agent-os:
- linux-ubuntu-18.04-amd64
Expand All @@ -15,7 +15,7 @@ variables:
- linux-redhat-8-amd64
- linux-redhat-9-amd64
- linux-amazon-2-amd64
manager-os: linux-ubuntu-20.04-amd64
manager-os: linux-ubuntu-22.04-amd64
infra-provider: aws
working-dir: /tmp/dtt1-poc

Expand Down Expand Up @@ -64,6 +64,7 @@ tasks:
- track-output: "{working-dir}/agent-{agent}/track.yaml"
- label-termination-date: "1d"
- label-team: "qa"
on-error: "abort-all"
foreach:
- variable: agent-os
as: agent
Expand Down Expand Up @@ -115,6 +116,7 @@ tasks:
depends-on:
- "allocate-agent-{agent}"
- "provision-manager-{manager-os}"
on-error: "abort-all"
foreach:
- variable: agent-os
as: agent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ tasks:
- track-output: "{working-dir}/agent-{agent}/track.yaml"
- label-termination-date: "1d"
- label-team: "qa"
on-error: "abort-all"
foreach:
- variable: agent-os
as: agent
Expand Down Expand Up @@ -85,6 +86,7 @@ tasks:
live: True
depends-on:
- "allocate-manager-{manager-os}"
on-error: "abort-all"

# Generic agent provision task
- task: "provision-install-{agent}"
Expand All @@ -103,6 +105,7 @@ tasks:
depends-on:
- "allocate-agent-{agent}"
- "provision-manager-{manager-os}"
on-error: "abort-all"
foreach:
- variable: agent-os
as: agent
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
version: 0.1
description: Test agent uninstall with provisioning agents' with provision module
description: Test agent restart with provisioning agents' with provision module
variables:
agent-os:
- linux-ubuntu-18.04-amd64
Expand Down Expand Up @@ -64,6 +64,7 @@ tasks:
- track-output: "{working-dir}/agent-{agent}/track.yaml"
- label-termination-date: "1d"
- label-team: "qa"
on-error: "abort-all"
foreach:
- variable: agent-os
as: agent
Expand Down Expand Up @@ -115,6 +116,7 @@ tasks:
depends-on:
- "allocate-agent-{agent}"
- "provision-manager-{manager-os}"
on-error: "abort-all"
foreach:
- variable: agent-os
as: agent
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
version: 0.1
description: This workflow is used to test agents' deployment for DDT1 PoC
variables:
agent-os:
- linux-ubuntu-18.04-amd64
- linux-ubuntu-20.04-amd64
- linux-debian-10-amd64
- linux-debian-11-amd64
- linux-debian-12-amd64
- linux-oracle-9-amd64
manager-os: linux-ubuntu-22.04-amd64
infra-provider: vagrant
working-dir: /tmp/dtt1-poc

tasks:
# Unique manager allocate task
- task: "allocate-manager-{manager-os}"
description: "Allocate resources for the manager."
do:
this: process
with:
path: python3
args:
- modules/allocation/main.py
- action: create
- provider: "{infra-provider}"
- size: large
- composite-name: "{manager-os}"
- inventory-output: "{working-dir}/manager-{manager-os}/inventory.yaml"
- track-output: "{working-dir}/manager-{manager-os}/track.yaml"
- label-termination-date: "1d"
- label-team: "qa"
on-error: "abort-all"
cleanup:
this: process
with:
path: python3
args:
- modules/allocation/main.py
- action: delete
- track-output: "{working-dir}/manager-{manager-os}/track.yaml"

# Unique agent allocate task
- task: "allocate-agent-{agent}"
description: "Allocate resources for the agent."
do:
this: process
with:
path: python3
args:
- modules/allocation/main.py
- action: create
- provider: "{infra-provider}"
- size: small
- composite-name: "{agent}"
- inventory-output: "{working-dir}/agent-{agent}/inventory.yaml"
- track-output: "{working-dir}/agent-{agent}/track.yaml"
- label-termination-date: "1d"
- label-team: "qa"
on-error: "abort-all"
foreach:
- variable: agent-os
as: agent
cleanup:
this: process
with:
path: python3
args:
- modules/allocation/main.py
- action: delete
- track-output: "{working-dir}/agent-{agent}/track.yaml"
depends-on:
- "provision-manager-{manager-os}"

# Unique manager provision task
- task: "provision-manager-{manager-os}"
description: "Provision the manager."
do:
this: process
with:
path: python3
args:
- modules/provision/main.py
- inventory: "{working-dir}/manager-{manager-os}/inventory.yaml"
- install:
- component: wazuh-manager
type: assistant
version: 4.7.3
live: True
depends-on:
- "allocate-manager-{manager-os}"
on-error: "abort-all"


# Generic agent test task
- task: "run-agent-{agent}-tests"
description: "Run tests install for the agent {agent}."
do:
this: process
with:
path: python3
args:
- modules/testing/main.py
- targets:
- wazuh-1: "{working-dir}/manager-{manager-os}/inventory.yaml"
- agent: "{working-dir}/agent-{agent}/inventory.yaml"
- tests: "install,registration,restart,stop,uninstall"
- component: "agent"
- wazuh-version: "4.7.3"
- wazuh-revision: "40714"
- live: "True"
foreach:
- variable: agent-os
as: agent
depends-on:
- "allocate-agent-{agent}"
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ version: 0.1
description: This workflow is used to test agents' deployment for DDT1 PoC
variables:
agent-os:
- linux-oracle-9-amd64
- linux-centos-7-amd64
- linux-centos-8-amd64
- linux-redhat-7-amd64
Expand Down Expand Up @@ -58,6 +57,7 @@ tasks:
- track-output: "{working-dir}/agent-{agent}/track.yaml"
- label-termination-date: "1d"
- label-team: "qa"
on-error: "abort-all"
foreach:
- variable: agent-os
as: agent
Expand Down Expand Up @@ -89,6 +89,7 @@ tasks:
live: True
depends-on:
- "allocate-manager-{manager-os}"
on-error: "abort-all"


# Generic agent test task
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,10 @@ variables:
agent-os:
- linux-ubuntu-18.04-amd64
- linux-ubuntu-20.04-amd64
- linux-ubuntu-22.04-amd64
- linux-debian-10-amd64
- linux-debian-11-amd64
- linux-debian-12-amd64
- linux-oracle-9-amd64
- linux-centos-7-amd64
- linux-centos-8-amd64
- linux-redhat-7-amd64
- linux-redhat-8-amd64
- linux-redhat-9-amd64
- linux-amazon-2-amd64
manager-os: linux-ubuntu-22.04-amd64
infra-provider: vagrant
working-dir: /tmp/dtt1-poc
Expand All @@ -35,8 +28,6 @@ tasks:
- composite-name: "{manager-os}"
- inventory-output: "{working-dir}/manager-{manager-os}/inventory.yaml"
- track-output: "{working-dir}/manager-{manager-os}/track.yaml"
- label-termination-date: "1d"
- label-team: "qa"
on-error: "abort-all"
cleanup:
this: process
Expand All @@ -62,8 +53,7 @@ tasks:
- composite-name: "{agent}"
- inventory-output: "{working-dir}/agent-{agent}/inventory.yaml"
- track-output: "{working-dir}/agent-{agent}/track.yaml"
- label-termination-date: "1d"
- label-team: "qa"
on-error: "abort-all"
foreach:
- variable: agent-os
as: agent
Expand Down Expand Up @@ -115,6 +105,7 @@ tasks:
depends-on:
- "allocate-agent-{agent}"
- "provision-manager-{manager-os}"
on-error: "abort-all"
foreach:
- variable: agent-os
as: agent
Expand Down
Loading

0 comments on commit 81dccd5

Please sign in to comment.