Git Product home page Git Product logo

ansible-drac's Introduction

Ansible Playbooks for DRACs

This collection of playbooks automates common DRAC tasks. It has been tested on DRAC v5 and some newer versions.

You'll need to have ansible installed to use these playbooks.

See below for setup, a description of each, and how to run them.

Playbooks

In general you can run ansible-playbook with the name of the playbook YAML file.

All commands have these common arguments (see ansible-playbook -h for more info):

-f # - run # threads at once (ansible default is currently 5)
-i <inventory file> - path to ini-style inventory file (see example-hosts)
-l <group> - group or host in inventory file to limit operations to

Example:

ansible-playbook -f 15 -i example-hosts -l google ping.yml

auto-attach-enable

Enables virtual media auto-attaching (required for remote files to work).

debug

Connects and runs a "noop" command, printing full response from the remote.

The debug playbook is useful as a quick "status" check. The tasks will almost always succeed but the output will tell you if the DRAC is responding, etc.

only-allow-ssh

Limit DRAC services to ssh.

NOTE: This playbook will execute racadm racreset at the end of a successful run. You may want to test this on a single DRAC first. :)

ping

Tests basic pingability of the DRAC from the local system. Running the above example should result in some successful and some failed pings.

racadm

Checks to see if racadm is runnable.

racreset

Runs a racreset on each DRAC.

set-root-password

Sets the root password to the provided value. Run it with an additional argument like this (replace newpassword with your desired password):

ansible-playbook -e "root_password=newpassword" -i example-hosts set-root-password.yml

NOTE: Use a 20 character or less password for maximum compatibility.

web-ui-enable/disable

Enables or disables the web UI.

Bastions

If you proxy through a "bastion" (shell, jumpbox, etc.) system to access the DRACs then do the following:

  1. cp ssh_config.example ssh_config
  2. change username to your username (or remove those lines if they match your login user)
  3. change bastion.*.com and bastion.zero.com to the actual host/wildcard that matches your configuration
  4. uncomment the the denoted line in ansible.cfg

At this point ansible runs should use the alternate ssh_config that tunnels connections through your bastion/jumpbox.

Debugging

To add debug output to any task add the following:

  register: result
- debug: var=result

See the debug.yml playbook for a complete example.

You can also use -vvv with the ansible-playbook command for additional debug output.

Notes / Caveats

  • running exit as a command confuses ansible-playbook when using a bastion/ssh_proxy setup (ansible ad-hoc will run it just fine though)
  • if you setup an ssh proxy config in a separate file (e.g. not your ~/.ssh/config) remember to also refer to that same config file via -F <ssh_config> when specifying the ProxyCommand (or the subsequent ssh will use your default config instead)

TODO

  • add tests (need a remote drac simulator!)
  • handle more failure cases
  • add cipher0 check/fix
  • conditionally update settings (check first, apply only if needed..maybe we can add custom drac facts?)
  • find cases where we show success but actually failed still :(
  • add link to RS-specific info on how to generate drac-hosts inventory

ansible-drac's People

Contributors

jguice avatar

Watchers

James Cloos avatar Zach Al-Nasser 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.