小编Son*_*ton的帖子

遍历服务器列表的更好方法

我经常做一些事情,我循环遍历服务器列表以采取一些行动。例如:

for s in `cat servers.txt` ; do
    echo; echo $s
    ssh $s 'do something'
done
Run Code Online (Sandbox Code Playgroud)

我想知道(从 shell 的角度)是否有比 cat servers.txt

是的,我知道 mcollective、capistrano 等工具 - 我经常这样做是为了解决 mcollective 问题:-)

ssh shell bash mcollective

7
推荐指数
4
解决办法
3万
查看次数

ansible 并重新加载 AWS 动态清单

另请参阅:https : //stackoverflow.com/questions/29003420/reload-ansibles-dynamic-inventory

我的问题:有没有更好的方法来做下面的事情?

我有一个 ansible 角色可以预配 AWS 机器并正确运行(注意provision标签):

- name: AWS provision
  hosts: localhost
  gather_facts: no
  vars_files:
    - vars/dev.yml
  user: ec2-user
  roles:
    - provision
  tags:
    - provision
Run Code Online (Sandbox Code Playgroud)

然后我有一个base角色,我希望能够独立运行(例如在开发过程中,所以我不必等待重新配置(注意base标签)。我运行一个find running instances过滤器并将主机存储在小组started

- name: find running instances
  hosts: localhost
  vars_files:
    - vars/dev.yml
  gather_facts: no
  tags:
    - base
  tasks:
    - name: gather remote facts
      ec2_remote_facts:
        region: "{{ target_aws_region }}"
        filters:
          instance-state-name: running
          "tag:Name": "{{ instance_name }}"
      register: ec2_facts

    - …
Run Code Online (Sandbox Code Playgroud)

amazon-web-services ansible

7
推荐指数
1
解决办法
4834
查看次数

FreeBSD 如何重建所有 p5-* Perl 5 端口

在 FreeBSD 系统上,说明说要重建所有 p5-* 端口- 我该怎么做?

一点背景知识...我是一名经验丰富的 Linux 人,正在试用(并喜欢)最新的 PC-BSD (PCBSD9.2-RELEASE-x64)。我之前已经安装了简单的包和端口,我想我会尝试一些更奇特的 - 单声道和 F#:

cd /usr/ports/lang/mono && make install clean BATCH=yes && \ 
cd /usr/ports/lang/fsharp && make install clean BATCH=yes
Run Code Online (Sandbox Code Playgroud)

我得到这个错误输出:

configure: error: perl module Locale::gettext required
===>  Script "configure" failed unexpectedly.
Please read UPDATING entry 20130612
(http://svnweb.freebsd.org/ports/head/UPDATING?r1=320405&r2=32067) and
PR/184276 (http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/184276) to fix
your Perl installation if you got the error message "configure: error: perl
module Locale::gettext required".
Run Code Online (Sandbox Code Playgroud)

第一个链接不起作用(为什么不?)但第二个链接(http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/184276)解释说“Perl所在的目录结构安装也已修改.... [作为] 20130612 布局更改的结果”,修复方法是:

rebuild all …
Run Code Online (Sandbox Code Playgroud)

freebsd

6
推荐指数
2
解决办法
6732
查看次数

标签 统计

amazon-web-services ×1

ansible ×1

bash ×1

freebsd ×1

mcollective ×1

shell ×1

ssh ×1