ops-cli | cli wrapper Terraform , Ansible , Helmfile and SSH | Infrastructure Automation library

 by   adobe Python Version: 2.2.1 License: Apache-2.0

kandi X-RAY | ops-cli Summary

kandi X-RAY | ops-cli Summary

ops-cli is a Python library typically used in Devops, Infrastructure Automation, Ansible, Docker, Terraform applications. ops-cli has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has low support. You can install using 'pip install ops-cli' or download it from GitHub, PyPI.

ops-cli is a python wrapper for Terraform, Ansible and SSH for cloud automation. We use multiple tools to manage our infrastructure at Adobe. The purpose of ops-cli is to gather the common cluster configurations in a single place and, based on these, interact with the above mentioned tools. In this way, we can avoid duplication and can quickly spin up new clusters (either production or development ones). All we need to do is customize the cluster configuration file (example here). ops-cli integrates with the Azure and AWS cli, in order to provide inventory, ssh, sync, tunnel and the possibility to run ansible playbooks on a fleet of EC2 instances. It can be used to add a layer of templating (using jinja2) on top of Terraform files. This is useful for removing duplicated code when it comes to spinning up infrastructure across multiple environments (stage/sandbox/prod) and across teams. Useful for both AWS and Kubernetes deployments.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              ops-cli has a low active ecosystem.
              It has 183 star(s) with 39 fork(s). There are 25 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 7 open issues and 28 have been closed. On average issues are closed in 20 days. There are 13 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of ops-cli is 2.2.1

            kandi-Quality Quality

              ops-cli has 0 bugs and 0 code smells.

            kandi-Security Security

              ops-cli has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              ops-cli code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              ops-cli is licensed under the Apache-2.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              ops-cli releases are available to install and integrate.
              Deployable package is available in PyPI.
              Build file is available. You can build the component from source.
              Installation instructions are not available. Examples and code snippets are available.
              ops-cli saves you 2207 person hours of effort in developing the same functionality from scratch.
              It has 5020 lines of code, 391 functions and 66 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed ops-cli and discovered the below as its top functions. This is intended to give you an instant insight into ops-cli implemented functionality, and help decide if they suit your requirements.
            • List credentials
            • Get a list of messages by type
            • Get response dictionary
            • Send a request
            • Run ansible_SSH command
            • Checks if the given argument is in the given container
            • Execute ansible - playbook
            • Create a path expression with the given user and path
            • Configure the server
            • Configure common arguments
            • Generate legacy pcs
            • Generate the Helmfile configuration
            • Configure the command line arguments
            • Returns the host info
            • Generate the ssh proxy port
            • Load the ssh keys
            • Enables skms session optimization
            • Generate the ssh keypair
            • Parse CLI arguments
            • Get authentication credentials
            • Run packer
            • Returns the inventory for the resource group
            • Return a templar instance
            • Load the settings
            • Execute cns plugin
            • Render the configuration
            Get all kandi verified functions for this library.

            ops-cli Key Features

            No Key Features are available at this moment for ops-cli.

            ops-cli Examples and Code Snippets

            No Code Snippets are available at this moment for ops-cli.

            Community Discussions

            QUESTION

            Az Devops Commands Failing in Azure Pipelines (Classic)
            Asked 2021-Oct-06 at 12:52

            I am at a loss as to why I cannot run a basic az devops command in an Azure Pipeline using the Classic template.

            So basically, I have two Powershell tasks defined for my Classic pipeline and these are:

            Task 1: Login to my Azure DevOps organisation using the following commands:

            ...

            ANSWER

            Answered 2021-Oct-06 at 12:04

            Maybe there is a product issue recently, as the Azure CLI should work, it worked for me last month, see here.

            For now, if you want to list the projects, you could call the REST API Projects - List directly in PowerShell task.

            Source https://stackoverflow.com/questions/69461765

            QUESTION

            Unable to run az pipeline commands within Azure DevOps Task
            Asked 2021-Feb-11 at 14:17

            Trying to dynamically retrieve all the variables from a variable group via Azure DevOps task in a YAML Pipeline. Originally tried leveraging the AzureCLI@2 task with the following code to retrieve the variableGroupID which would be used to get the variables inside of it:

            ...

            ANSWER

            Answered 2021-Feb-11 at 06:33

            You can use the REST API instead of Azure CLI to get the information. It can be used with the standard tools already present on the Microsoft Hosted agents. It requires only vanilla powershell or powershell core, meaning to works on both windows and linux agents. The below example was successfully tested on windows-latest/windows-2019 and ubuntu-latest/ubuntu-20.04

            The approach is the same as with Azure CLI.

            1. List all available groups filtered by name to retrieve the variable group in question
            2. Get all variables in the variable group using the variable group id from step

            In fact, the pipeline also has an out of the box PAT token available with read access to variable groups. It is stored in the variable System.AccessToken. Using that instead of a manually managed one will further simplify things.

            The script below is executed in a pwsh step, which is the built in Powershell task in Powershell core mode

            Source https://stackoverflow.com/questions/66039377

            QUESTION

            how to trigger azure pipelines through rest api
            Asked 2020-Nov-20 at 13:55

            I want to trigger a specific Azure pipeline through REST API. I have checked this documentation . So the core message will be:

            ...

            ANSWER

            Answered 2020-Nov-20 at 13:37

            pipelineId is equal to definitionId

            So please go to your pipeline and check url like this https://dev.azure.com/thecodemanual/DevOps%20Manual/_build?definitionId=177.

            Or use this endpoint to get list of deifnitions:

            Source https://stackoverflow.com/questions/64930191

            QUESTION

            How to connect a branch to a work item via DevOps CLI or API
            Asked 2020-Oct-29 at 09:53

            I want to be able to connect an existing branch in a git repo to a work item in Azure DevOps, via CLI or API or any way that isn't the UI (I do that all day long in the UI and want to make a script instead). I found this open issue in GitHub: https://github.com/Azure/azure-devops-cli-extension/issues/153

            My take-away from this is that this feature is not implemented in the extension. Instead, I turned to the REST API. But I can't figure out how to do what I want. Creating a new branch and connect it in the same operation would be ok as well, but preferably I want to just connect an existing branch.

            Any help pointing me in the right direction would be greatly appreciated.

            ...

            ANSWER

            Answered 2020-Oct-29 at 09:53

            The documentation does not contain explnaition of your issue, but you can try this example with rest API through PowerShell:

            Source https://stackoverflow.com/questions/64569717

            QUESTION

            How to securely login in Az CLI from a DevOps Pipeline
            Asked 2020-Oct-23 at 14:44

            I want to execute AZ cli commands from my Azure DevOps Pipeline. In my YAML file I have this:

            ...

            ANSWER

            Answered 2020-Oct-23 at 14:44

            No, you don't need az devops login. What you need is Azure CLI Task:

            Source https://stackoverflow.com/questions/64502148

            QUESTION

            create a PR request in azure build pipeline
            Asked 2020-Sep-02 at 16:52

            Say we have following branches:

            1. Master
            2. Sprint
            3. Stories

            Stories can be merged to sprint (for sprint items) or Master (for hotfix) and we want is this:

            1. Sprint branch to be deployed to PreProd Environment
            2. If QA is happy, sprint branch will be merged to master and then deployed to UAT, then QA.

            We wants to protect master or sprint branch, so they can only be changed via PR request.

            Other than QA manually create a PR and then merge to master branch, I would like to do it in a build task. So I tried to use Azure CLI task to run a batch:

            ...

            ANSWER

            Answered 2020-Sep-02 at 16:52

            And if it is ok, how can I create and finish a PR request in build pipeline?

            Solution 1

            The easiest way would be to use Create Pull Request Task with "Set Auto Complete" option checked.

            Solution 2

            If you want to do it from CLI, generate PAT Token:

            Save it as secret variable:

            An use powershell to save it as env variable

            Source https://stackoverflow.com/questions/63647052

            QUESTION

            Self Hosted Azure DevOps Pipeline Agent fails with error Token Audience is not valid
            Asked 2020-Jul-01 at 15:43

            I have created a new token with Agent Pool read and manage permissions. I have created a new agent pool lnx_agent wherein I have administrator role to manage it. When I download tar file of agent linux x64 from this link https://vstsagentpackage-azureedge-net.o365.example-domain.defendernet.com/agent/2.171.1/vsts-agent-linux-x64-2.171.1.tar.gz, copy it to bastion host, unpack it and execute ./config.sh with URL, PAT token, agent pool as lnx_agent and default agent name as bastion_agent; I have below error message.

            ...

            ANSWER

            Answered 2020-Jun-29 at 04:25

            Firstly, please make sure you can access the Azure DevOps organization (https://dev.azure.com/{organization}) from the bastion host. Otherwise we cannot connect to the Azure DevOps services.

            Secondly, please check if you are running a firewall or a proxy on the bastion host. If you're running an agent in a secure network behind a firewall, make sure the agent can initiate communication with the URLs and IP addresses mentioned in below documents.

            Source https://stackoverflow.com/questions/62628017

            QUESTION

            Azure devops pipeline - trigger only on another pipeline, NOT commit
            Asked 2020-Apr-23 at 23:51

            Requirement

            So, there is some newish functionality in Azure DevOps which allows pipelines to trigger other pipelines and is documented here: https://docs.microsoft.com/en-us/azure/devops/pipelines/build/triggers?view=azure-devops&tabs=yaml#pipeline-triggers-1 It sounds great, apart from the fact I can't get the behaviour I need. I want 2 pipelines in the same repository:

            • Pipeline A: is only triggered by multiple other pipelines outside of its own repo, but in the same project. As a result of being triggered it makes a change to its own repo and therefore triggers pipeline B.
            • Pipleline B: is only triggered by changes to its own repo and when triggered goes ahead and does whatever it needs to do

            Pipeline A Syntax

            ...

            ANSWER

            Answered 2020-Jan-07 at 23:01

            Working Solution

            Because all of my builds are centralised in one pipeline template, I changed this template to trigger my pipeline A on successful publishing of an artifact. Here's the pipeline trigger code which is pretty much verbatim from (https://docs.microsoft.com/en-us/azure/devops/cli/azure-devops-cli-in-yaml?view=azure-devops), apart from the last couple of steps:

            Source https://stackoverflow.com/questions/59583099

            QUESTION

            az devops login Failed to store PAT using keyring; falling back to file storage
            Asked 2020-Apr-08 at 06:57

            I've installed AZ DEVOPS extension from az cli

            ...

            ANSWER

            Answered 2020-Apr-08 at 06:57

            As a prerequisite,your Azure CLI version must be 2.0.49 at a minimum. You can use az --version to validate.

            After you add az extension, you could also run az login to sign in.

            If you have already signed in with az login interactively or using user name and password, then you don't have to provide a token as az devops commands now support sign in through az login.

            When you are using az devops login command, first make sure you are using Azure DevOps Service organization URL. Example: https://dev.azure.com/MyOrganizationName. Azure DevOps Server/TFS is not support at present.

            For Azure DevOps tokens, you need to make sure it's valid and with enough scopes for this token to authorize for your specific tasks.

            More details please refer our official tutorial here-- Sign in with a Personal Access Token (PAT)

            Source https://stackoverflow.com/questions/61086877

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install ops-cli

            You can install using 'pip install ops-cli' or download it from GitHub, PyPI.
            You can use ops-cli like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.

            Support

            Permission issues when installing: you should install the tool in a python virtualenv. Exception when running: ops pkg_resources._vendor.packaging.requirements.InvalidRequirement: Invalid requirement, parse error at "'!= 2.4'". Caused by a broken paramiko version, reinstall paramiko: pip2 uninstall paramiko; pip2 install paramiko.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            Install
          • PyPI

            pip install ops-cli

          • CLONE
          • HTTPS

            https://github.com/adobe/ops-cli.git

          • CLI

            gh repo clone adobe/ops-cli

          • sshUrl

            git@github.com:adobe/ops-cli.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Consider Popular Infrastructure Automation Libraries

            terraform

            by hashicorp

            salt

            by saltstack

            pulumi

            by pulumi

            terraformer

            by GoogleCloudPlatform

            Try Top Libraries by adobe

            brackets

            by adobeJavaScript

            react-spectrum

            by adobeTypeScript

            antialiased-cnns

            by adobePython

            leonardo

            by adobeJavaScript

            balance-text

            by adobeJavaScript