找回密码
 注册
查看: 13|回复: 0

TASK [prechecks : Checking host OS distribution] 解决办法

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2025-10-13 00:29:30 | 显示全部楼层 |阅读模式
TASK [prechecks : include_tasks] *****************************************************************************************************************************************3 f6 P5 j5 o7 ?3 z
included: /usr/local/share/kolla-ansible/ansible/roles/prechecks/tasks/host_os_checks.yml for compute1, controller, localhost
! e8 m% q* f/ y3 R+ X- p5 _: d# R; u
TASK [prechecks : Checking host OS distribution] *************************************************************************************************************************
, ]7 ^5 E2 N* E1 vfatal: [compute1]: FAILED! => {! p. |& U* m$ K; b& a8 I  w
    "assertion": "ansible_facts.distribution in host_os_distributions",6 p' Q- q. o: A7 U" ^
    "changed": false,3 j! Q5 c: P' ^6 D
    "evaluated_to": false,3 E% o1 d6 \: _" L. c
    "msg": "Host OS distribution openEuler is not supported. Supported distributions are: CentOS, Debian, Rocky, Ubuntu"2 R" x7 Y8 D5 n" n  m3 v
}
& g) y+ n% p* i5 Y7 t% Efatal: [controller]: FAILED! => {* e5 v0 G2 ]9 e; q
    "assertion": "ansible_facts.distribution in host_os_distributions",
+ h3 v! h: G" ~    "changed": false,
1 R) T4 i& j7 a! z    "evaluated_to": false,
& S& o4 R# }" h5 d    "msg": "Host OS distribution openEuler is not supported. Supported distributions are: CentOS, Debian, Rocky, Ubuntu"
- g7 E. @/ d% M! q}% E8 Y5 ?4 u; V) i. G; z0 f/ n
fatal: [localhost]: FAILED! => {
" G  c" q' A# \, |$ h% e    "assertion": "ansible_facts.distribution in host_os_distributions",
5 O- D, t0 d  _9 G! Q    "changed": false,2 A+ r7 g9 A/ w/ _9 K5 x

0 A: `% \- L3 f7 G# x    "evaluated_to": false,$ c* `5 s/ L: ~! S2 e! F2 E- D
    "msg": "Host OS distribution openEuler is not supported. Supported distributions are: CentOS, Debian, Rocky, Ubuntu"0 r4 q" r( n' A% i) P1 W  i
}
* F- m. ^, }9 j! a# `1 c
8 ~; S2 _& I# r1 w2 WPLAY RECAP ***************************************************************************************************************************************************************
) ^3 S/ g# i) C& L0 P, U$ k- O2 zcompute1                   : ok=6    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0   3 S! O  C0 a/ g
controller                 : ok=6    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0   
2 {( A& h1 F1 T) s/ `localhost                  : ok=6    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0   4 M7 T6 |' x9 j# z3 N

9 R& G5 _) [( A6 @4 z9 J
/ B! p" m; Z7 n6 d/ X解决办法:  f$ U" g$ I9 ]8 i& b

" O, F! P% {9 p# g. b% V9 V vim /usr/local/share/kolla-ansible/ansible/roles/prechecks/tasks/host_os_checks.yml
& Q* k$ }' v) w4 ~( n注释掉os检查:
; k: c+ t% N1 @1 F+ ~8 w, _( z* y# E$ _4 ~7 V2 h8 R1 z: \
---4 |7 P7 k% R" H# |- R0 H
#- name: Checking host OS distribution3 \& ]1 Q. N( `% B6 D% j" @
#  assert:
+ Z4 Y+ ?' l* f% t#    that: ansible_facts.distribution in host_os_distributions
' f+ ]% k, a( e, r#    fail_msg: >-$ H! i$ D4 E) c1 I( b1 R
#      Host OS distribution {{ ansible_facts.distribution }} is not supported.; c4 m- N6 F2 e5 s( h3 z, N7 r
#      Supported distributions are: {{ host_os_distributions.keys() | join(', ') }}4 i3 m* a& `. W. U3 o
#
, [( w& b% I" v8 A0 J2 |9 j1 S#- name: Checking host OS release or version
( |3 C" \" g7 A" M( b& A; l9 ?6 b#  assert:
! ]+ A7 Y5 [( _$ d  \$ N4 o. t0 s#    that:
1 l; s2 @# M. X/ `2 ^8 ~#      - ansible_facts.distribution_release in host_os_distributions[ansible_facts.distribution] or8 n; t) r4 J1 v: X  k2 _4 e
#        ansible_facts.distribution_version in host_os_distributions[ansible_facts.distribution] or
7 j! Z- F+ ]: x! D) T3 v#        ansible_facts.distribution_major_version in host_os_distributions[ansible_facts.distribution]+ m6 }/ E% e& z
#    fail_msg: >-
/ Z7 A& v" j+ A  G3 j6 v# A; v#      {{ ansible_facts.distribution }} release {{ ansible_facts.distribution_release }}
" c3 D  n7 J4 L#      version {{ ansible_facts.distribution_version }} is not supported.
: Q) c, _# s; s5 P! }( Y8 ]  x' `: Z#      Supported releases are:5 o; b3 X1 P, C/ E9 o! O$ b. G
#      {{ host_os_distributions[ansible_facts.distribution] | join(', ') }}
2 d% g" i- m( ?, m  k) s2 F#3 S% J$ K* }, f' q
#- name: Checking if CentOS is Stream
3 [9 b+ C% p# u. B: C1 K#  become: true
& u. V0 _& t5 U3 A# F: Q#  command: grep -q Stream /etc/os-release
  v3 k! F5 a4 {5 ^" `& h5 _! t#  register: stream_status7 ~3 P7 ^- ?5 S6 h2 ~+ A7 e
#  changed_when: false
0 |$ H" Q/ |7 O+ d7 w  u#  check_mode: false
- ]+ C- M  p/ w: `9 f! n9 ~#  when:, j: B  d# g# @$ y
#    - ansible_facts.distribution == 'CentOS'7 O. z) Z& D9 n- ]8 E% _
#  ~2 f3 T6 I* F
#- name: Fail if not running on CentOS Stream( M, h0 ~2 S/ F
#  fail:
: |3 n4 d5 M5 A! `#    msg: CentOS Linux is not supported, you need to run CentOS Stream.8 e$ T7 z/ z: T4 g* M: S% {
#  when:
9 s0 Z7 _/ S% Q$ f4 G4 D#    - ansible_facts.distribution == 'CentOS'8 Q5 H6 a7 Q% [2 S6 k# K! d
#    - stream_status.rc != 0
  p0 `- H6 @! @3 L  V" Y) z  y& q
, d2 }! A' q. p0 D! Y+ ^9 c8 y1 W  o( \. T& J* G; ^
  ]* ?  S; t! z  I8 N+ _

' x3 R: O; U$ o6 ]( k再次执行即可:4 q5 X% h% k( W7 U( v2 m
) r0 L9 h0 l) P) E# c
PLAY RECAP **************************************************************************************************************************************************************2 G# U1 Y! g3 V% i
compute1                   : ok=70   changed=0    unreachable=0    failed=0    skipped=48   rescued=0    ignored=0   . H1 l4 W" Q9 p8 a' q" O; Q
controller                 : ok=102  changed=0    unreachable=0    failed=0    skipped=134  rescued=0    ignored=0   
. }; q) j+ D  l% P2 a' Q3 Z# Rlocalhost                  : ok=11   changed=0    unreachable=0    failed=0    skipped=12   rescued=0    ignored=0   
. I! r$ T2 S( g2 P) N0 a& C1 L2 Y0 Z& v
6 ^! f; Z: p) o% @
$ j6 C: c1 e# n+ J+ A
) Q0 A/ E# \( o2 \' {& c4 C3 z

& _+ U2 t2 S& |7 {" |% s& Z8 `& o

; f; Y# M: ~) m9 f$ s3 d1 s
您需要登录后才可以回帖 登录 | 注册

本版积分规则

返回首页|Archiver|手机版|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )

GMT+8, 2026-6-11 23:59 , Processed in 0.018171 second(s), 22 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表