2016-09-06 22:04:41 +08:00
|
|
|
---
|
2018-10-11 14:32:10 +08:00
|
|
|
- name: Fetch /etc/os-release
|
|
|
|
raw: cat /etc/os-release
|
|
|
|
register: os_release
|
|
|
|
changed_when: false
|
2019-02-12 06:04:27 +08:00
|
|
|
# This command should always run, even in check mode
|
|
|
|
check_mode: false
|
2018-10-11 14:32:10 +08:00
|
|
|
|
2024-03-27 20:58:53 +08:00
|
|
|
- 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
|
2024-05-13 18:14:30 +08:00
|
|
|
include_tasks: "{{ included_tasks_file }}"
|
2024-03-27 20:58:53 +08:00
|
|
|
with_first_found:
|
|
|
|
- <<: *search
|
|
|
|
paths: []
|
2024-05-13 18:14:30 +08:00
|
|
|
loop_control:
|
|
|
|
loop_var: included_tasks_file
|
2020-11-25 00:33:00 +08:00
|
|
|
|
2017-02-25 05:41:27 +08:00
|
|
|
|
2018-10-18 03:27:11 +08:00
|
|
|
- name: Create remote_tmp for it is used by another module
|
|
|
|
file:
|
2019-03-28 21:24:43 +08:00
|
|
|
path: "{{ ansible_remote_tmp | default('~/.ansible/tmp') }}"
|
2018-10-18 03:27:11 +08:00
|
|
|
state: directory
|
|
|
|
mode: 0700
|
|
|
|
|
2024-03-27 20:58:53 +08:00
|
|
|
- name: Gather facts
|
2017-03-27 18:27:15 +08:00
|
|
|
setup:
|
|
|
|
gather_subset: '!all'
|
2017-09-06 20:10:52 +08:00
|
|
|
filter: ansible_*
|
2017-03-27 18:27:15 +08:00
|
|
|
|
2021-12-01 07:53:17 +08:00
|
|
|
- name: Assign inventory name to unconfigured hostnames (non-CoreOS, non-Flatcar, Suse and ClearLinux, non-Fedora)
|
2017-03-27 18:27:15 +08:00
|
|
|
hostname:
|
2019-02-12 06:04:27 +08:00
|
|
|
name: "{{ inventory_hostname }}"
|
2024-03-27 20:58:53 +08:00
|
|
|
when: override_system_hostname
|
2019-04-17 14:14:02 +08:00
|
|
|
|
2022-07-25 14:46:59 +08:00
|
|
|
- name: Install ceph-commmon package
|
2019-04-17 14:14:02 +08:00
|
|
|
package:
|
|
|
|
name:
|
2024-03-27 20:58:53 +08:00
|
|
|
- ceph-common
|
2019-04-19 04:45:25 +08:00
|
|
|
state: present
|
2023-07-05 11:36:54 +08:00
|
|
|
when: rbd_provisioner_enabled | default(false)
|
2019-08-05 09:15:48 +08:00
|
|
|
|
|
|
|
- name: Ensure bash_completion.d folder exists
|
|
|
|
file:
|
|
|
|
name: /etc/bash_completion.d/
|
|
|
|
state: directory
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0755
|