Execute Ansible-playbook Question

24 views
Skip to first unread message

sspen...@gmail.com

unread,
Oct 27, 2016, 10:55:52 AM10/27/16
to Ansible Project, sspen...@icloud.com
Hi Sir/Miss:
   I try to use ansible-playbook, the implementation of the TASK [setup] steps, Managed Node system when the dead, so the request for assistance.

System Environment:
        Control Manage: CentOS 6.5 + Python 2.6.6 + Ansible-Devel Version
        Managed Node: CentOS 4.8 + Python 2.4.3 + simplejson 2.1.0

The results are as follows:

[Root @ test01 playbook] # ansible-playbook test1.yml

PLAY [linux] **********************************************

TASK [setup] *********************************************


Playbook test.yml content as follows:
---
- hosts: linux
   remote_user: root
   tasks:
    - name: template file
     Template: src = / root / ansible / playbook / hosts dest = / etc / hosts

sspen...@gmail.com

unread,
Oct 27, 2016, 10:55:52 AM10/27/16
to Ansible Project, sspen...@icloud.com
Hi Sir/Miss:
    I try to use ansible-playbook,the implementation of the TASK [setup] steps, Managed Node system when the dead, so the request for assistance.

==================================================================

System Environment:
     Control Manage: CentOS 6.5 + Python 2.6.6 + Ansible-Devel Version
     Managed Node: CentOS 4.8 + Python 2.4.3 + simplejson 2.1.0

==================================================================

Playbook test1.yml content as follows:
---
- hosts: linux
  remote_user: root
  tasks:
  - name: template 1 file
    template: src=/root/ansible/playbook/hosts dest=/etc/hosts


The results are as follows:
[root@test01 playbook]# ansible-playbook test1.yml

PLAY [linux] *******************************************************************

TASK [setup] ******************************************************************

Managed Node system is the dead.only power off machine.


But i use Ad-Hoc command  is ok!!

[root@test01 playbook]# ansible linux -m template -a "src=/root/ansible/playbook/hosts dest=/etc/hosts"
design27 | SUCCESS => {
    "changed": true,
    "checksum": "0cbc4f47ffe113d335b8219c5e700349b7b95db1",
    "dest": "/etc/hosts",
    "gid": 0,
    "group": "root",
    "md5sum": "f57f63d85120ed95697ea587b1590c49",
    "mode": "0644",
    "owner": "root",
    "size": 178,
    "src": "/root/.ansible/tmp/ansible-tmp-1477542443.68-267491589916759/source",
    "state": "file",
    "uid": 0

please help!




Reply all
Reply to author
Forward
0 new messages