-
Notifications
You must be signed in to change notification settings - Fork 21
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
Feat playbooks git sync #50
Conversation
Refactored playbook management and execution functionalities in the system. Essential changes include renaming "ansible" routes to "playbook" routes, relocating several playbook related files, and modifying ansible related Python scripts. Added functionality to filter results by file extensions in directory tree listing and created a REST service for managing playbook repositories.
Refactored playbook management and execution functionalities in the system. Essential changes include renaming "ansible" routes to "playbook" routes, relocating several playbook related files, and modifying ansible related Python scripts. Added functionality to filter results by file extensions in directory tree listing and created a REST service for managing playbook repositories.
The documentation files previously suggested using the 'playbooks-repository clone' command to copy the repositories. These instructions have been updated to use the more standard 'git clone' command instead, providing more general compatibility.
…at-playbooks-git-sync
The server integrations and use-cases have been updated for improved efficiency and clarity. The `syncToRepository` method was removed from multiple components for redundancy. The handling of asynchronous calls and data manipulation methods was modified as well. New test files were added to verify tree-utils functionality and the `PlaybookRepositoryComponent`.
The term 'playbooks' has been replaced with 'ansible' in multiple locations across the codebase - both in commands and in actual code. This clarifies the usage and the relevance of Ansible in areas such as the AnsibleGalaxyCommand, in shell commands, and in cache interactions. Even in the technical documentation and guide, references have been updated to reflect this change.
The documentation has been updated to replace incorrect references of 'playbooks-repository' with the correct 'git' command. Additionally, an icon source in the main site page was replaced to better reflect the compatibility with Ansible. These changes ensure that users are provided with accurate instructions and consistent visual cues.
The documentation has been updated to replace incorrect references of 'playbooks-repository' with the correct 'git' command. Additionally, an icon source in the main site page was replaced to better reflect the compatibility with Ansible. These changes ensure that users are provided with accurate instructions and consistent visual cues.
The contribute guide has been updated to include an explicit step for creating a new branch for changes. This clarification ensures contributors understand the importance of not making changes directly on the main branch.
Codebase has been refactored to break down shell operations pertaining to playbooks, files, and repositories. Export structure has been improved and segment separation helps identify which components are responsible for each task. While enhancing code readability, this also facilitates future code maintenance and improvements.
async function saveSshKey(key: string, uuid: string) { | ||
try { | ||
logger.info('[SHELL] - vaultSshKey Starting...'); | ||
if (shell.exec(`echo '${key}' > /tmp/${uuid}.key`).code !== 0) { |
Check failure
Code scanning / CodeQL
Uncontrolled command line Critical
user-provided value
This command line depends on a
user-provided value
This command line depends on a
user-provided value
async function newPlaybook(fullFilePath: string) { | ||
try { | ||
logger.info('[SHELL] - newPlaybook - Starting...'); | ||
shell.touch(fullFilePath); |
Check failure
Code scanning / CodeQL
Uncontrolled data used in path expression High
user-provided value
if (fileExist) { | ||
throw new Error('Directory or file already exists'); | ||
} | ||
return shell.mkdir('-p', fullPath); |
Check failure
Code scanning / CodeQL
Uncontrolled data used in path expression High
user-provided value
throw new Error('Attempt to delete a file or directory outside the root directory'); | ||
} | ||
} | ||
shell.rm('-rf', directory); |
Check failure
Code scanning / CodeQL
Uncontrolled data used in path expression High
user-provided value
This commit introduces substantial updates across several different files. Changes include aligning directory paths with updated UUIDs, integrating migration instructions with Scheme version tracking, improving Shell methods imports, standardising tree building across several components, ensuring unique name for Playbook model, and modifying Git commit messages to reflect updates through SSM. The updates aim to improve functionality, increase efficiency, and fix previous issues.
Adjusted the function call to install an Ansible Galaxy Collection in the galaxy.ts file. The updated version adds a necessary layer to the function call (`AnsibleShell`) ensuring the correct execution of the installAnsibleGalaxyCollection method.
async function installAnsibleGalaxyCollection(name: string, namespace: string) { | ||
try { | ||
logger.info('[SHELL] - installAnsibleGalaxyCollection Starting...'); | ||
const result = shell.exec(AnsibleGalaxyCmd.getInstallCollectionCmd(name, namespace)); |
Check failure
Code scanning / CodeQL
Uncontrolled command line Critical
No description provided.