Created
March 2, 2017 10:23
-
-
Save vignesh-v3/5c4c964f56ffb56ccdd187ba1785bd1b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
what is the problem here | |
testu@ubuntu:~/playbooks/new$ cat when.yml | |
--- | |
- hosts: fedora | |
gather_facts: no | |
tasks: | |
- name: install apache to appropriate distro to ubuntu | |
command: apt-get -y install apache2 | |
when: ansible_os_family == "Debian" | |
- name: Install apache appropriate to rhel or centro | |
command: yum -y install http | |
when: ansible_os_family == "RedHat" | |
testu@ubuntu:~/playbooks/new$ ansible-playbook when.yml -b | |
PLAY [fedora] ****************************************************************** | |
TASK [install apache to appropriate distro to ubuntu] ************************** | |
fatal: [192.168.198.130]: FAILED! => {"failed": true, "msg": "The conditional check 'ansible_os_family == \"Debian\"' failed. The error was: error while evaluating conditional (ansible_os_family == \"Debian\"): 'ansible_os_family' is undefined\n\nThe error appears to have been in '/home/testu/playbooks/new/when.yml': line 5, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n tasks:\n - name: install apache to appropriate distro to ubuntu\n ^ here\n"} | |
[WARNING]: Could not create retry file '/home/testu/playbooks/new/when.retry'. | |
[Errno 13] Permission denied: u'/home/testu/playbooks/new/when.retry' | |
PLAY RECAP ********************************************************************* | |
192.168.198.130 : ok=0 changed=0 unreachable=0 failed=1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Remove "gather_facts: no" and try.. It should work