Skip to content

Instantly share code, notes, and snippets.

@t2d
Last active June 25, 2020 20:14
Show Gist options
  • Save t2d/99bbfbb3bb4b901ff105bf6e24988818 to your computer and use it in GitHub Desktop.
Save t2d/99bbfbb3bb4b901ff105bf6e24988818 to your computer and use it in GitHub Desktop.
ansible distribution specific vars and tasks
---
# (c) Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
#
# 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: include default variables
include_vars: "../vars/main.yml"
tags: podman
- name: include release specific variables
include_vars: "{{ lookup('first_found', _params) }}"
vars:
_params:
files:
- "{{ ansible_distribution | lower }}-{{ ansible_distribution_version | lower }}.yml"
- "{{ ansible_distribution | lower }}-{{ ansible_distribution_major_version | lower }}.yml"
- "{{ ansible_os_family | lower }}-{{ ansible_distribution_major_version | lower }}.yml"
- "{{ ansible_distribution | lower }}.yml"
- "{{ ansible_os_family | lower }}.yml"
paths:
- "../vars"
ignore_errors: true
tags: podman
- name: include release specific tasks
include_tasks: "{{ lookup('first_found', _params) }}"
vars:
_params:
files:
- "{{ ansible_distribution | lower }}-{{ ansible_distribution_version | lower }}.yml"
- "{{ ansible_distribution | lower }}-{{ ansible_distribution_major_version | lower }}.yml"
- "{{ ansible_os_family | lower }}-{{ ansible_distribution_major_version | lower }}.yml"
- "{{ ansible_distribution | lower }}.yml"
- "{{ ansible_os_family | lower }}.yml"
paths:
- "."
ignore_errors: true
tags: podman
@t2d
Copy link
Author

t2d commented Jun 25, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment