view_facts权限在foreman restful API

时间:2016-03-09 06:21:25

标签: permissions puppet foreman

当我使用foreman 1.7.4版本时,我遇到了一个工头宁静的API问题。

当我尝试使用具有view_facts权限的帐户通过foreman restful API查询给定主机的事实时,它只显示为空,而我可以在Web界面中查询给定主机的事实。

只有在我获得帐户管理员权限的情况下才能通过restful API查询事实,这不是我想要的。因为管理员权限不仅可以查询,还可以更改/写入内容。

给定view_facts权限但不是admin

curl -s -k -u user:passwd -H“接受:版本= 2,application / json”https://sjengpptmst01/api/hosts/test.sample.com/facts

{
  "total": 0,
  "subtotal": 0,
  "page": 1,
  "per_page": 20,
  "search": " host = test.sample.com",
  "sort": {
    "by": null,
    "order": null
  },
  "results": {}
}

Gavin管理员权限

{
  "total": 22066,
  "subtotal": 1,
  "page": 1,
  "per_page": 20,
  "search": " host = test.sample.com",
  "sort": {
    "by": null,
    "order": null
  },
  "results": {"test.sample.com": 
   {"root_home":"/root","path":"/usr/bin:/sbin:/bin:/usr/sbin","rubysitedir":"/usr/lib/ruby/site_ruby/1.8","puppet_vardir":"/var/lib/puppet","unlabeled_dev_count":"0\n","macaddress_eth0":"00:50:56:A9:F0:DC","macaddress":"00:50:56:A9:F0:DC","bios_release_date":"06/22/2012","uniqueid":"090a444c","augeasversion":"1.0.0","rubyversion":"1.8.7","network_eth0":"10.9.76.0","ipaddress":"10.9.76.68","ipaddress_eth0":"10.9.76.68","blockdevice_sr0_size":"1073741312","network_lo":"127.0.0.0","ipaddress_lo":"127.0.0.1","uptime_hours":"143","mtu_eth0":"1500","facterversion":"2.4.3"}}
}

但是当我使用firefox在没有管理员权限的情况下使用给定的accout访问给定主机时,它可以在Web浏览器上显示事实。

1 个答案:

答案 0 :(得分:0)

这被报告为Foreman bug #9793并且已在Foreman 1.9.0中修复,因此您应该考虑从1.7升级到新版本。

升级时,建议您浏览每个主要版本,因为多个版本的跳转未经过测试且可能存在问题。

http://theforeman.org/manuals/1.8/index.html#3.6Upgrade http://theforeman.org/manuals/1.9/index.html#3.6Upgrade http://theforeman.org/manuals/1.10/index.html#3.6Upgrade

撰写本文时的稳定版本为1.10.x,发布候选版状态为1.11.x.