Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ansible: fix needed to run debian8 bootstrap in check mode (#2499)
Running playbooks using the `bootstrap` role on machines running debian8 failed when in check mode: ``` $ ansible-playbook --check playbooks/create-github-bot.yml TASK [bootstrap : check for apt-transport-https] **************************************************************************************************************************************** skipping: [infra-rackspace-debian8-x64-1] TASK [bootstrap : install apt-transport-https] ****************************************************************************************************************************************** fatal: [infra-rackspace-debian8-x64-1]: FAILED! => {"msg": "The conditional check 'has_apt_transport.rc == 1' failed. The error was: error while evaluating conditional (has_apt_transport.rc == 1): 'dict object' has no attribute 'rc'\n\nThe error appears to be in '/..../build/ansible/roles/bootstrap/tasks/partials/debian8.yml': line 12, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: install apt-transport-https\n ^ here\n"} ``` The `install apt-transport-https` task failed due to the fact that the preceding `check for apt-transport-https` did not define the `has_apt_transport` result because it got skipped. Ansible skips `raw` tasks by default as a precaution when run in check mode, in case it has a side effect. Further discussions made us want to use ansible' `stat` module instead primarily because it is more self descriptive compared to the `raw` trick we had before.
- Loading branch information