Ansible:从本地计算机同步到组中的所有其他计算机

时间:2017-03-31 08:18:49

标签: ssh ansible ansible-2.x

我正在尝试将本地计算机上的根拥有文件夹转移到名为' group'的组中所有其他计算机上的root拥有文件夹。

当我运行playbook时,它会挂起,这让我觉得它可能是一个ssh问题。但是,我可以通过命令行在没有密码的情况下将ssh发送到远程计算机上作为用户“我”#。

我有以下内容,但我相信它会尝试从远程计算机复制到同一台远程计算机。但我不认为ansible甚至可以做到这一点,所以我认为我有两个问题要解决。

  synchronize:
    src: /root/owned/dir/
    dest: /root/owned/dir/
  delegate_to: "{{ hostvars[item].ip_address }}"
  with_items: "{{ groups['group'] }}"
  when: inventory_hostname != "{{item}}"
  become: yes
  become_user: me

1 个答案:

答案 0 :(得分:0)

我选择了这个解决方法

for subView in searchController.searchBar.subviews {

    for subViewOne in subView.subviews {

        if let textField = subViewOne as? UITextField {

           subViewOne.backgroundColor = UIColor.red

           //use the code below if you want to change the color of placeholder
           let textFieldInsideUISearchBarLabel = textField.value(forKey: "placeholderLabel") as? UILabel
                textFieldInsideUISearchBarLabel?.textColor = UIColor.blue
        }
     }
}
相关问题