-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5264 from wazuh/enhancement/5229-macOS-tests-added
macOs test added
- Loading branch information
Showing
15 changed files
with
584 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
# Copyright (C) 2015, Wazuh Inc. | ||
# Created by Wazuh, Inc. <[email protected]>. | ||
# This program is a free software; you can redistribute it and/or modify it under the terms of GPLv2 | ||
|
||
import ansible_runner | ||
import jinja2 | ||
from typing import Optional | ||
import yaml | ||
|
||
from pathlib import Path | ||
|
@@ -16,7 +18,8 @@ class Inventory(BaseModel): | |
ansible_host: str | IPvAnyAddress | ||
ansible_user: str | ||
ansible_port: int | ||
ansible_ssh_private_key_file: str | ||
ansible_ssh_private_key_file: Optional[str] = None | ||
ansible_password: Optional[str] = None | ||
|
||
|
||
class Ansible: | ||
|
@@ -118,10 +121,13 @@ def generate_inventory(self) -> dict: | |
self.ansible_data.ansible_host: { | ||
'ansible_port': self.ansible_data.ansible_port, | ||
'ansible_user': self.ansible_data.ansible_user, | ||
'ansible_ssh_private_key_file': self.ansible_data.ansible_ssh_private_key_file | ||
**({'ansible_ssh_private_key_file': self.ansible_data.ansible_ssh_private_key_file} | ||
if hasattr(self.ansible_data, 'ansible_ssh_private_key_file') | ||
else {'ansible_password': self.ansible_data.ansible_password}) | ||
} | ||
} | ||
} | ||
} | ||
|
||
|
||
return inventory_data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.