{"action":"created","comment":{"url":"https://api.github.com/repos/geerlingguy/drupal-vm/pulls/comments/93670548","pull_request_review_id":14203583,"id":93670548,"diff_hunk":"@@ -0,0 +1,28 @@\n+- name: Define fully qualified domain name.\n+  set_fact:\n+    hostname_fqdn: \"{{ vagrant_hostname }}\"\n+  when: hostname_fqdn is undefined\n+\n+- name: Define short hostname.\n+  set_fact:\n+    hostname_short: \"{{ hostname_fqdn|regex_replace('^([^.]+).*$', '\\\\1') }}\"\n+  when: hostname_short is undefined\n+\n+- name: Add hostname to /etc/hosts.\n+  lineinfile:\n+    dest: /etc/hosts\n+    regexp: '.*\\t{{ hostname_short }}$'\n+    line: \"127.0.0.1\\t{{ hostname_fqdn }}\\t{{ hostname_short }}\"\n+    state: present\n+    unsafe_writes: \"{{ (ansible_virtualization_type == 'docker')|ternary('yes', 'no')|bool }}\"\n+\n+- name: Configure hostname.\n+  copy:\n+    content: \"{{ (ansible_os_family == 'Debian') | ternary(hostname_short, hostname_fqdn) }}\\n\"\n+    dest: /etc/hostname\n+    unsafe_writes: \"{{ (ansible_virtualization_type == 'docker')|ternary('yes', 'no')|bool }}\"","path":"provisioning/tasks/hostname.yml","position":23,"original_position":23,"commit_id":"c21bb8a14e93833486499900f84c40bbf81a1e0e","original_commit_id":"c21bb8a14e93833486499900f84c40bbf81a1e0e","user":{"login":"geerlingguy","id":481677,"avatar_url":"https://avatars.githubusercontent.com/u/481677?v=3","gravatar_id":"","url":"https://api.github.com/users/geerlingguy","html_url":"https://github.com/geerlingguy","followers_url":"https://api.github.com/users/geerlingguy/followers","following_url":"https://api.github.com/users/geerlingguy/following{/other_user}","gists_url":"https://api.github.com/users/geerlingguy/gists{/gist_id}","starred_url":"https://api.github.com/users/geerlingguy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geerlingguy/subscriptions","organizations_url":"https://api.github.com/users/geerlingguy/orgs","repos_url":"https://api.github.com/users/geerlingguy/repos","events_url":"https://api.github.com/users/geerlingguy/events{/privacy}","received_events_url":"https://api.github.com/users/geerlingguy/received_events","type":"User","site_admin":false},"body":"@oxyc - I was thinking about that... if we do the version compare inside the check for `which ansible`, then I think I'd be game for that. It would prevent a lot of issues and pings on Twitter and chat, for sure.","created_at":"2016-12-22T18:08:35Z","updated_at":"2016-12-22T18:08:36Z","html_url":"https://github.com/geerlingguy/drupal-vm/pull/1070#discussion_r93670548","pull_request_url":"https://api.github.com/repos/geerlingguy/drupal-vm/pulls/1070","_links":{"self":{"href":"https://api.github.com/repos/geerlingguy/drupal-vm/pulls/comments/93670548"},"html":{"href":"https://github.com/geerlingguy/drupal-vm/pull/1070#discussion_r93670548"},"pull_request":{"href":"https://api.github.com/repos/geerlingguy/drupal-vm/pulls/1070"}}},"pull_request":{"url":"https://api.github.com/repos/geerlingguy/drupal-vm/pulls/1070","id":98975978,"html_url":"https://github.com/geerlingguy/drupal-vm/pull/1070","diff_url":"https://github.com/geerlingguy/drupal-vm/pull/1070.diff","patch_url":"https://github.com/geerlingguy/drupal-vm/pull/1070.patch","issue_url":"https://api.github.com/repos/geerlingguy/drupal-vm/issues/1070","number":1070,"state":"open","locked":false,"title":"Configure hostname for environments other than VMs","user":{"login":"oxyc","id":302736,"avatar_url":"https://avatars.githubusercontent.com/u/302736?v=3","gravatar_id":"","url":"https://api.github.com/users/oxyc","html_url":"https://github.com/oxyc","followers_url":"https://api.github.com/users/oxyc/followers","following_url":"https://api.github.com/users/oxyc/following{/other_user}","gists_url":"https://api.github.com/users/oxyc/gists{/gist_id}","starred_url":"https://api.github.com/users/oxyc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oxyc/subscriptions","organizations_url":"https://api.github.com/users/oxyc/orgs","repos_url":"https://api.github.com/users/oxyc/repos","events_url":"https://api.github.com/users/oxyc/events{/privacy}","received_events_url":"https://api.github.com/users/oxyc/received_events","type":"User","site_admin":false},"body":"None of these tasks should issue `changed` state when provisioning for the first time–They should do the exact same thing as Vagrant does. I still haven't made sure of that.\r\n\r\n- Debian uses the short hostname in `/etc/hostname` while RedHat uses the FQDN.\r\n- `/etc/mailname` is a debian thing","created_at":"2016-12-21T17:45:58Z","updated_at":"2016-12-22T18:08:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a46f4f9a8d883343210d772341fad58f239673c2","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/geerlingguy/drupal-vm/pulls/1070/commits","review_comments_url":"https://api.github.com/repos/geerlingguy/drupal-vm/pulls/1070/comments","review_comment_url":"https://api.github.com/repos/geerlingguy/drupal-vm/pulls/comments{/number}","comments_url":"https://api.github.com/repos/geerlingguy/drupal-vm/issues/1070/comments","statuses_url":"https://api.github.com/repos/geerlingguy/drupal-vm/statuses/c21bb8a14e93833486499900f84c40bbf81a1e0e","head":{"label":"oxyc:hostname","ref":"hostname","sha":"c21bb8a14e93833486499900f84c40bbf81a1e0e","user":{"login":"oxyc","id":302736,"avatar_url":"https://avatars.githubusercontent.com/u/302736?v=3","gravatar_id":"","url":"https://api.github.com/users/oxyc","html_url":"https://github.com/oxyc","followers_url":"https://api.github.com/users/oxyc/followers","following_url":"https://api.github.com/users/oxyc/following{/other_user}","gists_url":"https://api.github.com/users/oxyc/gists{/gist_id}","starred_url":"https://api.github.com/users/oxyc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oxyc/subscriptions","organizations_url":"https://api.github.com/users/oxyc/orgs","repos_url":"https://api.github.com/users/oxyc/repos","events_url":"https://api.github.com/users/oxyc/events{/privacy}","received_events_url":"https://api.github.com/users/oxyc/received_events","type":"User","site_admin":false},"repo":{"id":38467501,"name":"drupal-vm","full_name":"oxyc/drupal-vm","owner":{"login":"oxyc","id":302736,"avatar_url":"https://avatars.githubusercontent.com/u/302736?v=3","gravatar_id":"","url":"https://api.github.com/users/oxyc","html_url":"https://github.com/oxyc","followers_url":"https://api.github.com/users/oxyc/followers","following_url":"https://api.github.com/users/oxyc/following{/other_user}","gists_url":"https://api.github.com/users/oxyc/gists{/gist_id}","starred_url":"https://api.github.com/users/oxyc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oxyc/subscriptions","organizations_url":"https://api.github.com/users/oxyc/orgs","repos_url":"https://api.github.com/users/oxyc/repos","events_url":"https://api.github.com/users/oxyc/events{/privacy}","received_events_url":"https://api.github.com/users/oxyc/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/oxyc/drupal-vm","description":"Drupal Development VM using Vagrant + Ansible","fork":true,"url":"https://api.github.com/repos/oxyc/drupal-vm","forks_url":"https://api.github.com/repos/oxyc/drupal-vm/forks","keys_url":"https://api.github.com/repos/oxyc/drupal-vm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/oxyc/drupal-vm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/oxyc/drupal-vm/teams","hooks_url":"https://api.github.com/repos/oxyc/drupal-vm/hooks","issue_events_url":"https://api.github.com/repos/oxyc/drupal-vm/issues/events{/number}","events_url":"https://api.github.com/repos/oxyc/drupal-vm/events","assignees_url":"https://api.github.com/repos/oxyc/drupal-vm/assignees{/user}","branches_url":"https://api.github.com/repos/oxyc/drupal-vm/branches{/branch}","tags_url":"https://api.github.com/repos/oxyc/drupal-vm/tags","blobs_url":"https://api.github.com/repos/oxyc/drupal-vm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/oxyc/drupal-vm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/oxyc/drupal-vm/git/refs{/sha}","trees_url":"https://api.github.com/repos/oxyc/drupal-vm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/oxyc/drupal-vm/statuses/{sha}","languages_url":"https://api.github.com/repos/oxyc/drupal-vm/languages","stargazers_url":"https://api.github.com/repos/oxyc/drupal-vm/stargazers","contributors_url":"https://api.github.com/repos/oxyc/drupal-vm/contributors","subscribers_url":"https://api.github.com/repos/oxyc/drupal-vm/subscribers","subscription_url":"https://api.github.com/repos/oxyc/drupal-vm/subscription","commits_url":"https://api.github.com/repos/oxyc/drupal-vm/commits{/sha}","git_commits_url":"https://api.github.com/repos/oxyc/drupal-vm/git/commits{/sha}","comments_url":"https://api.github.com/repos/oxyc/drupal-vm/comments{/number}","issue_comment_url":"https://api.github.com/repos/oxyc/drupal-vm/issues/comments{/number}","contents_url":"https://api.github.com/repos/oxyc/drupal-vm/contents/{+path}","compare_url":"https://api.github.com/repos/oxyc/drupal-vm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/oxyc/drupal-vm/merges","archive_url":"https://api.github.com/repos/oxyc/drupal-vm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/oxyc/drupal-vm/downloads","issues_url":"https://api.github.com/repos/oxyc/drupal-vm/issues{/number}","pulls_url":"https://api.github.com/repos/oxyc/drupal-vm/pulls{/number}","milestones_url":"https://api.github.com/repos/oxyc/drupal-vm/milestones{/number}","notifications_url":"https://api.github.com/repos/oxyc/drupal-vm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/oxyc/drupal-vm/labels{/name}","releases_url":"https://api.github.com/repos/oxyc/drupal-vm/releases{/id}","deployments_url":"https://api.github.com/repos/oxyc/drupal-vm/deployments","created_at":"2015-07-03T02:27:12Z","updated_at":"2016-01-15T17:16:16Z","pushed_at":"2016-12-22T17:28:40Z","git_url":"git://github.com/oxyc/drupal-vm.git","ssh_url":"git@github.com:oxyc/drupal-vm.git","clone_url":"https://github.com/oxyc/drupal-vm.git","svn_url":"https://github.com/oxyc/drupal-vm","homepage":"http://www.drupalvm.com/","size":1038,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"geerlingguy:master","ref":"master","sha":"da04a1bfa9178cfdfcfa1216a989259c9028f500","user":{"login":"geerlingguy","id":481677,"avatar_url":"https://avatars.githubusercontent.com/u/481677?v=3","gravatar_id":"","url":"https://api.github.com/users/geerlingguy","html_url":"https://github.com/geerlingguy","followers_url":"https://api.github.com/users/geerlingguy/followers","following_url":"https://api.github.com/users/geerlingguy/following{/other_user}","gists_url":"https://api.github.com/users/geerlingguy/gists{/gist_id}","starred_url":"https://api.github.com/users/geerlingguy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geerlingguy/subscriptions","organizations_url":"https://api.github.com/users/geerlingguy/orgs","repos_url":"https://api.github.com/users/geerlingguy/repos","events_url":"https://api.github.com/users/geerlingguy/events{/privacy}","received_events_url":"https://api.github.com/users/geerlingguy/received_events","type":"User","site_admin":false},"repo":{"id":16246536,"name":"drupal-vm","full_name":"geerlingguy/drupal-vm","owner":{"login":"geerlingguy","id":481677,"avatar_url":"https://avatars.githubusercontent.com/u/481677?v=3","gravatar_id":"","url":"https://api.github.com/users/geerlingguy","html_url":"https://github.com/geerlingguy","followers_url":"https://api.github.com/users/geerlingguy/followers","following_url":"https://api.github.com/users/geerlingguy/following{/other_user}","gists_url":"https://api.github.com/users/geerlingguy/gists{/gist_id}","starred_url":"https://api.github.com/users/geerlingguy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geerlingguy/subscriptions","organizations_url":"https://api.github.com/users/geerlingguy/orgs","repos_url":"https://api.github.com/users/geerlingguy/repos","events_url":"https://api.github.com/users/geerlingguy/events{/privacy}","received_events_url":"https://api.github.com/users/geerlingguy/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/geerlingguy/drupal-vm","description":"A VM for local Drupal development","fork":false,"url":"https://api.github.com/repos/geerlingguy/drupal-vm","forks_url":"https://api.github.com/repos/geerlingguy/drupal-vm/forks","keys_url":"https://api.github.com/repos/geerlingguy/drupal-vm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/geerlingguy/drupal-vm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/geerlingguy/drupal-vm/teams","hooks_url":"https://api.github.com/repos/geerlingguy/drupal-vm/hooks","issue_events_url":"https://api.github.com/repos/geerlingguy/drupal-vm/issues/events{/number}","events_url":"https://api.github.com/repos/geerlingguy/drupal-vm/events","assignees_url":"https://api.github.com/repos/geerlingguy/drupal-vm/assignees{/user}","branches_url":"https://api.github.com/repos/geerlingguy/drupal-vm/branches{/branch}","tags_url":"https://api.github.com/repos/geerlingguy/drupal-vm/tags","blobs_url":"https://api.github.com/repos/geerlingguy/drupal-vm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/geerlingguy/drupal-vm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/geerlingguy/drupal-vm/git/refs{/sha}","trees_url":"https://api.github.com/repos/geerlingguy/drupal-vm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/geerlingguy/drupal-vm/statuses/{sha}","languages_url":"https://api.github.com/repos/geerlingguy/drupal-vm/languages","stargazers_url":"https://api.github.com/repos/geerlingguy/drupal-vm/stargazers","contributors_url":"https://api.github.com/repos/geerlingguy/drupal-vm/contributors","subscribers_url":"https://api.github.com/repos/geerlingguy/drupal-vm/subscribers","subscription_url":"https://api.github.com/repos/geerlingguy/drupal-vm/subscription","commits_url":"https://api.github.com/repos/geerlingguy/drupal-vm/commits{/sha}","git_commits_url":"https://api.github.com/repos/geerlingguy/drupal-vm/git/commits{/sha}","comments_url":"https://api.github.com/repos/geerlingguy/drupal-vm/comments{/number}","issue_comment_url":"https://api.github.com/repos/geerlingguy/drupal-vm/issues/comments{/number}","contents_url":"https://api.github.com/repos/geerlingguy/drupal-vm/contents/{+path}","compare_url":"https://api.github.com/repos/geerlingguy/drupal-vm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/geerlingguy/drupal-vm/merges","archive_url":"https://api.github.com/repos/geerlingguy/drupal-vm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/geerlingguy/drupal-vm/downloads","issues_url":"https://api.github.com/repos/geerlingguy/drupal-vm/issues{/number}","pulls_url":"https://api.github.com/repos/geerlingguy/drupal-vm/pulls{/number}","milestones_url":"https://api.github.com/repos/geerlingguy/drupal-vm/milestones{/number}","notifications_url":"https://api.github.com/repos/geerlingguy/drupal-vm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/geerlingguy/drupal-vm/labels{/name}","releases_url":"https://api.github.com/repos/geerlingguy/drupal-vm/releases{/id}","deployments_url":"https://api.github.com/repos/geerlingguy/drupal-vm/deployments","created_at":"2014-01-26T04:26:54Z","updated_at":"2016-12-22T15:46:14Z","pushed_at":"2016-12-22T17:29:29Z","git_url":"git://github.com/geerlingguy/drupal-vm.git","ssh_url":"git@github.com:geerlingguy/drupal-vm.git","clone_url":"https://github.com/geerlingguy/drupal-vm.git","svn_url":"https://github.com/geerlingguy/drupal-vm","homepage":"https://www.drupalvm.com/","size":1003,"stargazers_count":828,"watchers_count":828,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":392,"mirror_url":null,"open_issues_count":25,"forks":392,"open_issues":25,"watchers":828,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/geerlingguy/drupal-vm/pulls/1070"},"html":{"href":"https://github.com/geerlingguy/drupal-vm/pull/1070"},"issue":{"href":"https://api.github.com/repos/geerlingguy/drupal-vm/issues/1070"},"comments":{"href":"https://api.github.com/repos/geerlingguy/drupal-vm/issues/1070/comments"},"review_comments":{"href":"https://api.github.com/repos/geerlingguy/drupal-vm/pulls/1070/comments"},"review_comment":{"href":"https://api.github.com/repos/geerlingguy/drupal-vm/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/geerlingguy/drupal-vm/pulls/1070/commits"},"statuses":{"href":"https://api.github.com/repos/geerlingguy/drupal-vm/statuses/c21bb8a14e93833486499900f84c40bbf81a1e0e"}}}}
{"actor":{"display_login":"geerlingguy"}}