我有一个 ansible 播放文件,它必须执行两个任务,首先在本地机器上获取磁盘使用情况,另一个任务是获取远程机器的磁盘使用情况并在远程机器上安装 apache2。
当我尝试运行该文件时,出现错误“错误!'sudo' 不是播放的有效属性” 当我从 yml 文件中删除 sudo 和 apt 部分时,它运行良好。
我正在使用 ansible 2.9.4。下面是两个剧本文件:
文件运行没有任何错误,
---
-
connection: local
hosts: localhost
name: play1
tasks:
-
command: "df -h"
name: "Find the disk space available"
-
command: "ls -lrt"
name: "List all the files"
-
name: "List All the Files"
register: output
shell: "ls -lrt"
-
debug: var=output.stdout_lines
-
hosts: RemoteMachine1
name: play2
tasks:
- name: "Find the disk space"
command: "df -h"
register: result
- debug: var=result.stdout_lines …Run Code Online (Sandbox Code Playgroud) 在我的项目中,我们使用 influx dB 和 Grafana 进行日志和其他在 Ubuntu 机器上运行的分析。最近,由于迁移过程,端口被阻止,例如 3000(用于 Grafana)和 8086(用于 influx dB),由于某些安全原因,这些端口将继续被阻止。所以,我无法通过浏览器和邮递员连接它们。
因此,作为解决方案,我们计划将这些(至少是仪表板)移动到本地设置。我检查了该进程是否已启动并正在运行。
但无法找到仪表板文件的物理位置。
我有一个默认设置,没有任何单独的 grafana 数据库配置。
[database]
# You can configure the database connection by specifying type, host, name, user and password
# as separate properties or as on string using the url properties.
# Either "mysql", "postgres" or "sqlite3", it's your choice
;type = sqlite3
;host = 127.0.0.1:3306
;name = grafana
;user = root
# If the password contains # or ; you have to wrap it …Run Code Online (Sandbox Code Playgroud) 我试图在线程组中完成每个 http 请求后清除缓存。我已经使用了 http_cache 管理器但没有成功。
还尝试使用以下代码添加豆壳采样器,但没有用
import org.apache.jmeter.protocol.http.control.CacheManager;
CacheManager clearCache = ctx.getCurrentSampler().getProperty("HTTPSampler.cache_manager").getObjectValue();
clearCache.clear();
Run Code Online (Sandbox Code Playgroud)
并得到
ERROR - jmeter.util.BeanShellInterpreter: Error invoking bsh method: eval Sourced file: inline evaluation of: ``import org.apache.jmeter.protocol.http.control.CacheManager; CacheManager clear . . . ''
Run Code Online (Sandbox Code Playgroud)
还尝试使用预处理器/后处理器,但不起作用。还添加了 http 标头的变量。
我正在尝试使用 puppeteer 自动化在 azure 门户上运行的应用程序。输入密码后我收到以下错误,它没有单击提交按钮。
node:55768) UnhandledPromiseRejectionWarning: ReferenceError: browser is not defined
Run Code Online (Sandbox Code Playgroud)
这是我的示例代码:
(async () => {
try {
const launchOptions = { headless: false, args: ['--start-maximized'] };
const browser = await puppeteer.launch(launchOptions);
const page = await browser.newPage();
await page.emulate(iPhonex);
await page.goto('https://apps.testpowerapps.com/play/72ff5b93-2327-404d-9423-92eedb44a287?tenantId=n082027');
//Enter User Name
const [userName] = await page.$x('//*[@id="i0116"]');
await userName.type("jyoti.m@azure.com");
const [loginButton] = await page.$x('//*[@id="idSIButton9"]');
await loginButton.press('Enter');
//Enter Password
const [passWord] = await page.$x('//*[@id="i0118"]');
await passWord.type("Pass123");
const [submitButton] = await page.$x('//*[@id="idSIButton9"]');
await submitButton.press('Enter');
//await page.keyboard.press('Enter');
}
catch(error){
console.error(error); …Run Code Online (Sandbox Code Playgroud)