Merge "Removed rpc-repo upstream pip deps"
This commit is contained in:
commit
e135fd2711
@ -26,7 +26,7 @@ ssh_delay: 5
|
||||
repo_service_user_name: nginx
|
||||
repo_service_home_folder: /var/www
|
||||
repo_server_port: 8181
|
||||
repo_pip_default_index: "http://{{ openstack_upstream_domain }}/pools"
|
||||
repo_pip_default_index: "https://rpc-repo.rackspace.com/pools"
|
||||
|
||||
|
||||
## Rsyslog server
|
||||
@ -36,13 +36,11 @@ rsyslog_server_storage_directory: /var/log/log-storage
|
||||
## OpenStack source options
|
||||
# URL for the frozen internal openstack repo.
|
||||
openstack_repo_url: "http://{{ internal_lb_vip_address }}:{{ repo_server_port }}"
|
||||
openstack_upstream_domain: "rpc-repo.rackspace.com"
|
||||
openstack_upstream_url: "http://{{ openstack_upstream_domain }}"
|
||||
|
||||
|
||||
## LXC options
|
||||
lxc_container_caches:
|
||||
- url: "{{ openstack_upstream_url }}/container_images/rpc-trusty-container.tgz"
|
||||
- url: "{{ repo_pip_default_index | netorigin }}/container_images/rpc-trusty-container.tgz"
|
||||
name: "trusty.tgz"
|
||||
sha256sum: "56c6a6e132ea7d10be2f3e8104f47136ccf408b30e362133f0dc4a0a9adb4d0c"
|
||||
|
||||
@ -61,7 +59,10 @@ galera_wsrep_address: "{{ ansible_ssh_host }}"
|
||||
|
||||
## Pip install
|
||||
# Lock down pip to only a specific version of pip
|
||||
pip_get_pip_options: "--no-index --find-links={{ openstack_upstream_url }}/os-releases/{{ openstack_release }} --trusted-host {{ openstack_upstream_domain }}"
|
||||
pip_get_pip_options: >
|
||||
--no-index
|
||||
--find-links="{{ openstack_repo_url }}/os-releases/{{ openstack_release }}"
|
||||
--trusted-host {{ openstack_repo_url | netloc_no_port }}
|
||||
|
||||
|
||||
## Memcached options
|
||||
@ -217,7 +218,7 @@ tempest_pip_instructions: >
|
||||
--index-url {{ repo_pip_default_index }}
|
||||
--extra-index-url https://pypi.python.org/simple
|
||||
--trusted-host pypi.python.org
|
||||
--trusted-host {{ openstack_upstream_domain }}
|
||||
--trusted-host {{ openstack_repo_url | netloc_no_port }}
|
||||
|
||||
## Swift
|
||||
swift_system_user_name: swift
|
||||
|
@ -14,6 +14,9 @@
|
||||
#
|
||||
# (c) 2015, Kevin Carter <kevin.carter@rackspace.com>
|
||||
|
||||
import urlparse
|
||||
|
||||
|
||||
"""Filter usage:
|
||||
|
||||
Simple filters that may be useful from within the stack
|
||||
@ -30,11 +33,69 @@ def bit_length_power_of_2(value):
|
||||
return 2**(int(value)-1).bit_length()
|
||||
|
||||
|
||||
def get_netloc(url):
|
||||
"""Return the netloc from a URL.
|
||||
|
||||
If the input value is not a value URL the method will raise an Ansible
|
||||
filter exception.
|
||||
|
||||
:param url: the URL to parse
|
||||
:type url: ``str``
|
||||
:returns: ``str``
|
||||
"""
|
||||
try:
|
||||
netloc = urlparse.urlparse(url).netloc
|
||||
except Exception as exp:
|
||||
raise errors.AnsibleFilterError(
|
||||
'Failed to return the netloc of: "%s"' % str(exp)
|
||||
)
|
||||
else:
|
||||
return netloc
|
||||
|
||||
|
||||
def get_netloc_no_port(url):
|
||||
"""Return the netloc without a port from a URL.
|
||||
|
||||
If the input value is not a value URL the method will raise an Ansible
|
||||
filter exception.
|
||||
|
||||
:param url: the URL to parse
|
||||
:type url: ``str``
|
||||
:returns: ``str``
|
||||
"""
|
||||
return get_netloc(url=url).split(':')[0]
|
||||
|
||||
|
||||
def get_netorigin(url):
|
||||
"""Return the netloc from a URL.
|
||||
|
||||
If the input value is not a value URL the method will raise an Ansible
|
||||
filter exception.
|
||||
|
||||
:param url: the URL to parse
|
||||
:type url: ``str``
|
||||
:returns: ``str``
|
||||
"""
|
||||
try:
|
||||
parsed_url = urlparse.urlparse(url)
|
||||
netloc = parsed_url.netloc
|
||||
scheme = parsed_url.scheme
|
||||
except Exception as exp:
|
||||
raise errors.AnsibleFilterError(
|
||||
'Failed to return the netorigin of: "%s"' % str(exp)
|
||||
)
|
||||
else:
|
||||
return '%s://%s' % (scheme, netloc)
|
||||
|
||||
|
||||
class FilterModule(object):
|
||||
"""Ansible jinja2 filters."""
|
||||
|
||||
@staticmethod
|
||||
def filters():
|
||||
return {
|
||||
'bit_length_power_of_2': bit_length_power_of_2
|
||||
'bit_length_power_of_2': bit_length_power_of_2,
|
||||
'netloc': get_netloc,
|
||||
'netloc_no_port': get_netloc_no_port,
|
||||
'netorigin': get_netorigin
|
||||
}
|
||||
|
@ -67,6 +67,6 @@ lxc_apt_packages:
|
||||
|
||||
# Prebuilt images to deploy onto hosts for use in containers.
|
||||
# lxc_container_caches:
|
||||
# - url: "{{ openstack_upstream_url }}/container_images/rpc-trusty-container.tgz"
|
||||
# - url: "https://rpc-repo.rackspace.com/container_images/rpc-trusty-container.tgz"
|
||||
# name: "trusty.tgz"
|
||||
# sha256sum: "56c6a6e132ea7d10be2f3e8104f47136ccf408b30e362133f0dc4a0a9adb4d0c"
|
||||
|
@ -54,10 +54,20 @@
|
||||
|
||||
- name: Install PIP
|
||||
shell: "python /opt/get-pip.py {{ pip_get_pip_options }}"
|
||||
changed_when: false
|
||||
ignore_errors: true
|
||||
register: pip_install
|
||||
until: pip_install|success
|
||||
retries: 5
|
||||
retries: 3
|
||||
delay: 2
|
||||
tags:
|
||||
- pip-install
|
||||
|
||||
- name: Install PIP (fall back mode)
|
||||
shell: "python /opt/get-pip.py"
|
||||
when: pip_install.rc != 0
|
||||
register: pip_install_fall_back
|
||||
until: pip_install_fall_back|success
|
||||
retries: 3
|
||||
delay: 2
|
||||
tags:
|
||||
- pip-install
|
||||
|
Loading…
Reference in New Issue
Block a user