Have you heard about Ansible? It does the job you want to do, and it's written mostly in python.
App deployment, configuration management, and orchestration — all from
one system. Ansible is simple, agentless automation that anyone can
use.
Ansible Documentaion
Long story short you writte playboks (.yaml templates). Simply put, playbooks are the basis for a really simple configuration management and multi-machine deployment system, unlike any that already exist, and one that is very well suited to deploying complex applications.
Example playbook:
---
- hosts: webservers
vars:
http_port: 80
max_clients: 200
remote_user: root
tasks:
- name: ensure apache is at the latest version
yum:
name: httpd
state: latest
- name: write the apache config file
template:
src: /srv/httpd.j2
dest: /etc/httpd.conf
notify:
- restart apache
- name: ensure apache is running
service:
name: httpd
state: started
handlers:
- name: restart apache
service:
name: httpd
state: restarted
When you will create playbook that suits your needs just run it against your machine or list of them. There is a huge list of modules available to ansible ready to use. You can also write your own plugins.