搜索

26.9. 使用 Ansible playbook 确保 IdM 中没有 HTTP 服务

download PDF

按照以下流程从 IdM 取消服务的注册。更具体地说,它描述了如何使用 Ansible playbook 来确保 IdM 中没有名为 HTTP/client.idm.example.com 的 HTTP 服务器。

先决条件

  • 您有 IdM 管理员密码。

流程

  1. 创建一个清单文件,如 inventory.file

    $ touch inventory.file
  2. 打开 inventory.file,并在 [ipaserver] 部分定义您要配置的 IdM 服务器。例如,要指示 Ansible 配置 server.idm.example.com,请输入:

    [ipaserver]
    server.idm.example.com
  3. 创建 /usr/share/doc/ansible-freeipa/playbooks/service/service-is-absent.yml Ansible playbook 文件的副本。例如:

    $ cp /usr/share/doc/ansible-freeipa/playbooks/service/service-is-absent.yml /usr/share/doc/ansible-freeipa/playbooks/service/service-is-absent-copy.yml
  4. 打开 /usr/share/doc/ansible-freeipa/playbooks/service/service-is-absent-copy.yml Ansible playbook 文件进行编辑。
  5. 通过更改以下内容来调整文件:

    • IdM 管理员密码由 ipaadmin_password 变量定义。
    • HTTP 服务的 Kerberos 主体,由 ipaservice 任务的 name 变量定义。

      为当前示例进行调整后,复制的文件如下所示:

    ---
    - name: Playbook to manage IPA service.
      hosts: ipaserver
      gather_facts: false
    
      vars_files:
      - /home/user_name/MyPlaybooks/secret.yml
      tasks:
      # Ensure service is absent
      - ipaservice:
          ipaadmin_password: "{{ ipaadmin_password }}"
          name: HTTP/client.idm.example.com
          state: absent
  6. 保存并退出 文件。
  7. 运行 Ansible playbook。指定 playbook 文件、存储保护 secret.yml 文件的密码,以及清单文件:

    $ ansible-playbook --vault-password-file=password_file -v -i path_to_inventory_directory/inventory.file /usr/share/doc/ansible-freeipa/playbooks/service/service-is-absent-copy.yml

验证步骤

  1. 以 IdM 管理员身份登录 IdM Web UI。
  2. 进入到 Identity Services

如果 Services 列表中没有 HTTP/client.idm.example.com@IDM.EXAMPLE.COM 服务,则代表它不存在于 IdM 中。

Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.