GithubHelp home page GithubHelp logo

goryszewskig / ansible-playbook-examples Goto Github PK

View Code? Open in Web Editor NEW

This project forked from purestorage-openconnect/ansible-playbook-examples

0.0 1.0 0.0 429 KB

Ansible playbook samples using Rest API calls for Pure Storage products

License: Apache License 2.0

PowerShell 0.42% Python 39.17% Shell 19.65% HTML 40.75%

ansible-playbook-examples's Introduction

Introduction

This repository contains a number of simple Ansible playbooks using both the PUREFA and PUREFB modules to issue commands to Pure Storage FlashArrays or FlashBlades.

The following items are assumed by all playbooks:

  • The user has a working knowledge of Ansible and Ansible Playbooks
  • Minimum Ansible version is denoted in the README or the actual playbooks.
  • Your Pure Storage FlashArray or FlashBlade should be accessible from your local Ansible host.
  • You have obtained a privileged API token from the Pure Storage FlashArray or FlashBlade that will be used by the playbooks.

FlashArray and FlashBlade modules are natively included in Ansible and are obtained by installing the latest Ansible package:

# pip install ansible

FlashArray Playbooks

Customizing Playbooks for your environment

Playbooks must contain the following variables:

  • fa_url
  • api_token

where fa_url is the Management VIP of your FlashArray and api_token is obtained from a FlashArray for specific users using the GUI interface in Settings -> Users and select Show API Token... from the 3 elipses on the right side of the display, next to the user you require the token for. You may also get the api_token by executing the following Purity command after using SSH to log directly onto the array:

# pureadmin list <username> --api-token --expose

Note: You can only expose the API token for the username you re logged in as on both the GUI and the CLI.

It is adviseable to use these variables per play when working with multiple FlashArrays, however you may also use environment variables to set these values externally to playbooks so they are not needed in the playbook. This is useful when configuring only one FlashArray.

The environment varaibles are:

  • PUREFA_URL
  • PUREFA_API

FlashBlade Playbooks

Customizing Playbooks for your environment

Playbooks must contain the following variables:

  • fb_url
  • api_token

where fb_url is the Management VIP of your FlashBlade and api_token is obtained from a FlashBlade for specific users by running the following Purity command after using SSH to log directly onto the FlashBlade:

# pureadmin list <username> --api-token --expose

Note: You can only expose the API token for the username you re logged in as.

It is adviseable to use these variables per play when working with multiple FlashBlades, however you may also use environment variables to set these values externally to playbooks so they are not needed in the playbook. This is useful when configuring only one FlashArray.

The environment varaibles are:

  • PUREFB_URL
  • PUREFB_API

Running Playbooks

After modifying your playbooks you can execute them by using:

$ ansible-playbook <playbook-name>.yaml

ansible-playbook-examples's People

Contributors

mahendra-maplelabs avatar sdodsley avatar raekins avatar rlondner avatar keshavattrey avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.