diff --git a/manifests/config.pp b/manifests/config.pp index 3a5072eb..5ce2dd7d 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -12,7 +12,7 @@ file { "${katello::config_dir}/katello.yaml": ensure => file, - content => template('katello/katello.yml.erb'), + content => template('katello/katello.yaml.erb'), owner => $katello::user, group => $katello::group, mode => '0644', diff --git a/spec/classes/katello_config_spec.rb b/spec/classes/katello_config_spec.rb index fa9b43ec..63f09b4c 100644 --- a/spec/classes/katello_config_spec.rb +++ b/spec/classes/katello_config_spec.rb @@ -33,20 +33,20 @@ should contain_file('/etc/foreman/plugins/katello.yaml') content = catalogue.resource('file', '/etc/foreman/plugins/katello.yaml').send(:parameters)[:content] content.split("\n").reject { |c| c =~ /(^#|^$)/ }.should == [ - 'common:', - ' rest_client_timeout: 120', - ' post_sync_url: https://localhost/katello/api/v2/repositories/sync_complete?token=test_token', - ' candlepin:', - ' url: https://localhost:8443/candlepin', - ' oauth_key: katello', - ' oauth_secret: secret', - ' pulp:', - " url: https://#{facts[:fqdn]}/pulp/api/v2/", - ' oauth_key: katello', - ' oauth_secret: secret', - ' qpid:', - " url: amqp:ssl:#{facts[:fqdn]}:5671", - ' subscriptions_queue_address: katello_event_queue' + ':katello:', + ' :rest_client_timeout: 120', + ' :post_sync_url: https://localhost/katello/api/v2/repositories/sync_complete?token=test_token', + ' :candlepin:', + ' :url: https://localhost:8443/candlepin', + ' :oauth_key: katello', + ' :oauth_secret: secret', + ' :pulp:', + " :url: https://#{facts[:fqdn]}/pulp/api/v2/", + ' :oauth_key: katello', + ' :oauth_secret: secret', + ' :qpid:', + " :url: amqp:ssl:#{facts[:fqdn]}:5671", + ' :subscriptions_queue_address: katello_event_queue' ] end end @@ -71,25 +71,25 @@ should contain_file('/etc/foreman/plugins/katello.yaml') content = catalogue.resource('file', '/etc/foreman/plugins/katello.yaml').send(:parameters)[:content] content.split("\n").reject { |c| c =~ /(^#|^$)/ }.should == [ - 'common:', - ' rest_client_timeout: 120', - ' post_sync_url: https://localhost/katello/api/v2/repositories/sync_complete?token=test_token', - ' candlepin:', - ' url: https://localhost:8443/candlepin', - ' oauth_key: katello', - ' oauth_secret: secret', - ' pulp:', - " url: https://#{facts[:fqdn]}/pulp/api/v2/", - ' oauth_key: katello', - ' oauth_secret: secret', - ' qpid:', - " url: amqp:ssl:#{facts[:fqdn]}:5671", - ' subscriptions_queue_address: katello_event_queue', - ' cdn_proxy:', - ' host: http://myproxy.org', - ' port: 8888', - ' user: admin', - ' password: secret_password' + ':katello:', + ' :rest_client_timeout: 120', + ' :post_sync_url: https://localhost/katello/api/v2/repositories/sync_complete?token=test_token', + ' :candlepin:', + ' :url: https://localhost:8443/candlepin', + ' :oauth_key: katello', + ' :oauth_secret: secret', + ' :pulp:', + " :url: https://#{facts[:fqdn]}/pulp/api/v2/", + ' :oauth_key: katello', + ' :oauth_secret: secret', + ' :qpid:', + " :url: amqp:ssl:#{facts[:fqdn]}:5671", + ' :subscriptions_queue_address: katello_event_queue', + ' :cdn_proxy:', + ' :host: http://myproxy.org', + ' :port: 8888', + ' :user: admin', + ' :password: secret_password' ] end end diff --git a/spec/classes/katello_spec.rb b/spec/classes/katello_spec.rb index 26a5a30c..4d9feb12 100644 --- a/spec/classes/katello_spec.rb +++ b/spec/classes/katello_spec.rb @@ -34,7 +34,7 @@ it 'should set up the cdn_ssl_version' do should contain_file('/etc/foreman/plugins/katello.yaml'). - with_content(/^\s*cdn_ssl_version:\s*TLSv1$/) + with_content(/^\s*:cdn_ssl_version:\s*TLSv1$/) end end end diff --git a/templates/katello.yaml.erb b/templates/katello.yaml.erb new file mode 100644 index 00000000..f390ec41 --- /dev/null +++ b/templates/katello.yaml.erb @@ -0,0 +1,33 @@ +### File managed with puppet ### +## Module: puppet-katello + +:katello: + <%- if @cdn_ssl_version && !@cdn_ssl_version.strip.empty?-%> + :cdn_ssl_version: <%= @cdn_ssl_version %> + <%- end -%> + + :rest_client_timeout: 120 + + :post_sync_url: https://localhost<%= @deployment_url %>/api/v2/repositories/sync_complete?token=<%= @post_sync_token %> + + :candlepin: + :url: <%= @candlepin_url %> + :oauth_key: <%= @oauth_key %> + :oauth_secret: <%= @oauth_secret %> + + :pulp: + :url: <%= @pulp_url %> + :oauth_key: <%= @oauth_key %> + :oauth_secret: <%= @oauth_secret %> + + :qpid: + :url: <%= @qpid_url %> + :subscriptions_queue_address: <%= @candlepin_event_queue %> + +<%- if @proxy_url -%> + :cdn_proxy: + :host: <%= @proxy_url %> + :port: <%= @proxy_port %> + :user: <%= @proxy_username %> + :password: <%= @proxy_password %> +<%- end -%> diff --git a/templates/katello.yml.erb b/templates/katello.yml.erb deleted file mode 100644 index de8a7278..00000000 --- a/templates/katello.yml.erb +++ /dev/null @@ -1,43 +0,0 @@ -# -# WARNING: THIS CONFIGURATION WAS GENERATED BY KATELLO-CONFIGURE TOOL, -# CHANGES WILL LIKELY BE OVERWRITTEN. IF YOU WISH TO PRESERVE ANY CHANGES -# TO THIS FILE PLEASE EDIT /usr/share/katello/install/default-answer-file -# FOR THE CORRESPONDING OPTION AND RERUN katello-configure. -# - -# Katello configuration -# -# :vim:sw=2:ts=2:et: - -# see /usr/share/katello/config.katello_defaults.yml for available options - -common: - <%- if @cdn_ssl_version && !@cdn_ssl_version.strip.empty?-%> - cdn_ssl_version: <%= @cdn_ssl_version %> - <%- end -%> - - rest_client_timeout: 120 - - post_sync_url: https://localhost<%= @deployment_url %>/api/v2/repositories/sync_complete?token=<%= @post_sync_token %> - - candlepin: - url: <%= @candlepin_url %> - oauth_key: <%= @oauth_key %> - oauth_secret: <%= @oauth_secret %> - - pulp: - url: <%= @pulp_url %> - oauth_key: <%= @oauth_key %> - oauth_secret: <%= @oauth_secret %> - - qpid: - url: <%= @qpid_url %> - subscriptions_queue_address: <%= @candlepin_event_queue %> - -<%- if @proxy_url -%> - cdn_proxy: - host: <%= @proxy_url %> - port: <%= @proxy_port %> - user: <%= @proxy_username %> - password: <%= @proxy_password %> -<%- end -%>