A collection of classes and commands for automated command line scripting using Python.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

32 lines
1.1 KiB

centos = {
'apache': {
'reload': "apachectl -k reload",
'restart': "apachectl -k restart",
'start': "apachectl -k start",
'stop': "apachectl -k stop",
'test': "apachectl configtest",
},
'install': "yum install -y {{ args[0] }}",
'reload': "systemctl reload {{ args[0] }}",
'restart': "systemctl restart {{ args[0] }}",
'run': "{{ args[0] }}",
'start': "systemctl start {{ args[0] }}",
'stop': "systemctl stop {{ args[0] }}",
'system': {
'reboot': "reboot",
'update': "yum check-update",
'upgrade': "yum update -y",
},
'uninstall': "yum remove -y {{ args[0] }}",
'upgrade': "yum upgrade -y {{ args[0] }}",
'user': {
'add': [
"adduser {{ args[0] }}",
"{% if home %}--home {{ home }}{% endif %}",
"{% if login %}--shell {{ login }}{% endif %}",
"{% if system %}--system{% endif %}",
"{% if groups %}&& {% for group in groups %}gpasswd -a {{ args[0] }} {{ group }};{% endfor %}{% endif %}"
],
'remove': "userdel -r {{ args[0] }}",
}
}