├── .gitignore ├── .gitmodules ├── LICENSE ├── README.md ├── build.yml ├── collections └── requirements.yml ├── demo.tf ├── deploy.yml ├── invs ├── dev │ ├── hosts │ ├── hosts.yml │ └── secrets.yml └── prod │ ├── hosts │ ├── hosts.yml │ └── secrets.yml ├── ping.yml ├── print_system_info.ps1 ├── print_system_info.sh ├── roles ├── build │ └── tasks │ │ └── main.yml └── deploy │ └── tasks │ └── main.yml ├── stress-tests ├── roles │ └── stress-test │ │ └── tasks │ │ └── main.yml ├── test.tf ├── test.yml └── test2.yml └── terragrunt.hcl /.gitignore: -------------------------------------------------------------------------------- 1 | /.terraform.lock.hcl 2 | /.terraform/ 3 | /out.txt -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "roles/ping"] 2 | path = roles/ping 3 | url = https://github.com/semaphoreui/semaphore-demo-ping-role.git 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Denis Gukov 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Semaphore UI Demo Project 2 | 3 | This repository contains a collection of example projects demonstrating various automation and infrastructure-as-code tools integration with Semaphore UI. The project serves as a practical reference for implementing different automation workflows. 4 | 5 | ## Project Structure 6 | 7 | The repository includes examples for the following technologies: 8 | 9 | ### Ansible 10 | - `roles/` - Contains Ansible roles 11 | - `invs/` - Inventory files for Ansible 12 | - `collections/` - Ansible collections 13 | - `ping.yml` - Basic Ansible playbook for connectivity testing 14 | - `build.yml` - Build automation playbook 15 | - `deploy.yml` - Deployment automation playbook 16 | 17 | ### Terraform 18 | - `demo.tf` - Example Terraform configuration demonstrating local file resource 19 | - `terragrunt.hcl` - Terragrunt configuration file 20 | 21 | ### System Information Scripts 22 | - `print_system_info.sh` - Bash script for system information gathering 23 | - Detects operating system 24 | - Displays CPU information 25 | - Shows memory usage 26 | - Reports disk space 27 | 28 | ### Stress Tests 29 | Located in the `stress-tests/` directory, these files are designed to test system performance and resource utilization: 30 | - `test.tf` - Terraform-based stress test 31 | - Creates multiple null resources (default: 100) 32 | - Generates dummy files to test file system performance 33 | - Uses local-exec provisioner to simulate workload 34 | - Configurable resource count through variables 35 | - `test.yml` - Ansible-based stress test playbook 36 | 37 | ## Prerequisites 38 | 39 | - Ansible (for Ansible examples) 40 | - Terraform (for Terraform examples) 41 | - Bash shell (for shell scripts) 42 | - PowerShell 5.1+ (for PowerShell scripts) 43 | - Python 3.x (for Python examples) 44 | 45 | ## Usage 46 | 47 | ### Ansible Examples 48 | ```bash 49 | # Run the ping playbook 50 | ansible-playbook -i invs/hosts ping.yml 51 | 52 | # Execute build automation 53 | ansible-playbook build.yml 54 | 55 | # Run deployment 56 | ansible-playbook deploy.yml 57 | ``` 58 | 59 | ### Terraform Examples 60 | ```bash 61 | # Initialize Terraform 62 | terraform init 63 | 64 | # Apply the configuration 65 | terraform apply 66 | ``` 67 | 68 | ### System Information Scripts 69 | 70 | #### Bash Script (Linux/macOS) 71 | ```bash 72 | # Make the script executable 73 | chmod +x print_system_info.sh 74 | 75 | # Run the script 76 | ./print_system_info.sh 77 | ``` 78 | 79 | #### PowerShell Script (Windows) 80 | ```powershell 81 | # Run the script 82 | .\print_system_info.ps1 83 | ``` 84 | 85 | ### Stress Tests 86 | ```bash 87 | # Navigate to stress tests directory 88 | cd stress-tests 89 | 90 | # Run Terraform stress test 91 | terraform init 92 | terraform apply 93 | 94 | # Run Ansible stress test 95 | ansible-playbook test.yml 96 | ``` 97 | 98 | ## Contributing 99 | 100 | Feel free to submit issues and enhancement requests! 101 | 102 | ## License 103 | 104 | MIT © [Denis Gukov](https://github.com/fiftin) 105 | -------------------------------------------------------------------------------- /build.yml: -------------------------------------------------------------------------------- 1 | - hosts: builder 2 | roles: 3 | - build -------------------------------------------------------------------------------- /collections/requirements.yml: -------------------------------------------------------------------------------- 1 | --- 2 | collections: 3 | - pureport.fabric 4 | - community.general 5 | -------------------------------------------------------------------------------- /demo.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | local = { 4 | source = "hashicorp/local" 5 | version = "~> 2.0" 6 | } 7 | } 8 | } 9 | 10 | provider "local" {} 11 | 12 | variable "file_content" { 13 | description = "The content to write to the local file" 14 | type = string 15 | default = <