Ansible yum:提供......的所有套餐都是最新的

时间:2015-04-23 19:42:42

标签: ansible yum

好的,我正在尝试学习ansible,并且遇到了一个非常基本的操作问题。

剧本:

 ---
 - hosts: fedtest
   tasks:

    - name: Install httpd package
      yum: name=httpd state=latest
      sudo: yes

    - name: Starting http service
      service: name=http state=started
      sudo: yes

ansible.cfg:

 [defaults]
 hostfile = /home/abcd/proj/ans/hosts
 remote_user = abcd
 private_key_file = /home/abcd/proj/ans/.ssh/ans.priv

好的,我运行命令:

 $ ansible-playbook setup_apache.yml

 PLAY [fedtest]     
 ****************************************************************

 GATHERING FACTS 
 ***************************************************************
 ok: [fedtest]

 TASK: [Install httpd package]    
 ***********************************************
 failed: [fedtest] => {"failed": true, "parsed": false}
 BECOME-SUCCESS-ajlxizkspxrhyrqauuvywgrtojtutomb
 {"msg": "", "changed": false, "results": ["All packages providing httpd are up to date"], "rc": 0}
 6.719u 1.760s 0:11.33 74.7%     0+0k 0+592io 0pf+0w
 OpenSSH_6.6.1, OpenSSL 1.0.1k-fips 8 Jan 2015
 debug1: auto-mux: Trying existing master
 debug1: mux_client_request_session: master session id: 2
 Shared connection to fedserwizard closed.


 FATAL: all hosts have already failed -- aborting

 PLAY RECAP 
 ********************************************************************
       to retry, use: --limit @/home/abcd/setup_apache.retry

 fedtest                    : ok=1    changed=0    unreachable=0    failed=1

 Exit 2

我做的ansible-剧本命令-vvvv,它看起来是无法执行shell命令来呼应发展成为集成功的字符串,这样的剧本可以代替继续示数出来的。我已经在源和目的地的几个系统上尝试过这些操作,但仍然得到相同的结果。

我需要纠正哪种类型的问题。

1 个答案:

答案 0 :(得分:0)

After a lot of experimenting, I notice that if the shell of the client (receiver) of the ansible apparently had to be /bin/bash and NOT /bin/tcsh which is what I had.

Interesting that according to the verbose output that I could find that /bin/sh was being explicitly being called. And to cause an ssh issue was extremely troublesome.