-
-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add: support to set more roles in web.xml (#250)
* add: support to set more roles in web.xml * change: README.md and CHANGELOG.md due to pull request: 250 * kick out the strange commit * fix: realigment * remove hard tabs
- Loading branch information
1 parent
880b8d3
commit c349479
Showing
8 changed files
with
147 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# | ||
# Author: Zoltan Lanyi <[email protected]> | ||
# Date : 03.06.2016 | ||
# | ||
|
||
define rundeck::config::securityroles { | ||
|
||
augeas { "rundeck/web.xml/security-role/role-name/${name}": | ||
lens => 'Xml.lns', | ||
incl => $rundeck::params::web_xml, | ||
onlyif => "match web-app/security-role/role-name[#text = '${name}'] size == 0", | ||
changes => [ "set web-app/security-role/#text[last()] '\t\t'", "set web-app/security-role/role-name[last()+1]/#text '${name}'", "set web-app/security-role/#text[last()+1] '\t'" ], | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
require 'spec_helper' | ||
|
||
describe 'rundeck::config::securityroles', type: :define do | ||
context 'supported operating systems' do | ||
%w(Debian RedHat).each do |osfamily| | ||
describe "rundeck::config::securityroles definition with array parameters on #{osfamily}" do | ||
let(:title) { 'source one' } | ||
let(:params) do | ||
{ | ||
'security_roles_array_enabled' => true | ||
} | ||
end | ||
let(:facts) do | ||
{ | ||
osfamily: osfamily, | ||
serialnumber: 0, | ||
rundeck_version: '', | ||
puppetversion: Puppet.version | ||
} | ||
end | ||
|
||
security_roles_array = %w(devops roots) | ||
|
||
security_roles_array.each do |roles| | ||
it "augeas with param: #{roles}" do | ||
contain_augeas('rundeck/web.xml/security-role/role-name') .with_changes(["set web-app/security-role/role-name/#text '#{roles}'"]) | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |