I have been trying to write a playbook that adds the EPEL repo to the list of repos available.
playbook I have is:
- hosts: all # define variables. vars: epelReleaseMajorVersion: 7 epelReleaseMinorVersion: 8 tasks: - name: add epel repo yum-repository: name: add epel repo description: EPEL YUM repo baseurl: http://dl.fedoraproject.org/pub/epel/$epelReleaseMajorVersion/x86_64/e/epel-release-$epelReleaseMajorVersion-$epelReleaseMinorVersion.noarch.rpm tags: addEpelRepo
I am trying to run this
playbook like so:
ansible-playbook -v -i "localhost," -c local serverSetup.yml
and get the following error:
ERROR! no action detected in task. This often indicates a misspelled module name, or incorrect module path. The error appears to have been in '/root/ansible/playbooks/serverSetup.yml': line 21, column 7, but may be elsewhere in the file depending on the exact syntax problem. The offending line appears to be: tasks: - name: add epel repo ^ here
1. Am I using the variables epelReleaseMajorVersion etc. correctly?
2. How do I solve for this error? I have been taking a look at the docs but there do not seem to be many examples.