Last active
July 25, 2019 00:18
-
-
Save natemccurdy/84eba6fafc3454296a6426a7d0f12dc7 to your computer and use it in GitHub Desktop.
system_updates module: Example for Mark in Slack
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
message: "this is data in common.yaml" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
system_updates::update_cmd: 'apt upgrade -y' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
system_updates::update_cmd: 'yum -y update' |
Author
natemccurdy
commented
Jul 24, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment