---
- name: yaml de test de fail.
hosts: acceptation
gather_facts: False
tasks:
- name: test script general
command: id
register: uid
become: yes
become_user: wso2
# - debug: var=uid
- debug: msg="{{uid.stdout}}"
- name: copy file tmp
copy: src=files/blabla.txt dest=/tmp/blabla.txt
become: yes
become_user: wso2[Ananke:: 13:09] [Ansible/wso2/TestFails] > ansible-playbook fail.yml --ask-sudo-pass
SUDO password:
PLAY [yaml de test de fail.] **************************************************
TASK: [test script general] ***************************************************
changed: [acceptation]
TASK: [debug msg="{{uid.stdout}}"] ********************************************
ok: [acceptation] => {
"msg": "uid=500(wso2) gid=500(wso2) groups=500(wso2) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023"
}
TASK: [copy file tmp] *********************************************************
fatal: [acceptation] => ssh connection closed waiting for a privilege escalation password prompt
FATAL: all hosts have already failed -- aborting
PLAY RECAP ********************************************************************
to retry, use: --limit @/Users/simonpie/fail.retry
acceptation : ok=2 changed=1 unreachable=1 failed=0
[Ananke:: 13:10] [Ansible/wso2/TestFails] >
[Ananke:: 13:10] [Ansible/wso2/TestFails] > more ansible.cfg
[defaults]
hostfile = hosts
private_key_file = ~/.ssh/id_rsa
library = /Users/ME/Documents/Ansible/wso2/.library
[Ananke:: 13:15] [Ansible/wso2/TestFails] >
[Ananke:: 13:15] [Ansible/wso2/TestFails] > more hosts
[loc]
local ansible_ssh_host=127.0.0.1 ansible_ssh_port=2222 ansible_ssh_user=vagrant ansible_ssh_private_key_file=/Users/ME/Documents/Ansible/wso2/.vagrant/machines/default/virtualbox/private_key cutename=vmwso2
[dev]
lab ansible_ssh_host=IP ansible_ssh_user=devME ansible_ssh_private_key_file=~/.ssh/id_rsa cutename=labwso2
[accept]
acceptation ansible_ssh_host=otherIP ansible_ssh_user=accME ansible_ssh_private_key_file=~/.ssh/id_rsa cutename=accwso2
[Ananke:: 13:16] [Ansible/wso2/TestFails] >