我的情况:我有一个Ansible服务器,一个塔式服务器,一个Windows文件服务器和一个Windows客户端。 通过Ansible,我想告诉Windows客户端从Windows文件服务器复制一些文件。 在find允许我将文件从远程主机复制到客户端机器的剧本模块之后,我决定尝试一系列不同的Powershell脚本和cmdlet来执行简单的文件复制。 我似乎遇到了双跳问题,并且由于Ansible / Linux服务器是这种情况下的原始机器,而且我没有控制该机器,所以我想知道是否有人解决了这个问题并设法获取脚本通过双跳。 另外,如果有人知道一个Ansible模块可以将文件从远程主机复制到客户端主机,那也是很有意思的。 如果我需要为Ansible所有者提交一张票来做某件事,或者如果我需要做某件事情,或者如果我应该放弃,无论如何,谢谢你的时间!
我需要知道是否有一种方法可以打印出一个完整的剧本,不会自动引用和跳出string。 例如,我使用ansiblebuild立一个命令,应该从不同的机器分开运行(讽刺的是,我知道,但无论如何必要)。 目前输出看起来像… "command" = "run_me.sh \"with this argument\"" 我需要的是像… "command" = run_me.sh "with this argument" 要不就… run_me.sh "with this argument" 如果可能的话,但我猜这是要求太多。 我目前正在使用set_fact来build立命令和debugging打印它。
我正在尝试使用Ansible通过win_chocolatey模块在Windows Server 2008 R2上安装软件。 它不起作用,因为它会引发错误: [错误] – 巧克力WIN-2008r2(用户pipe理员)有一个错误:System.OutOfMemoryException:types'System.OutOfMemoryException'的exception被引发。 System.Linq.Expressions.Compiler.LambdaCompiler.Compile(LambdaExpression lambda,DebugInfoGenerator debugInfoGenerator)上System.Reflection.Emit.DynamicMethod.CreateDelegate(typesdelegateType,Object target)上System.Runtime.CompilerServices.RuntimeHelpers._CompileMethod(IRuntimeMethodInfo方法)在System.Management.Automation.Interpreter.LoopCompiler.CreateDelegate()在System.Management.Automation.Interpreter.EnterLoopInstruction.Compile(对象frameObj)在System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext,ContextCallbackcallback,对象状态,布尔preserveSyncCtx )在System.Threading.ThreadPoolWorkQueue.Dispatch()System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()System.Threading.ExecutionContext.Run(ExecutionContext executionContext,ContextCallbackcallback,对象状态,Boolean preserveSyncCtx) 命令“choco install”在服务器上使用时有效。 我试图增加PowerShell和WinRM的内存限制。 set-item wsman:localhost \ Shell \ MaxMemoryPerShellMB 2048 winrm set winrm / config / winrs'@ {MaxMemoryPerShellMB =“2048”}' 还有什么可能是这个问题?
我有两个CentOS服务器,一个是带有VirtualBox提供程序的Vagrant虚拟机,另一个是租用的VPS。 他们使用相同的手册进行configuration。 在VPS上一切都很好,但是我在EPEL上遇到了错误。 我已经恢复了我的剧本几个提交,当我100%确定一切正常,但仍然是同样的错误。 我按照以下顺序使用geerlingguy所做的5个angular色: – { role: geerlingguy.repo-epel } – { role: geerlingguy.firewall } – { role: geerlingguy.nginx } – { role: geerlingguy.git } – { role: geerlingguy.nodejs } 运行我的手册会给我一个错误: Failure talking to yum: Cannot retrieve metalink for repository: epel/x86_64. Please verify its path and try again 当我SSH进入stream浪的机器,并尝试运行任何yum命令: Cannot retrieve metalink for repository: epel/x86_64. […]
AWX安装在CentOS机器上。 单独的机器( gitlab.techraf )通过HTTPS为GitLab的Web界面提供由专用CA签名的证书。 故事情节: 在“新鲜”系统上,我发出命令: /usr/bin/git clone –origin origin https://gitlab.techraf/techraf/project.git /tmp/project 并得到(预期): 致命的:无法访问“ https://gitlab.techraf/techraf/project.git/ ”: https://gitlab.techraf/techraf/project.git/的证书颁发者不被识别。 我在AWX机器上安装根CA证书: update-ca-trust force-enable curl https://certificate.source/certificates/techrafCA.pem > /etc/pki/ca-trust/source/anchors/techrafCA.pem update-ca-trust extract 我重试上面的git clone ,这次得到一个正确的回应: 克隆到“/ tmp / project”中 远程:计数对象:3,完成。 远程:总计3(delta 0),重用0(delta 0) 开箱对象:100%(3/3),完成。 作为完整性检查,我使用不同的用户帐户运行git clone – 在第2点安装根CA证书后没有问题 – 根CA似乎以系统方式安装。 curl也接受gitlab.techraf的证书。 (问题)我在AWX界面中定义一个项目,并尝试从GitLab同步它,但是我得到: 任务[使用git更新项目] ************************************************ 致命的:[localhost]:失败! => {“changed”:false,“cmd”:“ /usr/bin/git clone –origin origin […]
regex_search()中的语法与variables匹配是什么? 对于下面,vcsourcekit = 10,我想匹配正则expression式^ 10。 它不评估variables,而是字面解释。 – name: Do something awesome vmware_guest: hostname: "{{ vcenterhostname }}" … when: – item.key | regex_search('^(vcsourcekit)') with_dict: "{{ vmfacts.virtual_machines }}" 谢谢!
我是Ansible的一个相对较新的用户。 我用它来编排几组Linux服务器。 我现在正在扩大使用Ansible的自制软件模块 。 使用自制软件模块,我想断言一个软件包列表被安装在我的macOS盒子上。 到目前为止,我可以做的最好的做法是为每个包制作单独的angular色,每个angular色类似于: – name: "htop" homebrew: name: htop state: present 似乎必须有一种方法来给出一个单一angular色的包列表,这在我使用Ansible apt模块之前就已经见过了。 有小费吗? 自制软件模块本身是否明确地支持这种操作,或者Ansible或甚至是Python自身提供了什么更重要的东西? PS – 你可以放心地假设我的macOS机器都是服务器。
Ansible有一个奇怪的问题,我用它来安装/更新/pipe理我的web服务器。 我有一个安装脚本,应该确保我的Debian 6 / Apache 2系统中总是有最新的PHP5模块: – name: install apache2 and php5 action: apt pkg=$item state=latest with_items: – apache2 – php5 – libapache2-mod-php5 – php5-curl […] notify: – restart apache 它通常工作得很好,但是每隔几次运行一次,我最终会在我的apache中使用mod-php5-filter,而不是mod-php5 – 这是由于各种原因(主要是为了破坏一切)而导致的。 我所要做的就是再次运行我的安装脚本,然后回到mod-php5 有任何想法吗? 任何我可能做错的事情?
我必须处理来自CloudFormation Outputs : 产生这种输出的Ansible代码: – debug: var: stack.stack_outputs 输出: ok: [localhost] => { "stack.stack_outputs": { "Roles": "webserver balancer dbserver", "dbserver": "54.0.1.1 54.0.1.2", "balancer": "54.0.2.3", "webserver": "54.0.2.5 54.0.2.7 54.0.3.1" }} 为此,我想创build3个(dynamic数字!)组,相应地命名为相应的IP地址。 我想帮助的Ansible代码: – name: fill roles with proper hosts local_action: add_host hostname={{item}} groupname={{role}} with_whatever: ?…? 在伪ansible python它看起来像这样: for role in stack.stack_outputs.Roles.split(): # Python for ip in […]
我正在设置我的可靠的手册来configuration我的服务器通过Windows AD而不是本地身份validation系统进行身份validation。 除了跑步的时候,我的一切都在运转 networking广告join-U myusername 此命令要求inputmyusername的密码,这与ssh和sudo密码不同。 有没有办法将密码储存在保险库中,并且有足够的权限来抓取该命令? 如果没有,是否有一种方法可以提示我input密码,而不是只是崩溃,所以我可以手动input密码? Ť