diff --git a/playbooks/common-tasks/package-cache-proxy.yml b/playbooks/common-tasks/package-cache-proxy.yml new file mode 100644 index 0000000000..335c8319df --- /dev/null +++ b/playbooks/common-tasks/package-cache-proxy.yml @@ -0,0 +1,30 @@ +--- +# Copyright 2016, Logan Vig +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +- name: Drop apt package manager proxy + copy: + content: 'Acquire::http { Proxy "{{ repo_pkg_cache_url }}"; };' + dest: "/etc/apt/apt.conf.d/00apt-cacher-proxy" + when: + - ansible_os_family == 'Debian' + - repo_pkg_cache_enabled | bool + +- name: Drop yum package manager proxy + lineinfile: + line: 'proxy={{ repo_pkg_cache_url }}' + dest: "/etc/yum.conf" + when: + - ansible_os_family == 'RedHat' + - repo_pkg_cache_enabled | bool diff --git a/playbooks/galera-install.yml b/playbooks/galera-install.yml index 283a04a7be..c8abff840e 100644 --- a/playbooks/galera-install.yml +++ b/playbooks/galera-install.yml @@ -24,6 +24,7 @@ list_of_bind_mounts: - bind_dir_path: "/var/lib/mysql" mount_path: "/openstack/{{ inventory_hostname }}" + - include: common-tasks/package-cache-proxy.yml vars: is_metal: "{{ properties.is_metal|default(false) }}" tags: diff --git a/playbooks/haproxy-install.yml b/playbooks/haproxy-install.yml index fdb057fec9..1b00ca1147 100644 --- a/playbooks/haproxy-install.yml +++ b/playbooks/haproxy-install.yml @@ -72,6 +72,8 @@ tags: - "haproxy-rsyslog-client" - "rsyslog-client" + post_tasks: + - include: common-tasks/package-cache-proxy.yml vars_files: - vars/configs/haproxy_config.yml vars: diff --git a/playbooks/inventory/group_vars/all.yml b/playbooks/inventory/group_vars/all.yml index aa8660e707..32de1f6c41 100644 --- a/playbooks/inventory/group_vars/all.yml +++ b/playbooks/inventory/group_vars/all.yml @@ -36,6 +36,8 @@ pip_links: # URL for the frozen internal openstack repo. repo_server_port: 8181 repo_pkg_cache_enabled: true +repo_pkg_cache_port: 3142 +repo_pkg_cache_url: "http://{{ internal_lb_vip_address }}:{{ repo_pkg_cache_port }}" openstack_repo_url: "http://{{ internal_lb_vip_address }}:{{ repo_server_port }}" openstack_repo_git_url: "git://{{ internal_lb_vip_address }}" @@ -240,4 +242,3 @@ ansible_ssh_extra_args: > -o ForwardX11=no -o ForwardAgent=yes -T - diff --git a/playbooks/memcached-install.yml b/playbooks/memcached-install.yml index ad5ca261c6..fac887a214 100644 --- a/playbooks/memcached-install.yml +++ b/playbooks/memcached-install.yml @@ -25,6 +25,7 @@ log_dirs: - src: "/openstack/log/{{ inventory_hostname }}-memcached" dest: "/var/log/memcached" + - include: common-tasks/package-cache-proxy.yml roles: - { role: "memcached_server", tags: [ "memcached-server" ] } - role: "system_crontab_coordination" diff --git a/playbooks/os-aodh-install.yml b/playbooks/os-aodh-install.yml index b9c39d594e..df595d5f43 100644 --- a/playbooks/os-aodh-install.yml +++ b/playbooks/os-aodh-install.yml @@ -43,6 +43,7 @@ login_host: "{{ aodh_galera_address }}" db_name: "{{ aodh_galera_database }}" when: inventory_hostname == groups['aodh_all'][0] + - include: common-tasks/package-cache-proxy.yml roles: - role: "os_aodh" aodh_venv_tag: "{{ openstack_release }}" diff --git a/playbooks/os-ceilometer-install.yml b/playbooks/os-ceilometer-install.yml index 556ddc9496..41aaea33d1 100644 --- a/playbooks/os-ceilometer-install.yml +++ b/playbooks/os-ceilometer-install.yml @@ -36,6 +36,7 @@ log_dirs: - src: "/openstack/log/{{ inventory_hostname }}-ceilometer" dest: "/var/log/ceilometer" + - include: common-tasks/package-cache-proxy.yml roles: - role: "os_ceilometer" ceilometer_venv_tag: "{{ openstack_release }}" diff --git a/playbooks/os-cinder-install.yml b/playbooks/os-cinder-install.yml index a2b79cfadd..d0884e2d14 100644 --- a/playbooks/os-cinder-install.yml +++ b/playbooks/os-cinder-install.yml @@ -55,6 +55,7 @@ login_host: "{{ cinder_galera_address }}" db_name: "{{ cinder_galera_database }}" when: inventory_hostname == groups['cinder_all'][0] + - include: common-tasks/package-cache-proxy.yml - name: Add volume group block device to cinder shell: | diff --git a/playbooks/os-glance-install.yml b/playbooks/os-glance-install.yml index a1b08e70d3..901c81080f 100644 --- a/playbooks/os-glance-install.yml +++ b/playbooks/os-glance-install.yml @@ -50,6 +50,7 @@ login_host: "{{ glance_galera_address }}" db_name: "{{ glance_galera_database }}" when: inventory_hostname == groups['glance_all'][0] + - include: common-tasks/package-cache-proxy.yml roles: - role: "os_glance" glance_venv_tag: "{{ openstack_release }}" diff --git a/playbooks/os-gnocchi-install.yml b/playbooks/os-gnocchi-install.yml index 519c608857..52cc905296 100644 --- a/playbooks/os-gnocchi-install.yml +++ b/playbooks/os-gnocchi-install.yml @@ -38,6 +38,7 @@ login_host: "{{ gnocchi_galera_address }}" db_name: "{{ gnocchi_galera_database }}" when: inventory_hostname == groups['gnocchi_all'][0] + - include: common-tasks/package-cache-proxy.yml roles: - role: "os_gnocchi" gnocchi_venv_tag: "{{ openstack_release }}" diff --git a/playbooks/os-heat-install.yml b/playbooks/os-heat-install.yml index 8d872c2d31..24ca91d41a 100644 --- a/playbooks/os-heat-install.yml +++ b/playbooks/os-heat-install.yml @@ -43,6 +43,7 @@ login_host: "{{ heat_galera_address }}" db_name: "{{ heat_galera_database }}" when: inventory_hostname == groups['heat_all'][0] + - include: common-tasks/package-cache-proxy.yml roles: - role: "os_heat" heat_venv_tag: "{{ openstack_release }}" diff --git a/playbooks/os-horizon-install.yml b/playbooks/os-horizon-install.yml index c4e1154abc..b058311c4e 100644 --- a/playbooks/os-horizon-install.yml +++ b/playbooks/os-horizon-install.yml @@ -35,6 +35,7 @@ login_host: "{{ horizon_galera_address }}" db_name: "{{ horizon_galera_database }}" when: inventory_hostname == groups['horizon_all'][0] + - include: common-tasks/package-cache-proxy.yml roles: - role: "os_horizon" horizon_venv_tag: "{{ openstack_release }}" diff --git a/playbooks/os-ironic-install.yml b/playbooks/os-ironic-install.yml index 38c130648f..ddbe5300fe 100644 --- a/playbooks/os-ironic-install.yml +++ b/playbooks/os-ironic-install.yml @@ -37,6 +37,7 @@ login_host: "{{ ironic_galera_address }}" db_name: "{{ ironic_galera_database }}" when: inventory_hostname == groups['ironic_all'][0] + - include: common-tasks/package-cache-proxy.yml roles: - role: "os_ironic" ironic_venv_tag: "{{ openstack_release }}" diff --git a/playbooks/os-keystone-install.yml b/playbooks/os-keystone-install.yml index 378a208e8d..afba092556 100644 --- a/playbooks/os-keystone-install.yml +++ b/playbooks/os-keystone-install.yml @@ -43,6 +43,7 @@ login_host: "{{ keystone_galera_address }}" db_name: "{{ keystone_galera_database }}" when: inventory_hostname == groups['keystone_all'][0] + - include: common-tasks/package-cache-proxy.yml # todo(cloudnull): this task is being run only if/when keystone is installed on a physical host. # This is not being run within a container because it is an unsupported action due to this diff --git a/playbooks/os-neutron-install.yml b/playbooks/os-neutron-install.yml index 5a862b8c33..d55f117ba1 100644 --- a/playbooks/os-neutron-install.yml +++ b/playbooks/os-neutron-install.yml @@ -53,6 +53,7 @@ login_host: "{{ neutron_galera_address }}" db_name: "{{ neutron_galera_database }}" when: inventory_hostname == groups['neutron_all'][0] + - include: common-tasks/package-cache-proxy.yml - name: Create the neutron provider networks facts provider_networks: diff --git a/playbooks/os-nova-install.yml b/playbooks/os-nova-install.yml index ae76644298..4ac7e3d9cd 100644 --- a/playbooks/os-nova-install.yml +++ b/playbooks/os-nova-install.yml @@ -50,6 +50,7 @@ login_host: "{{ nova_api_galera_address }}" db_name: "{{ nova_api_galera_database }}" when: inventory_hostname == groups['nova_all'][0] + - include: common-tasks/package-cache-proxy.yml - name: Add nbd devices to the compute shell: | diff --git a/playbooks/os-swift-install.yml b/playbooks/os-swift-install.yml index 09c1584159..8dc30c9770 100644 --- a/playbooks/os-swift-install.yml +++ b/playbooks/os-swift-install.yml @@ -27,6 +27,7 @@ dest: "/var/log/swift" owner: "syslog" group: "syslog" + - include: common-tasks/package-cache-proxy.yml - name: Set swift storage bridge (is_metal) set_fact: diff --git a/playbooks/rabbitmq-install.yml b/playbooks/rabbitmq-install.yml index c9cefc1400..a358b3348c 100644 --- a/playbooks/rabbitmq-install.yml +++ b/playbooks/rabbitmq-install.yml @@ -20,6 +20,7 @@ user: root pre_tasks: - include: common-tasks/os-lxc-container-setup.yml + - include: common-tasks/package-cache-proxy.yml roles: - role: "system_crontab_coordination" tags: diff --git a/playbooks/repo-server.yml b/playbooks/repo-server.yml index e5680ca456..6d45587c0c 100644 --- a/playbooks/repo-server.yml +++ b/playbooks/repo-server.yml @@ -44,22 +44,3 @@ - "rsyslog-client" vars: is_metal: "{{ properties.is_metal|default(false) }}" - -- name: Setup package manager proxy - hosts: all:!repo_all - tasks: - - name: Drop apt package manager proxy - copy: - content: 'Acquire::http { Proxy "http://{{ internal_lb_vip_address }}:3142"; };' - dest: "/etc/apt/apt.conf.d/00apt-cacher-proxy" - when: - - ansible_os_family == 'Debian' - - repo_pkg_cache_enabled | bool - - name: Drop apt package manager proxy - lineinfile: - line: 'proxy=http://{{ internal_lb_vip_address }}:3142' - dest: "/etc/yum.conf" - when: - - ansible_os_family == 'RedHat' - - repo_pkg_cache_enabled | bool - diff --git a/playbooks/rsyslog-install.yml b/playbooks/rsyslog-install.yml index f095782c2f..e0a9ee1e80 100644 --- a/playbooks/rsyslog-install.yml +++ b/playbooks/rsyslog-install.yml @@ -24,6 +24,7 @@ list_of_bind_mounts: - bind_dir_path: "{{ storage_directory }}" mount_path: "/openstack/{{ inventory_hostname }}/log-storage" + - include: common-tasks/package-cache-proxy.yml roles: - { role: "rsyslog_server", tags: [ "rsyslog-server" ] } - role: "system_crontab_coordination" diff --git a/playbooks/setup-infrastructure.yml b/playbooks/setup-infrastructure.yml index 57cf92f238..b9864966cc 100644 --- a/playbooks/setup-infrastructure.yml +++ b/playbooks/setup-infrastructure.yml @@ -13,9 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +- include: repo-install.yml - include: haproxy-install.yml - include: memcached-install.yml -- include: repo-install.yml - include: galera-install.yml - include: rabbitmq-install.yml - include: utility-install.yml diff --git a/playbooks/utility-install.yml b/playbooks/utility-install.yml index 78118465e8..30a902b952 100644 --- a/playbooks/utility-install.yml +++ b/playbooks/utility-install.yml @@ -24,6 +24,7 @@ log_dirs: - src: "/openstack/log/{{ inventory_hostname }}-utility" dest: "/var/log/utility" + - include: common-tasks/package-cache-proxy.yml - name: Create log directory (not is_metal) file: diff --git a/playbooks/vars/configs/haproxy_config.yml b/playbooks/vars/configs/haproxy_config.yml index 1633b57f11..9208968d26 100644 --- a/playbooks/vars/configs/haproxy_config.yml +++ b/playbooks/vars/configs/haproxy_config.yml @@ -52,7 +52,7 @@ haproxy_default_services: haproxy_backend_nodes: "{{ [groups['repo_all'][0]] | default([]) }}" # list expected haproxy_backup_nodes: "{{ groups['repo_all'][1:] | default([]) }}" haproxy_ssl: "{{ haproxy_ssl }}" - haproxy_port: 3142 + haproxy_port: "{{ repo_pkg_cache_port }}" haproxy_balance_type: http haproxy_backend_options: - "httpchk HEAD /acng-report.html"