Giter VIP home page Giter VIP logo

ansible2_myapi's People

Contributors

joshuapy avatar mylray avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ansible2_myapi's Issues

python2.7 ansible 2.1.2.0下报错

2.1定义:
def get_hosts(self, pattern="all", ignore_limits_and_restrictions=False):
2.2定义:
def get_hosts(self, pattern="all", ignore_limits=False, ignore_restrictions=False):

所以现在的api是2.2+版本下的。

inventory 格式问题

我按照格式3传入了如下格式:

{
	'1.1.1.1': {
		'vars': {
			'ansible_password': 'mypassword', 'ansible_port': '22', 'ansible_user': 'root'
		}
	}
}

执行的时候提示Inventory is empty.,这个是什么情况呢

主机密码设置错误

Traceback (most recent call last):
File "/home/xxx/Network/scms/ansible-test.py", line 14, in
result = runner.run()
File "/home/xxx/Network/scms/ansible2_myAPI/runner.py", line 158, in run
raise Exception(e)
Exception: 'str' object has no attribute 'get'

提示这个错误呢?什么原因呢

from ansible2_myAPI.runner import Runner

runner = Runner(
module_name="shell",
module_args="uptime",
remote_user="test",
pattern="all",
hosts="172.19.0.70, ",
passwords='123'

)

result = runner.run()

请教一个问题

我要传一个这样的格式列表提示下面错误应该怎么修改
host_list4 = {
"group1": {
"hosts": [{"ansible_ssh_host": "10.10.10.10", "ansible_ssh_port": "22",
"hostname": "test", "ansible_ssh_pass": "mypass","ansible_ssh_user":"root"},]
}
}
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.