Skip to content

Instantly share code, notes, and snippets.

@dustinmm80
Created August 6, 2015 21:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dustinmm80/50afe46e614e01cbd4c7 to your computer and use it in GitHub Desktop.
Save dustinmm80/50afe46e614e01cbd4c7 to your computer and use it in GitHub Desktop.
host-factory in policy
policy 'tomcat_policy' do
security_admin_group = group '/security_admin'
devops_group = group 'devops'
tomcat_hosts_layer = layer 'tomcat_hosts'
tomcat_factory = host_factory 'tomcat_factory',
:layers => [tomcat_hosts_layer],
:roleid => security_admin_group.roleid
tomcat_hosts_layer.role.grant_to tomcat_factory, :admin_option => true
tomcat_variables = [
variable('database_password'),
variable('api_key')
]
tomcat_variables.each do |v|
v.permit 'read', devops_group
v.permit 'execute', devops_group
v.permit 'update', devops_group
v.permit 'execute', tomcat_hosts_layer
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment