Skip to content

Commit

Permalink
docs: salt-enabled and full_config renaming (#11)
Browse files Browse the repository at this point in the history
now afk-enabled and afk
  • Loading branch information
kpetremann authored Jul 8, 2023
1 parent 4276c3f commit 8e54429
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions docs/docs/SaltStack-modules/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,30 +34,30 @@ def run():

## Apply the configuration manually

* Dry run: `salt <device> state.apply full_config test=True`
* Deploy: `salt <device> state.apply full_config`
* Dry run: `salt <device> state.apply afk test=True`
* Deploy: `salt <device> state.apply afk`

## Schedule configuration deployment

!!! info

These are examples. Make sure to adapt them to your infrastructure.

Simple schedule in `{SALT_PILLAR_PATH}/schedule_simple_full_config.sls`
Simple schedule in `{SALT_PILLAR_PATH}/schedule_simple_afk.sls`

```yaml
schedule:
full_config:
afk:
function: state.sls
args:
- full_config
- afk
minutes: 30
range:
start: 8am
end: 7pm
```
Schedule only for devices having a `salt-enabled` tag in NetBox in `{SALT_PILLAR_PATH}/schedule_smart_full_config.sls`
Schedule only for devices having a `afk-enabled` tag in NetBox in `{SALT_PILLAR_PATH}/schedule_smart_afk.sls`

```py
#!py
Expand All @@ -73,7 +73,7 @@ DATA_API = f"https://data-aggregation-api.{DATACENTER}.{ENVIRONMENT}.local"
def run():
"""Get AFK salt-enabled data for all devices."""
"""Get AFK afk-enabled data for all devices."""
device = __grains__["id"]
endpoint = f"{DATA_API}/devices/{device}/salt_enabled"
Expand All @@ -82,9 +82,9 @@ def run():
if result.get("salt_enabled") is True:
return {
"schedule": {
"full_config": {
"afk": {
"function": "state.sls",
"args": ["full_config"],
"args": ["afk"],
"minutes": 30,
"range": {"start": "8am", "end": "7pm"},
}
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/provisioning.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ It can take many forms. At Criteo we have two kinds:

Here you have two options:

* :grin: `not so AFK`: just run the SaltStack State manually via the `salt <device> state.apply full_config` command
* :grin: `not so AFK`: just run the SaltStack State manually via the `salt <device> state.apply afk` command
* :heart: `real AFK`: create a schedule to automatically apply the configuration

0 comments on commit 8e54429

Please sign in to comment.