CSCfi / ansible-role-pxe_bootstrap

Ansible role that install and configures TFTP. It also places iPXE/PXE boot conf files
MIT License
24 stars 4 forks source link

idempotency travis testing is not right #15

Closed martbhell closed 5 years ago

martbhell commented 5 years ago

While debugging some idempotency issues in another repo I found that there's a one too many pipes in some repos:

roles/ansible-role-pxe_bootstrap/tests/test-in-docker-image.sh:    ansible-playbook -i ${ANSIBLE_INVENTORY} ${ANSIBLE_PLAYBOOk} ${ANSIBLE_LOG_LEVEL} --connection=local ${SUDO_OPTION} ${ANSIBLE_EXTRA_VARS} || grep -q 'changed=0.*failed=0' && (echo 'Idempotence test: pass' ) || (echo 'Idempotence test: fail' && exit 1)

has

ansible-command || grep -q 'changed=0.*failed=0' && (echo 'Idempotence test: pass' ) || (echo 'Idempotence test: fail' && exit 1)

Which should probably have one fewer pipe before the "grep -q ..." bit.

ansible-command | grep -q 'changed=0.*failed=0' && (echo 'Idempotence test: pass' ) || (echo 'Idempotence test: fail' && exit 1)
VilleS1 commented 5 years ago

Fixed in 8af30070db674e796dbb39c048efae1e9cb87ec3