mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2025-12-13 21:34:40 +03:00
With CentOS, kubespray currently produces the following warning: [WARNING]: TASK: bootstrap-os : Enable Oracle Linux repo: The loop variable 'item' is already in use. You should set the `loop_var` value in the `loop_control` option for the task to something else to avoid variable collisions and unexpected behavior. This could bites us in nasty ways, so fix it.
65 lines
1.6 KiB
YAML
65 lines
1.6 KiB
YAML
---
|
|
- name: Fetch /etc/os-release
|
|
raw: cat /etc/os-release
|
|
register: os_release
|
|
changed_when: false
|
|
# This command should always run, even in check mode
|
|
check_mode: false
|
|
|
|
- name: Include distro specifics vars and tasks
|
|
vars:
|
|
os_release_dict: "{{ os_release.stdout_lines | select('regex', '^.+=.*$') | map('regex_replace', '\"', '') |
|
|
map('split', '=') | community.general.dict }}"
|
|
block:
|
|
- name: Include vars
|
|
include_vars: "{{ item }}"
|
|
tags:
|
|
- facts
|
|
with_first_found:
|
|
- &search
|
|
files:
|
|
- "{{ os_release_dict['ID'] }}-{{ os_release_dict['VARIANT_ID'] }}.yml"
|
|
- "{{ os_release_dict['ID'] }}.yml"
|
|
paths:
|
|
- vars/
|
|
skip: True
|
|
- name: Include tasks
|
|
include_tasks: "{{ included_tasks_file }}"
|
|
with_first_found:
|
|
- <<: *search
|
|
paths: []
|
|
loop_control:
|
|
loop_var: included_tasks_file
|
|
|
|
|
|
- name: Create remote_tmp for it is used by another module
|
|
file:
|
|
path: "{{ ansible_remote_tmp | default('~/.ansible/tmp') }}"
|
|
state: directory
|
|
mode: 0700
|
|
|
|
- name: Gather facts
|
|
setup:
|
|
gather_subset: '!all'
|
|
filter: ansible_*
|
|
|
|
- name: Assign inventory name to unconfigured hostnames (non-CoreOS, non-Flatcar, Suse and ClearLinux, non-Fedora)
|
|
hostname:
|
|
name: "{{ inventory_hostname }}"
|
|
when: override_system_hostname
|
|
|
|
- name: Install ceph-commmon package
|
|
package:
|
|
name:
|
|
- ceph-common
|
|
state: present
|
|
when: rbd_provisioner_enabled | default(false)
|
|
|
|
- name: Ensure bash_completion.d folder exists
|
|
file:
|
|
name: /etc/bash_completion.d/
|
|
state: directory
|
|
owner: root
|
|
group: root
|
|
mode: 0755
|