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

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

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2025-10-13 00:29:30 | 显示全部楼层 |阅读模式
TASK [prechecks : include_tasks] *****************************************************************************************************************************************4 u! T2 Q- {2 O6 f. r  P  Q: n
included: /usr/local/share/kolla-ansible/ansible/roles/prechecks/tasks/host_os_checks.yml for compute1, controller, localhost
- j" E' c2 {# V; b5 y0 A( c5 Q1 y
7 d( U! d$ l; B7 }TASK [prechecks : Checking host OS distribution] *************************************************************************************************************************
$ V% C+ i7 I* |6 {  C! X5 ^0 |fatal: [compute1]: FAILED! => {
3 w6 N- g! S  [  e    "assertion": "ansible_facts.distribution in host_os_distributions",
5 d( Y( {7 M( ^& Z. M1 }    "changed": false,
& E. i) U% i) ~1 ]. O' \8 i    "evaluated_to": false,7 i" r4 w9 h& P& r) `3 L" E
    "msg": "Host OS distribution openEuler is not supported. Supported distributions are: CentOS, Debian, Rocky, Ubuntu"0 Q7 ^4 [# S; w/ ?
}9 M# l  v7 _4 }
fatal: [controller]: FAILED! => {
2 c% y8 D, G- Q: s+ l    "assertion": "ansible_facts.distribution in host_os_distributions",! s6 ~* U+ B4 h' ]. f" n
    "changed": false,
8 D8 Y- S& J  m$ y4 l+ a( K9 ^    "evaluated_to": false,
% x- U1 m; R' G  \) R* L  \* D6 n    "msg": "Host OS distribution openEuler is not supported. Supported distributions are: CentOS, Debian, Rocky, Ubuntu"
' M6 w# r' @5 v8 p) ^6 D8 y}
& d! b# f5 o. Q+ r& _: e! yfatal: [localhost]: FAILED! => {# K) y: B: H' U3 e
    "assertion": "ansible_facts.distribution in host_os_distributions",& [6 Q1 q0 T  _
    "changed": false,0 k5 `6 ~2 U# U/ p- m
! A9 o6 c* G4 \/ h% m) }
    "evaluated_to": false,
1 X8 |- f3 i8 `9 D$ y: ?    "msg": "Host OS distribution openEuler is not supported. Supported distributions are: CentOS, Debian, Rocky, Ubuntu"5 P' E6 }! I# y8 z# ~3 q
}& h2 r" o% H* S
6 b1 x8 V- ]* M( |
PLAY RECAP ***************************************************************************************************************************************************************0 |3 M7 B0 }3 `( [0 U1 j" T8 i
compute1                   : ok=6    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0   ' Q3 m3 a1 o( d! X. q: {
controller                 : ok=6    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0   
! K6 A" D6 x  o+ S; alocalhost                  : ok=6    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0   
5 P. @6 }) i* P1 q7 C. i4 E5 s# g
* \3 M3 `* o. w3 U& y& X
解决办法:& f" _3 B$ q% n' ^
) h9 u, V. y& I% \' {0 [
vim /usr/local/share/kolla-ansible/ansible/roles/prechecks/tasks/host_os_checks.yml
6 H# P8 b2 {# k2 h/ L# W8 A  {+ p$ [注释掉os检查:; A8 _" T# q! N. D

  k- Z, I0 g  m! u---2 p; y4 a. _( K; P: x3 B
#- name: Checking host OS distribution2 S6 {1 P3 Q  _) a1 n
#  assert:5 O) ^+ v! ^# D+ y# I# ^
#    that: ansible_facts.distribution in host_os_distributions0 i5 @' f" Y5 Q, t8 Q  c6 I% P$ H# r
#    fail_msg: >-, e6 `  F4 c5 v' `
#      Host OS distribution {{ ansible_facts.distribution }} is not supported.+ H, Q( @  y2 P: p
#      Supported distributions are: {{ host_os_distributions.keys() | join(', ') }}# x9 _/ Y3 J# H5 T% U5 X' t
#2 i1 ?- b! U: @  o3 S5 d' \
#- name: Checking host OS release or version% x- v1 {, f# q' f$ f
#  assert:
8 D6 P3 t% w8 t; W' g& i#    that:$ M$ p1 F+ A' j, o: L9 T; e
#      - ansible_facts.distribution_release in host_os_distributions[ansible_facts.distribution] or( r6 e( I+ F9 L( C
#        ansible_facts.distribution_version in host_os_distributions[ansible_facts.distribution] or
, ~7 D& P2 L* x4 Q#        ansible_facts.distribution_major_version in host_os_distributions[ansible_facts.distribution]
  g7 }. D+ ^6 |3 Y3 b#    fail_msg: >-2 S3 n  M: A( ]9 _
#      {{ ansible_facts.distribution }} release {{ ansible_facts.distribution_release }}
9 ~# u: s+ L* [" [. S#      version {{ ansible_facts.distribution_version }} is not supported.& T3 f2 {3 v- j. A- H  ?
#      Supported releases are:( F( S1 Q( ]9 m8 S2 `
#      {{ host_os_distributions[ansible_facts.distribution] | join(', ') }}
; N* H7 @" I& s( {; D: G7 ?#" V- J: E( d" X/ A; M6 @0 m
#- name: Checking if CentOS is Stream
; O5 y# }8 X) Y' y( J, M5 G#  become: true
9 G& n4 c9 Q1 S: J  N) y: g1 N1 I#  command: grep -q Stream /etc/os-release4 d3 t3 m, f1 P: N* ^  R
#  register: stream_status
+ I" o! C, P/ J#  changed_when: false5 F" x1 ?8 ?% r
#  check_mode: false$ p! [8 e8 e1 X( p
#  when:
2 j" j% T, n$ b' z#    - ansible_facts.distribution == 'CentOS'
' Q, l) L) U) M& C#
! k/ J; r2 n( Z& p2 W: d#- name: Fail if not running on CentOS Stream( v; {+ }6 d5 L& w" e' A, x
#  fail:
% ?/ `7 i5 N3 ]4 g#    msg: CentOS Linux is not supported, you need to run CentOS Stream.% V! O0 I* @( Q9 |" b8 a- i
#  when:0 B% x' ^9 W: l$ s
#    - ansible_facts.distribution == 'CentOS': [# k# N: m7 T
#    - stream_status.rc != 0
9 t) J9 t! ~# s
0 R( t9 V5 r8 T/ |0 }( U! ?5 t" B. g# j# O2 Z$ g
$ `# e: V! ?' P* m
" a& q3 K; b/ M$ R/ ?% c% ~
再次执行即可:
/ Q3 a5 q+ `7 F2 |; c* G# j& k
- H0 }7 {1 j# a  Z% @PLAY RECAP **************************************************************************************************************************************************************
$ G$ k8 r) ^4 N. s7 O4 u" ]3 pcompute1                   : ok=70   changed=0    unreachable=0    failed=0    skipped=48   rescued=0    ignored=0   
8 b, e% m! Q& b5 Q  X, T- D- Pcontroller                 : ok=102  changed=0    unreachable=0    failed=0    skipped=134  rescued=0    ignored=0   
- ^6 I* ^- z9 ~6 o: rlocalhost                  : ok=11   changed=0    unreachable=0    failed=0    skipped=12   rescued=0    ignored=0   
$ o3 o8 r) D* f$ R$ g- D% f: v9 @

( c2 q# y% @6 q" }" a7 I. G; {" {0 Y5 P1 H
4 a; a: |( W& j# D+ Q  @( _* h' T+ Q

0 W! \0 v( R9 B
* H/ t. G; N/ U; I, K; C3 Q! |+ D% v
/ K  Q9 S% \9 Q+ y* U0 Q0 V
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

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

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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