diff --git a/defaults/main.yml b/defaults/main.yml index 120fc95..e007330 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -103,21 +103,6 @@ barbican_ssl_self_signed_subject: "/C=US/ST=Texas/L=San Antonio/O=IT/CN={{ inter #barbican_user_ssl_key: #barbican_user_ssl_ca_cert: -barbican_apt_packages: - - apache2 - - apache2-utils - - libapache2-mod-wsgi - - python-dev - - libssl-dev - # - libxml2-dev - # - libmysqlclient-dev - # - libxslt-dev - - libpq-dev - - git - - libffi-dev - - gettext - - build-essential - barbican_pip_packages: - alembic - Babel diff --git a/meta/main.yml b/meta/main.yml index 12e551d..01f7c95 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -21,5 +21,7 @@ dependencies: - role: pip_install when: - barbican_developer_mode | bool - - apt_package_pinning + - role: apt_package_pinning + when: + - ansible_pkg_mgr == 'apt' - galera_client diff --git a/tasks/barbican_install_apt.yml b/tasks/barbican_install_apt.yml new file mode 100644 index 0000000..1f4a918 --- /dev/null +++ b/tasks/barbican_install_apt.yml @@ -0,0 +1,32 @@ +# Copyright 2016, Intel Corporation. +# +# 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: Update apt sources + apt: + update_cache: "yes" + cache_valid_time: "600" + register: apt_update + until: apt_update |success + retries: 5 + delay: 2 + +- name: Install apt packages for Barbican + apt: + pkg: "{{ item }}" + state: "latest" + register: install_barbican_apt_packages + until: install_barbican_apt_packages |success + retries: 5 + delay: 2 + with_items: barbican_apt_packages diff --git a/tasks/install.yml b/tasks/install.yml index ee66332..fd9a438 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -13,14 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -- name: Update apt sources - apt: - update_cache: "yes" - cache_valid_time: "600" - register: apt_update - until: apt_update |success - retries: 5 - delay: 2 +- include: barbican_install_apt.yml + when: + - ansible_pkg_mgr == 'apt' tags: - barbican-apt-packages - barbican-apt-sources diff --git a/tasks/main.yml b/tasks/main.yml index 7ec2c31..dce92d8 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -15,6 +15,15 @@ # Main tasks file for openstack-ansible-barbican +- name: Gather variables for each operating system + include_vars: "{{ item }}" + with_first_found: + - "{{ ansible_distribution | lower }}-{{ ansible_distribution_version | lower }}.yml" + - "{{ ansible_distribution | lower }}.yml" + - "{{ ansible_os_family | lower }}.yml" + tags: + - always + - include: pre-install.yml - include: install.yml diff --git a/vars/ubuntu-14.04.yml b/vars/ubuntu-14.04.yml new file mode 100644 index 0000000..ac87bd3 --- /dev/null +++ b/vars/ubuntu-14.04.yml @@ -0,0 +1,28 @@ +# Copyright 2016, Intel Corporation. +# +# 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. + +barbican_apt_packages: + - apache2 + - apache2-utils + - libapache2-mod-wsgi + - python-dev + - libssl-dev + # - libxml2-dev + # - libmysqlclient-dev + # - libxslt-dev + - libpq-dev + - git + - libffi-dev + - gettext + - build-essential \ No newline at end of file