傀儡申请工作但傀儡代理 - 测试不工作?

时间:2015-01-08 08:46:26

标签: puppet

我写了一个简单的清单test.pp

node'c-d'{ user{'abc': ensure=>absent, }

notify{'Notifying to client':}

}

但是当我试图在代理节点上运行它时,它的配置没有得到应用,输出就是如此。节点c-d

[output] Info: Retrieving plugin Info: Caching catalog for <c-d.domain.com> Info: Applying configuration version '1420702685' Notice: Finished catalog run in 0.03 seconds

注意:puppetmaster和agent版本是3.4.3

3 个答案:

答案 0 :(得分:1)

主服务器使用配置的中央清单,请参阅

puppet master --configprint manifest

将使用和搜索此文件node定义。

具体你不能

  1. 只使用清单的任意名称和位置
  2. 将清单放到代理机器上(这将是使用puppet apply的方式)。

答案 1 :(得分:0)

首先,您需要确保puppet master和agent之间的设置没有问题,这意味着当您多次运行puppet agent -t时没有问题。

然后,如果您需要在代理上通过puppet agent -t应用更改,则需要将test.pp放在路径$mondulepath下的puppet master上。但是根据您的描述,您可以直接将文件复制到代理。

因此,在这种情况下,如果您想直接在代理上应用它,请运行命令:

puppet apply --modulepath=/path/to/modules test.pp

答案 2 :(得分:0)

正如@FelixFrank所说,您可以使用'config print'来打印放置木偶代码的位置。我在这里使用的是打印'environmentpath',它表示环境的路径是什么,默认环境是“生产”。

因此,默认ConnectionRefusedError Traceback (most recent call last) <ipython-input-12-f4d26b367ef7> in <module>() 8 webdriver.PhantomJS(executable_path="/anaconda/bin/phantomjs") 9 ---> 10 browser.get(url) > /anaconda/lib/python3.6/site-packages/selenium-3.4.3- py3.6.egg/selenium/webdriver/remote/webdriver.py in get(self, url) 266 Loads a web page in the current browser session. 267 """ --> 268 self.execute(Command.GET, {'url': url}) 269 270 @property /anaconda/lib/python3.6/site-packages/selenium-3.4.3-py3.6.egg/selenium/webdriver/remote/webdriver.py in execute(self, driver_command, params) 252 253 params = self._wrap_value(params) --> 254 response = self.command_executor.execute(driver_command, params) 255 if response: 256 self.error_handler.check_response(response) /anaconda/lib/python3.6/site-packages/selenium-3.4.3-py3.6.egg/selenium/webdriver/remote/remote_connection.py in execute(self, command, params) 462 path = string.Template(command_info[1]).substitute(params) 463 url = '%s%s' % (self._url, path) --> 464 return self._request(command_info[0], url, body=data) 465 466 def _request(self, method, url, body=None): /anaconda/lib/python3.6/site-packages/selenium-3.4.3-py3.6.egg/selenium/webdriver/remote/remote_connection.py in _request(self, method, url, body) 485 body = None 486 try: --> 487 self._conn.request(method, parsed_url.path, body, headers) 488 resp = self._conn.getresponse() 489 except (httplib.HTTPException, socket.error): /anaconda/lib/python3.6/http/client.py in request(self, method, url, body, headers, encode_chunked) 1237 encode_chunked=False): 1238 """Send a complete request to the server.""" -> 1239 self._send_request(method, url, body, headers, encode_chunked) 1240 1241 def _send_request(self, method, url, body, headers, encode_chunked): /anaconda/lib/python3.6/http/client.py in _send_request(self, method, url, body, headers, encode_chunked) 1283 # default charset of iso-8859-1. 1284 body = _encode(body, 'body') -> 1285 self.endheaders(body, encode_chunked=encode_chunked) 1286 1287 def getresponse(self): /anaconda/lib/python3.6/http/client.py in endheaders(self, message_body, encode_chunked) 1232 else: 1233 raise CannotSendHeader() -> 1234 self._send_output(message_body, encode_chunked=encode_chunked) 1235 1236 def request(self, method, url, body=None, headers={}, *, /anaconda/lib/python3.6/http/client.py in _send_output(self, message_body, encode_chunked) 1024 msg = b"\r\n".join(self._buffer) 1025 del self._buffer[:] -> 1026 self.send(msg) 1027 1028 if message_body is not None: /anaconda/lib/python3.6/http/client.py in send(self, data) 962 if self.sock is None: 963 if self.auto_open: --> 964 self.connect() 965 else: 966 raise NotConnected() /anaconda/lib/python3.6/http/client.py in connect(self) 934 """Connect to the host and port specified in __init__.""" 935 self.sock = self._create_connection( --> 936 (self.host,self.port), self.timeout, self.source_address) 937 self.sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1) 938 /anaconda/lib/python3.6/socket.py in create_connection(address, timeout, source_address) 720 721 if err is not None: --> 722 raise err 723 else: 724 raise error("getaddrinfo returns an empty list") /anaconda/lib/python3.6/socket.py in create_connection(address, timeout, source_address) 711 if source_address: 712 sock.bind(source_address) 713 sock.connect(sa) 714 return sock 715 ConnectionRefusedError: [Errno 61] Connection refused 路径为init.pp