Skip to main content

An SSH Python automation tool for quickly getting things done

Project description

Public Server Automator

V1.0.1

PublicServerAutomator Github

Purpose

This is a package intended to offer a much simpler, no hickups, no learning curve package + software alternative to Ansible/chef/puppet

Installation

Install via pip

pip install publicServerAutomator

Usage

When using a private key

from publicServerAutomator import Server

dockerInstructions = [
    "apt-get update -y",
    "apt-get install apt-transport-https -y",
    "apt-get install software-properties-common -y",
    "apt-get install curl -y",
    "apt-get install gnupg2 -y",
    "apt-get install git -y",
    "apt-get install acl -y",
    "apt-get install fail2ban -y"
    '''add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"''',
    "apt-get update -y",
    "apt-get install docker-ce -y",
    "docker run hello-world"
]

newDocker = Server(inputKeyPath="publickey.pem", inputKeyPassword='PASS', inputServerIP="0.0.0.0" )
newDocker.set_commands(commandList=dockerInstructions)
newDocker.connect()
newDocker.run_commands()

Without using a private key

from publicServerAutomator import Server

dockerInstructions = [
    "apt-get update -y",
    "apt-get install apt-transport-https -y",
    "apt-get install software-properties-common -y",
    "apt-get install curl -y",
    "apt-get install gnupg2 -y",
    "apt-get install git -y",
    "apt-get install acl -y",
    "apt-get install fail2ban -y"
    '''add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"''',
    "apt-get update -y",
    "apt-get install docker-ce -y",
    "docker run hello-world"
]

newDocker = Server(inputServerIP='8.8.8.8',inputUserName='root', inputPassword='123lookatme', inputKeyPath='')
newDocker.set_commands(commandList=dockerInstructions)
newDocker.connect()
newDocker.run_commands()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

publicServerAutomator-1.0.1.tar.gz (3.4 kB view details)

Uploaded Source

File details

Details for the file publicServerAutomator-1.0.1.tar.gz.

File metadata

  • Download URL: publicServerAutomator-1.0.1.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.19.1 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/2.7.15

File hashes

Hashes for publicServerAutomator-1.0.1.tar.gz
Algorithm Hash digest
SHA256 cb99c9d1967090eb479fa2ac4408086ef5e9e31c45fdfd0e39f2d5352e846a32
MD5 dad30075167c4ce630ad59951481735c
BLAKE2b-256 cebd8d7252d52fe7ce21ea5336c5eb4992e1beb72a74e41db0d860d70847a1ec

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page