Working with public_attributes.json
contribute
Chef stores a copy of a nodes attributes at the end of a reconfigure in /opt/gitlab/embedded/nodes/$NODE_NAME.json
. Due to the sensitive nature of some of the attributes, it is only readable by the root user. To work around this, we’ve created a file (defaults to /var/opt/gitlab/public_attributes.json
) which contains a set of attributes we’ve whitelisted for use of non-root services. This file is recreated on every run of gitlab-ctl reconfigure
.
Adding an entry to public_attributes.json
The public_attributes.json
file is populated by merging the results of a call to the public_attributes
method of a helper class. For example:
class TestHelper < BaseHelper
attr_accessor :node
def public_attributes
{
'gitlab' => {
'test' => node['gitlab']['test']
}
}
end
end
The file is generated as part of the GitLabHandler.
Reading an entry from public_attributes.json
from a gitlab-ctl
command
In order to access the public nodes, you should use the provided GitlabCtl::Util.get_public_node_attributes
method
attributes = GitlabCtl::Util.get_public_node_attributes
puts attributes['gitlab']['test']
Docs
Edit this page to fix an error or add an improvement in a merge request.
Create an issue to suggest an improvement to this page.
Product
Create an issue if there's something you don't like about this feature.
Propose functionality by submitting a feature request.
Feature availability and product trials
View pricing to see all GitLab tiers and features, or to upgrade.
Try GitLab for free with access to all features for 30 days.
Get help
If you didn't find what you were looking for, search the docs.
If you want help with something specific and could use community support, post on the GitLab forum.
For problems setting up or using this feature (depending on your GitLab subscription).
Request support