{"action":"created","issue":{"url":"https://api.github.com/repos/JonTheNiceGuy/ansible-version-check/issues/2","repository_url":"https://api.github.com/repos/JonTheNiceGuy/ansible-version-check","labels_url":"https://api.github.com/repos/JonTheNiceGuy/ansible-version-check/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/JonTheNiceGuy/ansible-version-check/issues/2/comments","events_url":"https://api.github.com/repos/JonTheNiceGuy/ansible-version-check/issues/2/events","html_url":"https://github.com/JonTheNiceGuy/ansible-version-check/issues/2","id":337415779,"node_id":"MDU6SXNzdWUzMzc0MTU3Nzk=","number":2,"title":"Suggestion: leverage ansible_version","user":{"login":"danvaida","id":127131,"node_id":"MDQ6VXNlcjEyNzEzMQ==","avatar_url":"https://avatars0.githubusercontent.com/u/127131?v=4","gravatar_id":"","url":"https://api.github.com/users/danvaida","html_url":"https://github.com/danvaida","followers_url":"https://api.github.com/users/danvaida/followers","following_url":"https://api.github.com/users/danvaida/following{/other_user}","gists_url":"https://api.github.com/users/danvaida/gists{/gist_id}","starred_url":"https://api.github.com/users/danvaida/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danvaida/subscriptions","organizations_url":"https://api.github.com/users/danvaida/orgs","repos_url":"https://api.github.com/users/danvaida/repos","events_url":"https://api.github.com/users/danvaida/events{/privacy}","received_events_url":"https://api.github.com/users/danvaida/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-02T08:25:18Z","updated_at":"2018-07-02T09:11:43Z","closed_at":null,"author_association":"NONE","body":"It's quite convenient when you have access to facts:\r\n```bash\r\nok: [localhost] => {\r\n    \"msg\": {\r\n        \"full\": \"2.6.0\",\r\n        \"major\": 2,\r\n        \"minor\": 6,\r\n        \"revision\": 0,\r\n        \"string\": \"2.6.0\"\r\n    }\r\n}\r\n```\r\nFor example:\r\n```bash\r\n      - assert:\r\n        that:\r\n          - \"{{ ansible_version.major }} == 2\"\r\n          - \"{{ ansible_version.minor }} == 6\"\r\n          - \"{{ ansible_version.revision }} >= 0\"\r\n```"},"comment":{"url":"https://api.github.com/repos/JonTheNiceGuy/ansible-version-check/issues/comments/401726008","html_url":"https://github.com/JonTheNiceGuy/ansible-version-check/issues/2#issuecomment-401726008","issue_url":"https://api.github.com/repos/JonTheNiceGuy/ansible-version-check/issues/2","id":401726008,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMTcyNjAwOA==","user":{"login":"JonTheNiceGuy","id":228671,"node_id":"MDQ6VXNlcjIyODY3MQ==","avatar_url":"https://avatars3.githubusercontent.com/u/228671?v=4","gravatar_id":"","url":"https://api.github.com/users/JonTheNiceGuy","html_url":"https://github.com/JonTheNiceGuy","followers_url":"https://api.github.com/users/JonTheNiceGuy/followers","following_url":"https://api.github.com/users/JonTheNiceGuy/following{/other_user}","gists_url":"https://api.github.com/users/JonTheNiceGuy/gists{/gist_id}","starred_url":"https://api.github.com/users/JonTheNiceGuy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JonTheNiceGuy/subscriptions","organizations_url":"https://api.github.com/users/JonTheNiceGuy/orgs","repos_url":"https://api.github.com/users/JonTheNiceGuy/repos","events_url":"https://api.github.com/users/JonTheNiceGuy/events{/privacy}","received_events_url":"https://api.github.com/users/JonTheNiceGuy/received_events","type":"User","site_admin":false},"created_at":"2018-07-02T09:11:43Z","updated_at":"2018-07-02T09:11:43Z","author_association":"OWNER","body":"That's a fair criticism. Unusually, running `ansible -m setup localhost | less` and searching for ansible_version doesn't show anything, but creating a playbook which references the ansible_version number like this works for at least ansible 2.3.\r\n\r\nI need to take a look at this to get this change made, as I'm not currently using it \"in anger\" as the immediate requirement for the role vanished as everyone I was working with upgraded to ansible 2.5... but yes, I will get it sorted out."}}
{"actor":{"display_login":"JonTheNiceGuy"}}