GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing docs.stackstorm.com — Packs — StackStorm 3.9.0 documentation PacksWhat is a Pack?A “pack” is the unit of deployment for integrations and automations that extend StackStorm. Typically a pack is organized along service or product boundaries e.g. AWS, Docker, Sensu etc. A pack can contain Actions, Workflows, Rules, Sensors, and Aliases. StackStorm content is always part of a pack, so it’s important to understand how to create packs and work with them. Some packs extend StackStorm to integrate it with external systems — like AWS, GitHub, or JIRA. We call them “integration packs”. Some packs capture automation patterns — they contain workflows, rules, and actions for a specific automation process — like the st2 demo pack. We call them “automation packs”. This naming is mostly a convention: StackStorm itself makes no distinction between the two. Integration packs can be shared and reused by anyone who uses the service that pack is built for. You can find many examples of these at the StackStorm Exchange. Automation packs are often very site-specific and have little use outside of a particular team or company; they are usually shared internally. Managing PacksStackStorm packs are managed through Some (such as the
# List all installed packs st2 pack list # Get detailed information about an installed pack st2 pack get core When using StackStorm and pack management actions, all packs are installed into the system packs
directory, which defaults to Discovering PacksThere’s over a hundred StackStorm packs already available to you!
StackStorm Exchange is a collection of ready-made packs
submitted and maintained by the StackStorm community. There are packs for most of the popular
cloud providers and DevOps tools, as well as more peculiar integrations (hello, You can browse the pack listing at exchange.stackstorm.org,
or search the pack index via CLI with # Search query is applied across all pack parameters. # It will search through pack names: st2 pack search sensu # And keywords: st2 pack search monitoring # And description (use quotes for multi-word search): st2 pack search "Amazon Web Services" # And even pack author: st2 pack search "Jon Middleton" # Show an index entry for the pack # with the exact name match st2 pack show sensu As of StackStorm v2.4, you can also do this via the Web UI! Explore the new “Packs” tab to see more. Installing a PackInstalling a pack is simple: # Install from the Exchange by pack name st2 pack install sensu # You can also install multiple packs: st2 pack install datadog github This command will download packs from the StackStorm Exchange organization on GitHub, place them under Essentially, # Install your own pack from git using http(s) st2 pack install https://github.com/emedvedev/chatops_tutorial # Install your own pack from git using ssh st2 pack install [email protected]/emedvedev/chatops_tutorial # Install your own pack using gitlab URL (added in release 3.4) st2 pack install [email protected]:example/examplepack By default, the latest release of the pack will be installed, but you can specify a particular version, branch, tag, or even a commit hash. Just use =: # Fetch a specific commit st2 pack install cloudflare=776b9a4 # Or a version tag st2 pack install cloudflare=0.1.0 # Or a branch st2 pack install https://github.com/emedvedev/chatops_tutorial=testing Finally, you can install a pack from existing local dir: # Install a pack from '/home/stanley/bitcoin' dir st2 pack install file:///home/stanley/bitcoin Warning Installing a pack from a directory that is a git repository will only install the latest commit, and ignores any subsequent uncommitted changes to the files. Running Pack DependenciesNote New feature! As of StackStorm 3.2. If your pack uses actions from other packs, you can specify them in the Similar to using the dependencies: - excel - powerpoint=0.2.2 - https://github.com/StackStorm/stackstorm-ms.git If you have dependency conflicts, the st2 pack install --skip-dependencies my-custom-pack Uninstalling a PackTo uninstall a pack, use st2 pack remove sensu Configuring a PackIntegration packs often require configuration for your environment. For example, you need to specify an SMTP server to use the email pack, a puppet master URL to use the Puppet pack, or a Keystone endpoint and tenant credentials for OpenStack. Most packs that require configuration can be configured interactively: st2 pack config cloudflare You will be prompted for configuration parameters in an interactive tool with descriptions,
suggestions, and defaults. You will also be asked to verify your final config file in a text editor
before saving it; it’s optional, and most packs don’t require more than two or three fields, but we
have to comply with Health and Safety. The generated file will be placed in
Warning NB: StackStorm loads pack configuration into MongoDB. This is automatically loaded when you use
You can do this with: Trust us. We’ve all been there. For more nice tricks on pack configuration, see Pack Configuration. Overriding Pack DefaultsWhen installing a pack the state of the resources is taken from the metadata files in the pack. Occassionally, when installing community packs you might not want all resources enabled, e.g. you only want to use a subset of actions, or want to disable the sensors. Prior, to StackStorm 3.7.0 then this state can be altered, by:
In StackStorm 3.7.0 we have introduced the override feature, so that the metadata of a packs resources can be overridden by configuration files. This will always be read upon a reload or pack install. The ST2 APIs will still allow you to override this, but as before any changes made by the StackStorm APIs to enable/disable resources is forgotten upon reload or re-install. The override facility is currently restricted to allowing the enabled property to be overridden only for resources of type: action, alias, rule and sensor. It is controlled by the Upon a pack install or reload resource state is managed as follows:
--- sensors: defaults: enabled: false actions: defaults: enabled: false aliases: defaults: enabled: false rules: defaults: enabled: false
--- sensors: defaults: enabled: false exceptions: sensorname1: enabled: true actions: defaults: enabled: false exceptions: actionname1: enabled: true aliases: defaults: enabled: false exceptions: aliasname1: enabled: true rules: defaults: enabled: false exceptions: rulename1: enabled: true If overrides are taking place, then the number of resources affected will be output on the $ st2ctl reload --register-all Registering content...[flags = --config-file /etc/st2/st2.conf --register-all] 2022-02-07 12:56:43,694 INFO [-] Connecting to database "st2" @ "127.0.0.1:27017" as user "None". 2022-02-07 12:56:43,704 INFO [-] Successfully connected to database "st2" @ "127.0.0.1:27017" as user "None". 2022-02-07 12:56:44,254 INFO [-] ========================================================= 2022-02-07 12:56:44,254 INFO [-] ############## Registering triggers ##################### 2022-02-07 12:56:44,254 INFO [-] ========================================================= 2022-02-07 12:56:44,549 INFO [-] Registered 1 triggers. 2022-02-07 12:56:44,549 INFO [-] ========================================================= 2022-02-07 12:56:44,549 INFO [-] ############## Registering sensors ###################### 2022-02-07 12:56:44,549 INFO [-] ========================================================= 2022-02-07 12:56:44,832 INFO [-] Registered 9 sensors. 2022-02-07 12:56:44,832 INFO [-] 7 sensors had their metadata overridden. ... On a pack install, then the number of resources that have their metadata overridden will be reported in the output of the register_pack action by the “(overridden)” entries. If no resources of that type have their metadata overridden, then there will be no correspdoning overridden entry outputted: { "runners": 14, "rule_types": 2, "policy_types": 3, "triggers": 0, "sensors": 2, "sensors(overridden)": 2, "actions": 1, "rules": 1, "aliases": 0, "policies": 0, "configs": 0 } Example: Disabling all sensors in one pack For example, to disable all sensors in an individual pack then we would create a --- sensors: defaults: enabled: false Example: Disabling all sensors in all packs, except for one pack If, instead we wanted to override all sensors except for a single pack, then we would instead create a --- sensors: defaults: enabled: false And an --- sensors: defaults: enabled: true Example: Overriding state of individual resources In this next example, we disable all actions in --- actions: defaults: enabled: false exceptions: action1: enabled: true action2: enabled: true rules: exceptions: rule1: enabled: false Developing a PackSee Create and Contribute a Pack for details on how to package your integrations and automations in a pack, how to fork a pack for development or create your own, how to publish it, and how to contribute it to the StackStorm community. If you’re planning to develop any StackStorm content, we would strongly suggest getting yourself familiar with that page: every piece of content in StackStorm has to belong to a pack, and a good understanding of pack workflow will make your development process much easier! What’s Next?
Advanced TopicsUnder the Hood: Pack BasicsThe Packs are placed in the system pack directory - by default When StackStorm loads the content, it looks into the system packs directory ( [content] packs_base_paths=/home/myuser1/packs:/home/myuser2/packs Directories are always searched from left to right in the order they are specified, with the system packs directory always searched first. A pack configuration file must be stored as When the pack content changes, it has to be registered again (reloaded). To register individual
packs, use Installing Packs from Private RepositoriesIf you are installing a pack from a private repository on GitHub, you can use HTTPS authentication with a personal access token, or create a deploy key to use SSH. Access tokens are used with HTTPS URLs, for example: $ st2 pack install https://<user>:<token>@github.com/username/repo.git Your token will be logged in StackStorm, git, your shell history, and probably other log files, including git error logs. Using SSH authentication is usually a better choice. For SSH (URLs starting with Deploy keys are more secure than personal access tokens and can be configured on a per-repo basis. Python versions in Pack Python Virtual EnvironmentWhen installing a pack, a Python virtual environment is created using the Python binary defined by
the Warning Python 2 support was dropped in StackStorm v3.4.0. Please consider updating any Python 2 only packs to work with Python 3. Installing Packs from Behind a ProxyIf your network uses a proxy to connect to the Internet, you must configure StackStorm to use that proxy
for pack installation. This is done by setting the If your proxy is performing SSL MITM,
decryption/encryption, you may need to pass in the path to the proxy CA cert, using the
If you are using a Python version < Proxy Configuration via Environment VariablesOn Ubuntu systems, edit StackStorm will use these environment variables for pack installation. The file contents should look as follows: http_proxy=http://proxy.server.io:port https_proxy=http://proxy.server.io:port no_proxy=localhost,127.0.0.1 For HTTPS proxy with cert specify additional http_proxy=http://proxy.server.io:port https_proxy=http://proxy.server.io:port proxy_ca_bundle_path=/etc/ssl/certs/proxy-ca.pem no_proxy=localhost,127.0.0.1 After editing these files, restart the $ sudo st2ctl restart-component st2api $ sudo st2ctl restart-component st2actionrunner When using HTTPS proxy with CA bundle (MITM), you must make sure the proxy CA bundle is an accepted root CA in your OS. Please refer to your OS instructions to register the proxy CA certificate. This is required for tools like Hosting Your Own Pack IndexWhen you run pack management commands like The StackStorm Exchange index file is a default file used by all StackStorm instances, and a good example of the index format. The file is hosted on GitHub (StackStorm-Exchange/index) and proxied through CloudFlare CDN. The index path is specified in [content] index_url=https://my-super-index.org/index.json,https://exchange.stackstorm.org/v1/index.json Contents from all specified indexes will merge with descending priority (left to right).
In the example above, There are multiple reasons to consider hosting your own index, especially with HA deployments or multi-server setups:
In most cases there are many other ways to solve the same problem, but sometimes a pack index
is a viable alternative. Create your index file and make it accessible over HTTPS, change
To monitor index health, the Questions? Problems? Suggestions? Engage!
|
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |