Created
February 19, 2016 20:58
-
-
Save kevinquinnyo/3497e977ce15ef35cabe to your computer and use it in GitHub Desktop.
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
#!py | |
def basic_packages(states): | |
pkgs = [ | |
'vim', | |
'unzip', | |
'sendmail', | |
'iftop', | |
'python-mysqldb', | |
'sysstat' | |
] | |
states['basic-utilities'] = { | |
'pkg.installed': [ | |
{'pkgs': pkgs} | |
] | |
} | |
return states | |
def config(states): | |
states['enable-sysstat'] = { | |
'file.replace': [ | |
{'name': '/etc/default/sysstat'}, | |
{'pattern': 'ENABLED\=\"false\"'}, | |
{'repl': 'ENABLED="true"'}, | |
{'require': [ | |
{'pkg': 'basic-utilities'} | |
]} | |
] | |
} | |
states['restart-sysstat'] = { | |
'service.running': [ | |
{'name': 'sysstat'}, | |
{'require': [ | |
{'file': 'enable-sysstat'} | |
]}, | |
{'watch': [ | |
{'file': 'enable-sysstat'} | |
]} | |
] | |
} | |
return states | |
def run(): | |
states = {} | |
states = basic_packages(states) | |
states = config(states) | |
return states |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment