Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
if answers['foreman'].is_a?(Hash)
if answers['foreman']['user_groups'] && answers['foreman']['user_groups'].include?('puppet')
answers['foreman']['user_groups'].delete('puppet')
end
end
1 change: 0 additions & 1 deletion config/katello-answers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ foreman:
server_ssl_chain: /etc/pki/katello/certs/katello-server-ca.crt
server_ssl_crl: ""
server_ssl_key: /etc/pki/katello/private/katello-apache.key
user_groups: []
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I figured this does not need to be here anymore.

foreman::cli: true
foreman::cli::ansible: false
foreman::cli::azure: false
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
if answers['foreman'].is_a?(Hash)
if answers['foreman']['user_groups'] && answers['foreman']['user_groups'].include?('puppet')
answers['foreman']['user_groups'].delete('puppet')
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
foreman:
user_groups: []
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
foreman:
user_groups: ['puppet']
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
foreman:
user_groups: []
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
foreman:
user_groups: ['puppet']
20 changes: 20 additions & 0 deletions spec/migration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,24 @@
end
end
end

%w[foreman katello].each do |scenario_name|
context "foreman drop puppet from user_groups" do
let(:answers_after) { load_fixture_yaml('cleanup-foreman-user-groups', "#{scenario_name}-answers-after.yaml") }
let(:scenario) do
{
:answers => load_fixture_yaml('cleanup-foreman-user-groups', "#{scenario_name}-answers-before.yaml"),
:config => load_config_yaml("#{scenario_name}.yaml"),
:migrations => config_path("#{scenario_name}.migrations"),
}
end

let(:migrator) { Kafo::Migrations.new(scenario[:migrations]).run(scenario[:config], scenario[:answers]) }

it 'changes scenario answers' do
_, after = migrator
expect(after).to include answers_after
end
end
end
end