Skip to content

Commit eb20154

Browse files
committed
Add example documentation for Ansible extra vars
1 parent f1267ce commit eb20154

File tree

1 file changed

+42
-1
lines changed

1 file changed

+42
-1
lines changed

README.md

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ The following inputs can be used as `steps.with` keys:
8787
| `tf_stack_destroy` | bool | `false` | Set to `true` to Destroy the created AWS infrastructure for this instance |
8888
| `tf_state_bucket_destroy` | bool | `false` | Force purge and deletion of `tf_state_bucket` defined. Any file contained there will be destroyed. `tf_stack_destroy` must also be `true` |
8989

90-
9190
### Note about AWS resource identifiers
9291
Most resources will contain the tag `GITHUB_ORG-GITHUB_REPO-GITHUB_BRANCH` to make them unique. Because some AWS resources have a length limit, we shorten identifiers to a `60` characters max string.
9392

@@ -98,6 +97,48 @@ For some specific resources, we have a `32` characters limit. If the identifier
9897
### S3 buckets naming
9998
Bucket names can be made of up to 63 characters. If the length allows us to add `-tf-state`, we will do so. If not, a simple `-tf` will be added.
10099

100+
### Advanced StackStorm configuration with Ansible vars
101+
This action runs [`ansible-st2`](https://github.com/stackStorm/ansible-st2) roles under the hood. You can customize the Ansible configuration by creating a yaml file in your repo. This file will be passed to the Ansible playbook as extra vars. See the [Ansible-st2](https://github.com/stackStorm/ansible-st2#variables) documentation for a full list of available options.
102+
103+
Here is an example `st2_vars.yaml` pinning the stackstorm to `v3.8.0`, installing several packs from [StackStorm Exchange](https://exchange.stackstorm.org) and configuring `st2.conf` with extra settings for `garbagecollector`:
104+
105+
```yaml
106+
st2_version: "3.8.0"
107+
108+
# Install specific pack versions from StackStorm Exchange
109+
st2_packs:
110+
- st2
111+
- aws=1.2.0
112+
- github=2.1.3
113+
114+
# https://github.com/StackStorm/st2/blob/master/conf/st2.conf.sample
115+
st2_config:
116+
garbagecollector:
117+
# Action executions and related objects (live actions, action output objects) older than this value (days) will be automatically deleted. Defaults to None (disabled).
118+
action_executions_ttl = 90
119+
```
120+
121+
Example GHA deployment job referencing the Ansible `st2_vars.yaml` file:
122+
```yaml
123+
jobs:
124+
deploy-st2:
125+
runs-on: ubuntu-latest
126+
steps:
127+
- id: deploy-st2-advanced
128+
name: Deploy StackStorm with extra Ansible vars
129+
uses: bitovi/github-actions-deploy-stackstorm@main
130+
with:
131+
aws_default_region: us-east-1
132+
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID}}
133+
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY}}
134+
st2_auth_username: ${{ secrets.ST2_AUTH_USERNAME}}
135+
st2_auth_password: ${{ secrets.ST2_AUTH_PASSWORD}}
136+
# Pass the Ansible vars file
137+
st2_ansible_extra_vars_file: "st2_vars.yaml"
138+
```
139+
140+
We encourage to keep your infrastructure codified!
141+
101142
## Made with BitOps
102143
[BitOps](https://bitops.sh/) allows you to define Infrastructure-as-Code for multiple tools in a central place. This action uses BitOps Docker container with prebuilt deployment tools and [Operations Repository Structure](https://bitops.sh/operations-repo-structure/) to organize the necessary Terraform and Ansible steps, create infrastructure and deploy to it.
103144

0 commit comments

Comments
 (0)