Extending SaltStack.
Extend the power of your infrastructure and applications with Salt modulesAbout This Book Get the most up-to-date practical resource on writing new Salt modules and extending Salt Learn through use cases and encounter both commonly-used modules as well as advanced ones Effectively troubleshoot probl...
Clasificación: | Libro Electrónico |
---|---|
Autor principal: | |
Formato: | Electrónico eBook |
Idioma: | Inglés |
Publicado: |
Birmingham :
Packt Publishing, Limited
March 2016.
|
Temas: | |
Acceso en línea: | Texto completo |
Tabla de Contenidos:
- Cover
- Copyright
- Credits
- Foreword
- About the Author
- About the Reviewer
- www.PacktPub.com
- Table of Contents
- Preface
- Chapter 1: Starting with the Basics
- Using plugins
- Loading modules
- Standard modules
- Virtual modules
- Lazy loading modules
- Extending the loader system
- Loading modules with Python
- Detecting grains
- Using other detection methods
- Summary
- Chapter 2: Writing Execution Modules
- Writing Salt modules
- Hidden objects
- The __virtual__() function
- Formatting your code
- Virtual modules
- Using the salt.utils library
- Cross-calling with the __salt__ dictionary
- Getting configuration parameters
- Handling imports
- Reusing code
- Logging messages
- Using the __func_alias__ dictionary
- Validating data
- Formatting strings
- The final module
- Troubleshooting execution modules
- Using salt-call
- is not available
- Summary
- Chapter 3: Extending Salt Configuration
- Setting grains dynamically
- Setting some basic grains
- (Not) cross-calling execution modules
- The final grains module
- Creating external pillars
- Configuring external pillars
- Adding an external pillar
- Another external pillar
- Troubleshooting grains and pillars
- Dynamic grains not showing up
- External pillars not showing up
- Writing SDB modules
- Getting SDB data
- Setting SDB data
- Using a descriptive docstring
- Using more complex configuration
- The final SDB module
- Using SDB modules
- Troubleshooting SDB modules
- SDB data not showing up
- Summary
- Chapter 4: Wrapping States Around Execution Modules
- Forming a state module
- Determining state
- The __virtual__() function
- Setting up defaults
- Checking for truth
- Checking for test mode
- Attempting to configure the resource
- Notifying about False
- Example: checking an HTTP service.
- Checking credentials
- The first stateful function
- Another stateful function
- Troubleshooting state modules
- Step 1: test for truth
- Step 2: test mode
- Step 3: applying changes
- Testing opposites
- Summary
- Chapter 5: Rendering Data
- Understanding file formats
- Serializing data
- Working with templates
- Using render pipes
- Building a serializing renderer
- The basic structure
- Building a templating renderer
- Templating with Tenjin
- Using a templating renderer
- Troubleshooting renderers
- Summary
- Chapter 6: Handling Return Data
- Returning data to external destinations
- Returning data to the master
- Listening to event data
- When returners listen to Minions
- Your first returner
- Using job caches
- The final module
- Troubleshooting returners
- Testing with salt-call
- Testing with the Master running
- Testing with runners
- Writing outputter modules
- Pickling our output
- Troubleshooting outputters
- Summary
- Chapter 7: Scripting with Runners
- Using Salt's local client
- Scripting with the local client
- Using different targets
- Combining jobs to add more logic
- The final module
- Troubleshooting runners
- Working with the salt-master service
- Timeout issues
- Summary
- Chapter 8: Adding External File Servers
- How Salt uses files
- Mimicking a filesystem
- Looking at each function
- Setting up our module
- envs()
- file_list() and dir_list()
- find_file()
- serve_file()
- update()
- file_hash()
- The final module
- Troubleshooting file servers
- Start small
- Test on a Minion
- Summary
- Chapter 9: Connecting to the Cloud
- Understanding cloud components
- Looking at the puzzle pieces
- Connection mechanism
- Listing resources
- Creating virtual machines
- Managing other resources
- Libcloud versus SDK versus direct REST API.
- Writing a generic cloud module
- Checking for required configuration
- Using http.query()
- A common REST API
- GET
- POST
- PATCH
- DELETE
- Setting up a _query() function
- Getting profile details
- Listing images
- Listing sizes
- Listing locations
- Listing nodes
- Querying standard node data
- Querying full node data
- Creating a VM
- Destroying VMs
- Using actions and functions
- Using actions
- Using functions
- The final cloud module
- Troubleshooting cloud modules
- Write avail_sizes() or avail_images() first
- Use shortcuts
- Summary
- Chapter 10: Monitoring with Beacons
- Watching for data
- Keeping an eye on things
- Validating configuration
- The beacon() function
- Watching for beacons
- The final beacon module
- Troubleshooting beacons
- Summary
- Chapter 11: Extending the Master
- Using external authentication
- Authenticating credentials
- Troubleshooting external authentication
- Setting auth parameters
- Testing with the salt command
- Testing with Salt API
- Managing the Master with the wheel modules
- Wrapping a wheel around runners
- The final wheel module
- Troubleshooting wheel modules
- Summary
- Appendix A : Connecting Different Modules
- Separating Master and Minion functionality
- Working with dunders
- Using the event bus
- Firing events
- Appendix B: Contributing Code Upstream
- How the community works
- Asking questions and reporting issues
- Using the mailing list
- Using IRC
- Using the issue tracker
- Using GitHub markdown
- Understanding the Salt Style Guide
- Using Pylint
- Creating pull requests on GitHub
- Using other branches
- Understanding test errors in pull requests
- Index
- Untitled.