diff --git a/playbooks/inventory/group_vars/utility_all.yml b/playbooks/inventory/group_vars/utility_all.yml index 436e77c626..cc1fda54ff 100644 --- a/playbooks/inventory/group_vars/utility_all.yml +++ b/playbooks/inventory/group_vars/utility_all.yml @@ -39,6 +39,11 @@ tempest_service_available_swift: "{{ groups['swift_all'] is defined and groups[' # Ensure that the package state matches the global setting utility_package_state: "{{ package_state }}" +# Distribution packages to be installed into the utility container +utility_distro_packages: + - curl + - git + # Python packages to be installed into the utility container utility_pip_packages: - python-memcached diff --git a/playbooks/utility-install.yml b/playbooks/utility-install.yml index c16afec5d9..0f383113f0 100644 --- a/playbooks/utility-install.yml +++ b/playbooks/utility-install.yml @@ -18,12 +18,15 @@ max_fail_percentage: 20 user: root pre_tasks: + - include: common-tasks/os-lxc-container-setup.yml + - include: common-tasks/os-log-dir-setup.yml vars: 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) @@ -32,6 +35,7 @@ state: "directory" force: "yes" when: not is_metal | bool + roles: - role: "galera_client" - role: "pip_install" @@ -40,6 +44,7 @@ - role: "openstack_openrc" tags: - openrc + post_tasks: - name: Update apt sources apt: @@ -49,22 +54,22 @@ until: apt_update|success retries: 5 delay: 2 - when: - - ansible_pkg_mgr == 'apt' + when: ansible_pkg_mgr == 'apt' + - name: Install apt packages apt: pkg: "{{ item }}" state: latest - with_items: "{{ utility_apt_packages | default([]) }}" - when: - - ansible_pkg_mgr == 'apt' + with_items: "{{ utility_distro_packages | default([]) }}" + when: ansible_pkg_mgr == 'apt' + - name: Install yum packages yum: pkg: "{{ item }}" state: latest - with_items: "{{ utility_yum_packages | default([]) }}" - when: - - ansible_pkg_mgr == 'yum' + with_items: "{{ utility_distro_packages | default([]) }}" + when: ansible_pkg_mgr == 'yum' + - name: Get list of python clients shell: "curl -s {{ openstack_repo_url }}/os-releases/{{ openstack_release }}/requirements_absolute_requirements.txt | grep client | cut -d'=' -f1" register: client_list @@ -73,6 +78,7 @@ tags: - always - skip_ansible_lint + - name: Install pip packages pip: name: "{{ client_list.stdout_lines | union(utility_pip_packages) | join(' ') }}" @@ -83,6 +89,7 @@ retries: 5 delay: 2 with_items: "{{ utility_pip_packages }}" + - name: Distribute private ssh key copy: content: "{{ utility_ssh_private_key }}" @@ -90,13 +97,8 @@ mode: 0600 owner: root group: root - when: - - utility_ssh_private_key is defined + when: utility_ssh_private_key is defined vars: - utility_apt_packages: - - git - utility_yum_packages: - - git is_metal: "{{ properties.is_metal|default(false) }}" tags: - utility