Skip to content

Commit

Permalink
Fixes #35390 - set ANSIBLE_API_HOSTNAME *with* scheme
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeni authored and ekohl committed Aug 22, 2022
1 parent 977a4d3 commit 5858c93
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion manifests/plugin/ansible.pp
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@
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}"
$external_api_url = "https://${pulpcore::servername}:${pulpcore::apache::https_port}"
} else {
$external_content_url = "https://${pulpcore::servername}${pulpcore::apache::content_path}"
$external_api_url = "https://${pulpcore::servername}"
}

pulpcore::plugin { 'ansible':
config => "ANSIBLE_API_HOSTNAME = \"${pulpcore::servername}\"\nANSIBLE_CONTENT_HOSTNAME = \"${external_content_url}\"",
config => "ANSIBLE_API_HOSTNAME = \"${external_api_url}\"\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 @@ -24,7 +24,7 @@
is_expected.to contain_apache__vhost__fragment('pulpcore-https-plugin-ansible')
.with_content(expected_vhost_content)
is_expected.to contain_concat__fragment('plugin-ansible')
.with_content(/^ANSIBLE_API_HOSTNAME = "foo.example.com"/)
.with_content(%r{^ANSIBLE_API_HOSTNAME = "https://foo.example.com"})
.with_content(%r{^ANSIBLE_CONTENT_HOSTNAME = "https://foo.example.com/pulp/content"})
end
end
Expand Down

0 comments on commit 5858c93

Please sign in to comment.