--- # Copyright 2016, Rackspace US, Inc. # # 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: Ensure host can talk to HTTPS apt repos apt: pkg: "apt-transport-https" state: "{{ galera_client_package_state }}" update_cache: yes cache_valid_time: "{{ cache_timeout }}" tags: - galera-client-apt-packages - name: Add galera apt-keys block: - name: Add keys (primary keyserver) apt_key: id: "{{ item.hash_id }}" keyserver: "{{ item.keyserver | default(omit) }}" data: "{{ item.data | default(omit) }}" url: "{{ item.url | default(omit) }}" state: "present" with_items: "{{ galera_client_gpg_keys }}" register: add_keys until: add_keys is success retries: 5 delay: 2 tags: - galera-client-apt-keys rescue: - name: Add keys (fallback keyserver) apt_key: id: "{{ item.hash_id }}" keyserver: "{{ item.fallback_keyserver | default(omit) }}" url: "{{ item.fallback_url | default(omit) }}" state: "present" register: add_keys_fallback until: add_keys_fallback is success retries: 5 delay: 2 with_items: "{{ galera_client_gpg_keys }}" when: item.fallback_keyserver is defined or item.fallback_url is defined tags: - galera-client-apt-keys - name: Ensure the sources.list.d folder exists file: path: "/etc/apt/sources.list.d/" state: directory tags: - galera-client-repos # TODO: Remove the following two tasks in Pike # They're only required during upgrades transitioning to a # statically named apt sources file. - name: Find old sources find: path: "/etc/apt/sources.list.d/" patterns: "^(?!{{ mariadb_repo_filename }})(.+)|(.+)(?