Skip to content

Instantly share code, notes, and snippets.

@patrickheeney
Created March 17, 2014 16:38
Show Gist options
  • Save patrickheeney/9603018 to your computer and use it in GitHub Desktop.
Save patrickheeney/9603018 to your computer and use it in GitHub Desktop.
vagrant@protobox:/vagrant/ansible_src/test/integration$ sudo TEST_FLAGS="--tags test_git" make
ansible-playbook non_destructive.yml -i inventory -e @integration_config.yml -v --tags test_git
PLAY [testhost] ***************************************************************
GATHERING FACTS ***************************************************************
ok: [testhost]
TASK: [test_git | set role facts] *********************************************
ok: [testhost] => {"ansible_facts": {"checkout_dir": "~/ansible_testing/git", "known_host_files": ["/home/vagrant/.ssh/known_hosts", "/etc/ssh/ssh_known_hosts"], "repo_format1": "https://github.com/jimi-c/test_role", "repo_format2": "git@github.com:jimi-c/test_role.git", "repo_format3": "ssh://git@github.com/jimi-c/test_role.git"}, "item": ""}
TASK: [test_git | clean out the output_dir] ***********************************
changed: [testhost] => {"changed": true, "cmd": "rm -rf ~/ansible_testing/* ", "delta": "0:00:00.003161", "end": "2014-03-17 16:32:50.027503", "item": "", "rc": 0, "start": "2014-03-17 16:32:50.024342", "stderr": "", "stdout": ""}
TASK: [test_git | verify that git is installed so this test can continue] *****
changed: [testhost] => {"changed": true, "cmd": "which git ", "delta": "0:00:00.004683", "end": "2014-03-17 16:32:50.081903", "item": "", "rc": 0, "start": "2014-03-17 16:32:50.077220", "stderr": "", "stdout": "/usr/bin/git"}
TASK: [test_git | initial checkout] *******************************************
changed: [testhost] => {"after": "4f2148c62783a6df42a2ae7e5436b8b2ce4deb1f", "before": null, "changed": true, "item": ""}
TASK: [test_git | verify information about the initial clone] *****************
ok: [testhost] => {"item": "", "msg": "all assertions passed"}
TASK: [test_git | repeated checkout] ******************************************
ok: [testhost] => {"after": "4f2148c62783a6df42a2ae7e5436b8b2ce4deb1f", "before": "4f2148c62783a6df42a2ae7e5436b8b2ce4deb1f", "changed": false, "item": ""}
TASK: [test_git | check for tags] *********************************************
ok: [testhost] => {"changed": false, "item": "", "stat": {"atime": 1395073972.1345308, "ctime": 1395073971.4942188, "dev": 64512, "exists": true, "gid": 0, "inode": 2885019, "isblk": false, "ischr": false, "isdir": true, "isfifo": false, "isgid": false, "islnk": false, "isreg": false, "issock": false, "isuid": false, "mode": "0755", "mtime": 1395073971.4942188, "nlink": 2, "pw_name": "root", "rgrp": true, "roth": true, "rusr": true, "size": 4096, "uid": 0, "wgrp": false, "woth": false, "wusr": true, "xgrp": true, "xoth": true, "xusr": true}}
TASK: [test_git | check for HEAD] *********************************************
ok: [testhost] => {"changed": false, "item": "", "stat": {"atime": 1395073972.7988544, "ctime": 1395073972.7948525, "dev": 64512, "exists": true, "gid": 0, "inode": 2885120, "isblk": false, "ischr": false, "isdir": false, "isfifo": false, "isgid": false, "islnk": false, "isreg": true, "issock": false, "isuid": false, "md5": "4cf2d64e44205fe628ddd534e1151b58", "mode": "0644", "mtime": 1395073972.7948525, "nlink": 1, "pw_name": "root", "rgrp": true, "roth": true, "rusr": true, "size": 23, "uid": 0, "wgrp": false, "woth": false, "wusr": true, "xgrp": false, "xoth": false, "xusr": false}}
TASK: [test_git | check for remotes] ******************************************
ok: [testhost] => {"changed": false, "item": "", "stat": {"atime": 1395073971.4942188, "ctime": 1395073971.4942188, "dev": 64512, "exists": true, "gid": 0, "inode": 2885029, "isblk": false, "ischr": false, "isdir": true, "isfifo": false, "isgid": false, "islnk": false, "isreg": false, "issock": false, "isuid": false, "mode": "0755", "mtime": 1395073971.4942188, "nlink": 2, "pw_name": "root", "rgrp": true, "roth": true, "rusr": true, "size": 4096, "uid": 0, "wgrp": false, "woth": false, "wusr": true, "xgrp": true, "xoth": true, "xusr": true}}
TASK: [test_git | assert presense of tags/trunk/branches] *********************
ok: [testhost] => {"item": "", "msg": "all assertions passed"}
TASK: [test_git | verify on a reclone things are marked unchanged] ************
ok: [testhost] => {"item": "", "msg": "all assertions passed"}
TASK: [test_git | clear checkout_dir] *****************************************
changed: [testhost] => {"changed": true, "item": "", "path": "/home/vagrant/ansible_testing/git", "state": "absent"}
TASK: [test_git | remove known_host files] ************************************
ok: [testhost] => (item=/home/vagrant/.ssh/known_hosts) => {"changed": false, "item": "/home/vagrant/.ssh/known_hosts", "path": "/home/vagrant/.ssh/known_hosts", "state": "absent"}
ok: [testhost] => (item=/etc/ssh/ssh_known_hosts) => {"changed": false, "item": "/etc/ssh/ssh_known_hosts", "path": "/etc/ssh/ssh_known_hosts", "state": "absent"}
TASK: [test_git | checkout ssh://git@github.com repo without accept_hostkey (expected fail)] ***
failed: [testhost] => {"failed": true, "item": ""}
msg: github.com has an unknown hostkey. Set accept_hostkey to True or manually add the hostkey prior to running the git module
...ignoring
TASK: [test_git | assert ] ****************************************************
ok: [testhost] => {"item": "", "msg": "all assertions passed"}
TASK: [test_git | checkout git@github.com repo with accept_hostkey (expected pass)] ***
skipping: [testhost]
TASK: [test_git | assert ] ****************************************************
skipping: [testhost]
TASK: [test_git | checkout ssh://git@github.com repo with accept_hostkey and root user (expected fail)] ***
failed: [testhost] => {"cmd": ["/usr/bin/git", "ls-remote", "git@github.com:jimi-c/test_role.git", "-h", "refs/heads/HEAD"], "failed": true, "item": "", "rc": 128}
stderr: Warning: Permanently added 'github.com,192.30.252.129' (RSA) to the list of known hosts.
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
msg: Warning: Permanently added 'github.com,192.30.252.129' (RSA) to the list of known hosts.
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
...ignoring
TASK: [test_git | assert ] ****************************************************
failed: [testhost] => {"assertion": "git_result.msg == \"/root/.ssh/ does not exist\"", "evaluated_to": false, "failed": true, "item": ""}
FATAL: all hosts have already failed -- aborting
PLAY RECAP ********************************************************************
to retry, use: --limit @/home/vagrant/non_destructive.retry
testhost : ok=17 changed=4 unreachable=0 failed=1
make: *** [non_destructive] Error 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment