{"action":"opened","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/36794","repository_url":"https://api.github.com/repos/ansible/ansible","labels_url":"https://api.github.com/repos/ansible/ansible/issues/36794/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/36794/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/36794/events","html_url":"https://github.com/ansible/ansible/issues/36794","id":300759079,"number":36794,"title":"ERROR! 'yum_repository' is not a valid attribute for a Play","user":{"login":"kg4giy","id":7986954,"avatar_url":"https://avatars1.githubusercontent.com/u/7986954?v=4","gravatar_id":"","url":"https://api.github.com/users/kg4giy","html_url":"https://github.com/kg4giy","followers_url":"https://api.github.com/users/kg4giy/followers","following_url":"https://api.github.com/users/kg4giy/following{/other_user}","gists_url":"https://api.github.com/users/kg4giy/gists{/gist_id}","starred_url":"https://api.github.com/users/kg4giy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kg4giy/subscriptions","organizations_url":"https://api.github.com/users/kg4giy/orgs","repos_url":"https://api.github.com/users/kg4giy/repos","events_url":"https://api.github.com/users/kg4giy/events{/privacy}","received_events_url":"https://api.github.com/users/kg4giy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-27T19:20:07Z","updated_at":"2018-02-27T19:20:07Z","closed_at":null,"author_association":"NONE","body":"<!---\r\nVerify first that your issue/request is not already reported on GitHub.\r\nAlso test if the latest release, and devel branch are affected too.\r\n-->\r\n\r\n##### ISSUE TYPE\r\n<!--- Pick one below and delete the rest -->\r\n - Bug Report\r\n\r\n\r\n##### COMPONENT NAME\r\n<!---\r\nName of the module, plugin, task or feature\r\nDo not include extra details here, e.g. \"vyos_command\" not \"the network module vyos_command\" or the full path\r\n-->\r\n\r\nyum_respository command\r\n\r\n##### ANSIBLE VERSION\r\n<!--- Paste verbatim output from \"ansible --version\" between quotes below -->\r\n```\r\n\r\n[ec2-user@ip-172-31-57-185 packer]$ ansible --version\r\nansible 2.4.2.0\r\n  config file = /etc/ansible/ansible.cfg\r\n  configured module search path = [u'/home/ec2-user/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']\r\n  ansible python module location = /usr/lib/python2.7/site-packages/ansible\r\n  executable location = /usr/bin/ansible\r\n  python version = 2.7.5 (default, May  3 2017, 07:55:04) [GCC 4.8.5 20150623 (Red Hat 4.8.5-14)]\r\n```\r\n\r\n##### CONFIGURATION\r\n<!---\r\nIf using Ansible 2.4 or above, paste the results of \"ansible-config dump --only-changed\"\r\nOtherwise, mention any settings you have changed/added/removed in ansible.cfg\r\n(or using the ANSIBLE_* environment variables).\r\n-->\r\n[ec2-user@ip-172-31-57-185 packer]$ ansible-config dump --only-changed\r\n[DEPRECATION WARNING]: ANSIBLE_HOSTS option, The variable is misleading as it can be a list of hosts and/or paths to\r\ninventory sources . This feature will be removed in version 2.8. Deprecation warnings can be disabled by setting\r\ndeprecation_warnings=False in ansible.cfg.\r\nDEFAULT_HOST_LIST(env: ANSIBLE_HOSTS) = [u'/etc/ansible/ec2.py']\r\nHOST_KEY_CHECKING(/etc/ansible/ansible.cfg) = False\r\n##### OS / ENVIRONMENT\r\n<!---\r\nMention the OS you are running Ansible from, and the OS you are\r\nmanaging, or say \"N/A\" for anything that is not platform-specific.\r\nAlso mention the specific version of what you are trying to control,\r\ne.g. if this is a network bug the version of firmware on the network device.\r\n-->\r\n\r\nLinux ip-172-31-57-185.ec2.internal 3.10.0-693.11.6.el7.x86_64 #1 SMP Thu Dec 28 14:23:39 EST 2017 x86_64 x86_64 x86_64 GNU/Linux\r\n\r\n##### SUMMARY\r\n<!--- Explain the problem briefly -->\r\n\r\nError:\r\n\r\n[ec2-user@ip-172-31-57-185 packer]$ ansible-playbook ec2docker-add.yml --check\r\n[DEPRECATION WARNING]: ANSIBLE_HOSTS option, The variable is misleading as it can be a list of hosts and/or paths to\r\ninventory sources . This feature will be removed in version 2.8. Deprecation warnings can be disabled by setting\r\ndeprecation_warnings=False in ansible.cfg.\r\nERROR! 'yum_repository' is not a valid attribute for a Play\r\n\r\nThe error appears to have been in '/home/ec2-user/packer/ec2docker-add.yml': line 3, column 3, but may\r\nbe elsewhere in the file depending on the exact syntax problem.\r\n\r\nThe offending line appears to be:\r\n\r\n\r\n- name: Add repository\r\n  ^ here\r\n\r\nYML:\r\n\r\n[ec2-user@ip-172-31-57-185 packer]$ cat ec2docker-add.yml\r\n---\r\n\r\n- name: Add repository\r\n  yum_repository:\r\n    name: epel\r\n    description: EPEL YUM repo\r\n    baseurl: https://download.fedoraproject.org/pub/epel/$releasever/$basearch/\r\n\r\nYes, this is the default YML from: http://docs.ansible.com/ansible/latest/yum_repository_module.html what I had before was also throwing errors. \r\n\r\n##### STEPS TO REPRODUCE\r\n<!---\r\nFor bugs, show exactly how to reproduce the problem, using a minimal test-case.\r\nFor new features, show how the feature would be used.\r\n-->\r\n\r\nPretty straight forward. It does not pass the check and is listed as invalid. But using it anywhere also come with the same error. \r\n\r\n<!--- Paste example playbooks or commands between quotes below -->\r\n```yaml\r\n---\r\n\r\n- name: Add repository\r\n  yum_repository:\r\n    name: epel\r\n    description: EPEL YUM repo\r\n    baseurl: https://download.fedoraproject.org/pub/epel/$releasever/$basearch/\r\n#    - copy:\r\n#        content: |\r\n#                 https://storebits.docker.com/ee/centos/sub-f2e4cbac-de13-47ab-a2ad-28d676b44a4a\r\n#        dest: /etc/yum/vars/dockerurl\r\n#\r\n#     - name: install docker support packages\r\n#       yum:\r\n#         name: yum-utils device-mapper-persistent-data lvm2\r\n#\r\n#    - name: upgrade all packages\r\n#      yum:\r\n#        name: '*'\r\n#        state: latest\r\n\r\n```\r\n\r\n<!--- You can also paste gist.github.com links for larger files -->\r\n\r\n##### EXPECTED RESULTS\r\n<!--- What did you expect to happen when running the steps above? -->\r\n\r\nI expect to pass the check.\r\n\r\n##### ACTUAL RESULTS\r\n<!--- What actually happened? If possible run with extra verbosity (-vvvv) -->\r\n\r\n<!--- Paste verbatim command output between quotes below -->\r\n```\r\n[ec2-user@ip-172-31-57-185 packer]$ ansible-playbook ec2docker-add.yml --check\r\n[DEPRECATION WARNING]: ANSIBLE_HOSTS option, The variable is misleading as it can be a list of hosts and/or paths to\r\ninventory sources . This feature will be removed in version 2.8. Deprecation warnings can be disabled by setting\r\ndeprecation_warnings=False in ansible.cfg.\r\nERROR! 'yum_repository' is not a valid attribute for a Play\r\n\r\nThe error appears to have been in '/home/ec2-user/packer/ec2docker-add.yml': line 3, column 3, but may\r\nbe elsewhere in the file depending on the exact syntax problem.\r\n\r\nThe offending line appears to be:\r\n\r\n\r\n- name: Add repository\r\n  ^ here\r\n```\r\n"}}
{"actor":{"display_login":"kg4giy"}}