「yum clean all」はシンボリックリンクを削除しますか?

「yum clean all」はシンボリックリンクを削除しますか?

バージョンアップ用にフュージョンアップグレードプレイブックを実行しています。私のオペレーティングシステムはRHEL 7で、Python 3.9をインストールし、/usr/binディレクトリにそれへのシンボリックリンクを作成しました。

yum-clean-allConfluence プレイブックを実行すると、次のタスクに従うタスクがあります。

  • カスタムJavaインストール
  • Javaのインストール
  • ...
  • ...
  • インストールのアイデア
  • アップグレードポイント
  • pipパッケージのインストール

インストール時にプレイブックが失敗pip packagesし、その後はAnsibleを使用できません。

このエラーが発生しました -

ansible --version

Traceback (most recent call last):
  File "/usr/local/bin/ansible", line 34, in <module>
    from ansible import context
ModuleNotFoundError: No module named 'ansible'

また、現在/usr/binからpython3へのシンボリックリンクはありません。

/var/log/yum.logスクリプトが失敗した場合は、次のようになります。

Jan 04 14:50:44 Installed: python3-setuptools-39.2.0-10.el7.noarch
Jan 04 14:50:44 Installed: python3-pip-9.0.3-8.el7.noarch
Jan 04 14:50:44 Installed: python3-3.6.8-21.el7_9.x86_64
Jan 04 14:50:46 Installed: python3-libs-3.6.8-21.el7_9.x86_64

yum clean allそのため、リンクが削除されたと疑われますが、この疑いを確認することができるものは何も見つかりません。

したがって、問題はyum clean allシンボリックリンクを削除するかどうかです。関連書類はありますか?

もしそれが原因でなければ、何が起こっているのかをもっと深く掘り下げてみるべきだと思います。

どんなアドバイスもありがとうございます

修正する

Confluence Playbookのこの部分

---
- name: Ensure Custom Repo file is not in repos when repository_configuration is Confluent
  file:
    state: absent
    path: /etc/yum.repos.d/custom-confluent.repo
  when:
    - repository_configuration == 'confluent'
    - installation_method == "package"

- name: Add Confluent Repo file
  template:
    src: confluent.repo.j2
    dest: /etc/yum.repos.d/confluent.repo
    mode: 0644
  register: confluent_repo_result
  until: confluent_repo_result is success
  retries: 5
  delay: 90
  when:
    - repository_configuration == 'confluent'
    - installation_method == "package"

- name: Ensure Confluent Repo file is not in repos when repository_configuration is Custom
  file:
    state: absent
    path: /etc/yum.repos.d/confluent.repo
  when:
    - repository_configuration == 'custom'

- name: Add Custom Repo file
  copy:
    src: "{{custom_yum_repofile_filepath}}"
    dest: /etc/yum.repos.d/custom-confluent.repo
    mode: 0644
  register: custom_repo_result
  until: custom_repo_result is success
  retries: 5
  delay: 90
  when: repository_configuration == 'custom'

# Not using handler because of https://github.com/ansible/ansible/issues/41313
- name: yum-clean-all
  command: yum clean all
  args:
    warn: false
  register: yum_clean_result
  until: yum_clean_result is success
  retries: 5
  delay: 90
  when: >
    confluent_repo_result.changed|default(False) or
    repository_configuration == 'custom'

- name: Custom Java Install
  include_tasks: custom_java_install.yml

- name: Install Java
  yum:
    name: "{{redhat_java_package_name}}"
    state: present
  register: java_install_result
  until: java_install_result is success  or ansible_check_mode
  retries: 10
  delay: 5
  when: install_java|bool
  tags: package

- name: Install OpenSSL and Unzip
  yum:
    name:
      - openssl
      - unzip
  tags: package

- name: Get Java Version
  shell: java -version
  register: version_output
  check_mode: false
  changed_when: false

- name: Print Java Version
  debug:
    msg: "Current Java Version is: {{version_output.stderr_lines[0]}}"

- name: Install pip
  yum:
    name:
      - python3-pip
    state: present
  become: true
  tags: package

- name: Upgrade pip
  ansible.builtin.pip:
    name: pip
    extra_args: --upgrade
  tags: package

- name: Install pip packages
  ansible.builtin.pip:
    name: "{{pip_packages}}"
  tags: package

ベストアンサー1

おすすめ記事