Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #32766 - adds scheme and pulp content path to setting value #200

Merged
10 changes: 9 additions & 1 deletion manifests/plugin/ansible.pp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,16 @@
],
}

if ! $pulpcore::apache_https_vhost {
fail('HTTPS must be turned on for Ansible content')
} elsif $pulpcore::apache::https_port != 443 {
$external_content_url = "https://${pulpcore::servername}:${pulpcore::apache::https_port}${pulpcore::apache::content_path}"
} else {
$external_content_url = "https://${pulpcore::servername}${pulpcore::apache::content_path}"
}

pulpcore::plugin { 'ansible':
config => "ANSIBLE_API_HOSTNAME = \"${pulpcore::servername}\"\nANSIBLE_CONTENT_HOSTNAME = \"${pulpcore::servername}\"",
config => "ANSIBLE_API_HOSTNAME = \"${pulpcore::servername}\"\nANSIBLE_CONTENT_HOSTNAME = \"${external_content_url}\"",
https_content => epp('pulpcore/apache-fragment.epp', $context),
}
}
2 changes: 1 addition & 1 deletion spec/classes/plugin_ansible_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
.with_content(expected_vhost_content)
is_expected.to contain_concat__fragment('plugin-ansible')
.with_content(/^ANSIBLE_API_HOSTNAME = "foo.example.com"/)
.with_content(/^ANSIBLE_CONTENT_HOSTNAME = "foo.example.com"/)
.with_content(%r{^ANSIBLE_CONTENT_HOSTNAME = "https://foo.example.com/pulp/content"})
end
end
end
Expand Down