All Projects → DexterPOSH → PSRemotely

DexterPOSH / PSRemotely

Licence: MIT license
Remote operations validation framework, exposes a DSL to wrap existing Pester/PoshSpec based validation tests.

Programming Languages

powershell
5483 projects
Batchfile
5799 projects

Projects that are alternatives of or similar to PSRemotely

Runbook
A framework for gradual system automation
Stars: ✭ 531 (+1080%)
Mutual labels:  operations
Control Tower
Deploy and operate Concourse CI in a single command
Stars: ✭ 105 (+133.33%)
Mutual labels:  operations
Akka Management
Akka Management is a suite of tools for operating Akka Clusters.
Stars: ✭ 218 (+384.44%)
Mutual labels:  operations
Spug
开源运维平台:面向中小型企业设计的轻量级无Agent的自动化运维平台,整合了主机管理、主机批量执行、主机在线终端、文件在线上传下载、应用发布部署、在线任务计划、配置中心、监控、报警等一系列功能。
Stars: ✭ 6,810 (+15033.33%)
Mutual labels:  operations
Recurring Integrations Scheduler
Recurring Integrations Scheduler (RIS) is a solution that can be used in file-based integration scenarios for Dynamics 365 Finance and Dynamics 365 Supply Chain Management.
Stars: ✭ 96 (+113.33%)
Mutual labels:  operations
Reckoner
Declaratively install and manage multiple Helm chart releases
Stars: ✭ 177 (+293.33%)
Mutual labels:  operations
Portion
portion, a Python library providing data structure and operations for intervals.
Stars: ✭ 255 (+466.67%)
Mutual labels:  operations
documentation
BHoM Docs
Stars: ✭ 69 (+53.33%)
Mutual labels:  operations
Honcho
Honcho: a python clone of Foreman. For managing Procfile-based applications.
Stars: ✭ 1,395 (+3000%)
Mutual labels:  operations
Flow
Operation Oriented Programming in Swift
Stars: ✭ 215 (+377.78%)
Mutual labels:  operations
Keptn
Cloud-native application life-cycle orchestration. Keptn automates your SLO-driven multi-stage delivery and operations & remediation of your applications.
Stars: ✭ 755 (+1577.78%)
Mutual labels:  operations
Trusted Overlord
Aggregate AWS Trusted Advisor alarms, AWS Health notifications and AWS Support cases from several AWS accounts
Stars: ✭ 73 (+62.22%)
Mutual labels:  operations
Cloud Ops Sandbox
Cloud Operations Sandbox is an open source tool that helps practitioners to learn Service Reliability Engineering practices from Google and apply them on their cloud services using Cloud Operations suite of tools.
Stars: ✭ 191 (+324.44%)
Mutual labels:  operations
Vulcanizer
GitHub's ops focused Elasticsearch library
Stars: ✭ 608 (+1251.11%)
Mutual labels:  operations
crowbar-core
Core deployment for Crowbar
Stars: ✭ 16 (-64.44%)
Mutual labels:  operations
Rundeck
Enable Self-Service Operations: Give specific users access to your existing tools, services, and scripts
Stars: ✭ 4,426 (+9735.56%)
Mutual labels:  operations
Juju
Universal Operator Lifecycle Manager (OLM) for Kubernetes operators, and operators for traditional Linux and Windows apps, with declarative integration between operators for automated microservice integration.
Stars: ✭ 1,942 (+4215.56%)
Mutual labels:  operations
VAOS
Virtual Aviation Operations System
Stars: ✭ 44 (-2.22%)
Mutual labels:  operations
terraform-google-bootstrap
Bootstraps Terraform usage and related CI/CD in a new Google Cloud organization
Stars: ✭ 152 (+237.78%)
Mutual labels:  operations
Satellite
easy-to-use payload hosting
Stars: ✭ 193 (+328.89%)
Mutual labels:  operations

Build status Documentation Status GitPitch

alt

PSRemotely, started as a fork of the Remotely project and over the time grew out of it. In a nutshell it let's you execute Pester tests against a remote machine. PSRemotely can use PoshSpec style infrastucture validation tests too.

Note - In the code & documentation the term 'Remotely' and 'PSRemotely' refer to the same.

It supports copying of the modules and artifacts to the remote node before the Pester tests are run.

Description

PSRemotely exposes a DSL which makes it easy to run Pester tests on the remote nodes. If you already have pester tests then you need to just wrap them inside the PSRemotely keyword and specify the node information using the Node keyword.

PSRemotely workflow is as under :

  1. Read PSRemotely.json file to determine the path & modules to be used on the remote nodes.
  2. Bootstrap the remote nodes, this involves
    • Testing the remote node path exists.
    • All the modules required are copied from the Lib/ folder to the remote node.
  3. Drop the Pester tests (Describe blocks) as individual tests file on the remote node. Also copy the items defined in the PSRemotely.json, which are placed under Artifacts/ folder inside local PSRemotely folder.
  4. Invoke the tests using background jobs on the remote nodes and wait for these jobs to complete, finally process and output a JSON object back.
  5. It also exports a global variable named $PSRemotely to which the Node bootstrap map and PSSession information is stored.

Remote Ops validation

Well this is a term coined by us for some of the infrastucture validation being done for Engineered solutions. So taking liberty to use this here.

Suppose, you already have below Pester test for some nodes in our environment:

Describe 'Bits Service test' {
    
    $BitsService = Get-Service -Name Bits
    
    It "Should have a service named bits" {
        $BitsService | Should Not BeNullOrEmpty
    }
    
    it 'Should be running' {
        $BitsService.Status | Should be 'Running'
    }
}

If you want to target the very same tests on the remote node named say AD,WDS & DHCP from your current workstation (part of the same domain), you can use PSRemotely.

Usage with PSRemotely:

PSRemotely {
	
    Node AD, WDS, DHCP {
		
        Describe 'Bits Service test' {
		
            $BitsService = Get-Service -Name Bits
            
            It "Should have a service named bits" {
                $BitsService | Should Not BeNullOrEmpty
            }
            
            It 'Should be running' {
                $BitsService.Status | Should be 'Running'
            }
        }		
	}
}

Once you have the tests file ready , save it with a .PSRemotely.ps1 extension, below is how you invoke the PSRemotely framework to start the remote ops validation :

Invoke-PSRemotely -Script <FileName>.PSRemotely.ps1

Output of the above is a JSON object, if the tests pass then an empty JSON object array of TestResult is returned otherwise the Error record thrown by Pester is returned :

{
    "Status":  true,
    "NodeName":  "WDS",
    "Tests":  [
                  {
                      "TestResult":  [

                                     ],
                      "Result":  true,
                      "Name":  "Bits Service test"
                  }
              ]
}
{
    "Status":  true,
    "NodeName":  "AD",
    "Tests":  [
                  {
                      "TestResult":  [

                                     ],
                      "Result":  true,
                      "Name":  "Bits Service test"
                  }
              ]
}
{
    "Status":  true,
    "NodeName":  "DHCP",
    "Tests":  [
                  {
                      "TestResult":  [

                                     ],
                      "Result":  true,
                      "Name":  "Bits Service test"
                  }
              ]
}

Initial PSRemotely setup

# One time setup
    # Download the repository
    # Unblock the zip
    # Extract the PSRemotely folder to a module path (e.g. $env:USERPROFILE\Documents\WindowsPowerShell\Modules\)

    #Simple alternative, if you have PowerShell 5, or the PowerShellGet module:
        Install-Module PSRemotely

# Import the module.
    Import-Module PSRemotely    # Alternatively, Import-Module \\Path\To\PSRemotely

# Get commands in the module
    Get-Command -Module PSRemotely

# Get help for the module and a command
    
    Get-Help Invoke-PSRemotely -full

More Information

The PSRemotely docs will include more information, including :

  • PSRemotely Basics
  • PSRemotely Examples
  • PSRemotely How Tos

Notes

Thanks goes to :

  • Remotely project
  • Ravikanth Chaganti - For all the help with the ideas and motivation behind the scenes.
  • Warren Frame's PSDeploy module - have been following Warren's module & documentation structure to organize.
  • [Pester module] (https://github.com/pester/pester), PSDesiredStateConfiguration module for borrowing some of the ideas.
  • PowerShell community & fellow MVPs, who are fantastic at helping each other.

TO DO

PSRemotely in its current form works for our needs to validate some of the Engineered solutions. But it has the potential to grow into something bigger, below are some of the items in the wishlist :

  • Use PowerShell classes, and add support for providers for nodes running either On-prem or on Cloud (AWS or Azure).
  • Integrate with JEA, since PSRemotely uses PSSession endpoints these can be locked down using JEA on the nodes.
  • More unit tests, lacking far behind in this aspect. More focus on it once we start working with the classes implementation.
  • Faster background processing of the remote node jobs, using runspaces.

Feel free to submit any ideas, bugs or pull requests.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].