{"action":"created","issue":{"url":"https://api.github.com/repos/fboender/ansible-cmdb/issues/124","repository_url":"https://api.github.com/repos/fboender/ansible-cmdb","labels_url":"https://api.github.com/repos/fboender/ansible-cmdb/issues/124/labels{/name}","comments_url":"https://api.github.com/repos/fboender/ansible-cmdb/issues/124/comments","events_url":"https://api.github.com/repos/fboender/ansible-cmdb/issues/124/events","html_url":"https://github.com/fboender/ansible-cmdb/issues/124","id":253655626,"number":124,"title":"how do you include custom facts in templates?","user":{"login":"lanmand","id":31442298,"avatar_url":"https://avatars3.githubusercontent.com/u/31442298?v=4","gravatar_id":"","url":"https://api.github.com/users/lanmand","html_url":"https://github.com/lanmand","followers_url":"https://api.github.com/users/lanmand/followers","following_url":"https://api.github.com/users/lanmand/following{/other_user}","gists_url":"https://api.github.com/users/lanmand/gists{/gist_id}","starred_url":"https://api.github.com/users/lanmand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lanmand/subscriptions","organizations_url":"https://api.github.com/users/lanmand/orgs","repos_url":"https://api.github.com/users/lanmand/repos","events_url":"https://api.github.com/users/lanmand/events{/privacy}","received_events_url":"https://api.github.com/users/lanmand/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-08-29T13:15:50Z","updated_at":"2017-08-30T07:38:44Z","closed_at":null,"author_association":"NONE","body":"how do you include custom facts in templates?\r\nI have created a custom fact on some of my servers (ansible_local.latestospatch.latestospatch)\r\nhow can i include this value in templates and html reports? "},"comment":{"url":"https://api.github.com/repos/fboender/ansible-cmdb/issues/comments/325908932","html_url":"https://github.com/fboender/ansible-cmdb/issues/124#issuecomment-325908932","issue_url":"https://api.github.com/repos/fboender/ansible-cmdb/issues/124","id":325908932,"user":{"login":"fboender","id":2477515,"avatar_url":"https://avatars2.githubusercontent.com/u/2477515?v=4","gravatar_id":"","url":"https://api.github.com/users/fboender","html_url":"https://github.com/fboender","followers_url":"https://api.github.com/users/fboender/followers","following_url":"https://api.github.com/users/fboender/following{/other_user}","gists_url":"https://api.github.com/users/fboender/gists{/gist_id}","starred_url":"https://api.github.com/users/fboender/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fboender/subscriptions","organizations_url":"https://api.github.com/users/fboender/orgs","repos_url":"https://api.github.com/users/fboender/repos","events_url":"https://api.github.com/users/fboender/events{/privacy}","received_events_url":"https://api.github.com/users/fboender/received_events","type":"User","site_admin":false},"created_at":"2017-08-30T07:38:44Z","updated_at":"2017-08-30T07:38:44Z","author_association":"OWNER","body":"Hi!\r\n\r\nYou can either place the facts on the machine you're controlling with ansible in the `/etc/ansible/facts.d/` directory. For example:\r\n\r\n    fboender @ client $ cat /etc/ansible/facts.d/users.fact\r\n    {\r\n      \"users\": [\"root\", \"fboender\"]\r\n    }\r\n\r\nThe custom facts will be retrieved by ansible automatically and when you generate the overview, the variables will be placed under the 'Host local facts' section.\r\n\r\nYou can also create your own hand-crafted ansible facts output directory and put custom and local facts in there. This is done on the ansible control server. For example:\r\n\r\n    fboender @ ansible $ cat out_custom/host.example.com\r\n    {\r\n        \"custom_facts\": {\r\n            \"software\": {\r\n                \"apache\": {\r\n                  \"version\": \"2.4\",\r\n                  \"install_src\": \"backport_deb\"\r\n                }\r\n            }\r\n        },\r\n        \"ansible_facts\": {\r\n            \"ansible_local\": {\r\n                \"foo\": \"bar\"\r\n            }\r\n        }\r\n    }\r\n\r\nThis can be combined with the host facts that ansible fetched itself with the \"`setup`\" module. This requires that you specify two output directories:\r\n\r\n    ansible-cmdb -i hosts out/ out_custom/ > cmdb.html\r\n\r\nThis will place custom_facts under the heading \"Custom variables\" and the local facts under \"Host local facts\"."}}
{"actor":{"display_login":"fboender"}}