Module: Katello::ContentSourceHelper
- Defined in:
- app/helpers/katello/content_source_helper.rb
Instance Method Summary collapse
- #configure_subman(content_source) ⇒ Object
- #missing_content_source(host) ⇒ Object
- #prepare_ssl_cert(ca_cert) ⇒ Object
- #reconfigure_yggdrasild(host) ⇒ Object
Instance Method Details
#configure_subman(content_source) ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'app/helpers/katello/content_source_helper.rb', line 27 def configure_subman(content_source) " # Configure subscription-manager\n RHSM_CFG=/etc/rhsm/rhsm.conf\n\n test -f $RHSM_CFG.bak || cp $RHSM_CFG $RHSM_CFG.bak\n\n subscription-manager config \\\n --server.hostname=\"\#{content_source.rhsm_url.host}\" \\\n --server.port=\"\#{content_source.rhsm_url.port}\" \\\n --server.prefix=\"\#{content_source.rhsm_url.path}\" \\\n --rhsm.repo_ca_cert=\"$KATELLO_SERVER_CA_CERT\" \\\n --rhsm.baseurl=\"\#{content_source.pulp_content_url}\"\n\n subscription-manager facts --update\n CMD\nend\n" |
#missing_content_source(host) ⇒ Object
3 4 5 6 7 8 |
# File 'app/helpers/katello/content_source_helper.rb', line 3 def missing_content_source(host) " echo \"Host [\#{host.name}] doesn't have an assigned content source!\"\n exit 1\n CMD\nend\n" |
#prepare_ssl_cert(ca_cert) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'app/helpers/katello/content_source_helper.rb', line 10 def prepare_ssl_cert(ca_cert) " # Prepare SSL certificate\n\n KATELLO_SERVER_CA_CERT=/etc/rhsm/ca/katello-server-ca.pem\n SSL_CA_CERT=$(mktemp)\n cat << EOF > $SSL_CA_CERT\n \#{ca_cert}\n EOF\n\n mkdir -p /etc/rhsm/ca\n cp -f $SSL_CA_CERT $KATELLO_SERVER_CA_CERT\n chmod 644 $KATELLO_SERVER_CA_CERT\n\n CMD\nend\n" |
#reconfigure_yggdrasild(host) ⇒ Object
45 46 47 48 49 50 51 52 |
# File 'app/helpers/katello/content_source_helper.rb', line 45 def reconfigure_yggdrasild(host) template = Template.find_by(name: 'remote_execution_pull_setup') return '' unless template source = Foreman::Renderer.get_source(template: template, host: host) scope = Foreman::Renderer.get_scope(source: source, host: host) Foreman::Renderer.render(source, scope) end |