Skip to content

Instantly share code, notes, and snippets.

@natemccurdy
Last active July 25, 2019 00:18
Show Gist options
  • Save natemccurdy/84eba6fafc3454296a6426a7d0f12dc7 to your computer and use it in GitHub Desktop.
Save natemccurdy/84eba6fafc3454296a6426a7d0f12dc7 to your computer and use it in GitHub Desktop.
system_updates module: Example for Mark in Slack
---
message: "this is data in common.yaml"
---
system_updates::update_cmd: 'apt upgrade -y'
---
version: 5
defaults:
datadir: "data"
hierarchy:
- name: 'Yaml backend'
data_hash: yaml_data
paths:
- "nodes/%{trusted.certname}.yaml"
- "%{environment}.yaml"
- "%{facts.os.family}.yaml"
- 'common.yaml'
class system_updates (
String[1] $update_cmd,
) {
notify { 'system_updates module': withpath => true}
notify { "update_cmd is ${update_cmd}": withpath => true}
# Note: This is not valid code, but I'll let you figure it out.
include system_updates::barf($update_cmd)
}
---
system_updates::update_cmd: 'yum -y update'
@natemccurdy
Copy link
Author

$ tree system_updates/
system_updates
├── data
│   ├── common.yaml
│   ├── debian.yaml
│   └── redhat.yaml
├── hiera.yaml
└── manifests
    └── init.pp

2 directories, 5 files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment