一个ssh-python自动化工具,用于快速完成任务

publicServerAutomator的Python项目详细描述


公共服务器自动机

v1.0.0

PublicServerAutomator Github

目的

这是一个软件包,旨在提供一个更简单、无障碍、无学习曲线的软件包+Ansible/Chef/Puppet的替代软件

安装

通过PIP安装

pip install publicServerAutomator

用法

使用私钥时

import Server from publicServerAutomator

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.Server(inputKeyPath="publickey.pem", inputKeyPassword='PASS', inputServerIP="0.0.0.0" )
newDocker.set_commands(commandList=dockerInstructions)
newDocker.connect()
newDocker.run_commands()

不使用私钥

import Server from publicServerAutomator

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.Server(inputServerIP='8.8.8.8',inputUserName='root', inputPassword='123lookatme')
newDocker.set_commands(commandList=dockerInstructions)
newDocker.connect()
newDocker.run_commands()

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
netbeans 7中的java在构建maven项目时,如何跳过测试并添加maven附加参数?   用ExtendendJFrame显示图像的java   java死锁使用Spring。豆子在哪里?   java如何向业务逻辑发送请求参数   在NetBeans或Eclipse中按空格键自动完成Java   如何使用Jackson数据格式。xml来序列化java中的LookAndFeel对象?   readfile Java使用Enter键逐行显示文件   javacom。mysql。jdbc。驱动程序类NotFoundException Eclipse   java如何实现一种以非同步方式处理服务超时的方法?   java确实支持PersistenceContextType。延长?   使用JDBC和null ResultSet的java临时表   java从javax访问HttpServletContext或会话。ws。rs.core。特色   java我想返回一个字符串的Arraylist,它在响应中包含用户名,响应代码为200   java正则表达式中的非捕获组   java使用setLayout“刷新”JFrame(null)   JavaMysql连接错误   TFS Team Foundation服务器使用java SDK获取项目的用户   数组保护方法| Java中的变量   java jsp注册页面   Netbeans启动Java命令行程序,然后自动附加以进行远程调试