ahuffman.satellite6_bootstrap
ahuffman.satellite6_bootstrap
通过使用 Ansible 提供一种方便的方法,将 Satellite 5 客户端迁移到 Satellite 6。该角色还支持客户端首次注册到 Satellite 6 或从现有 Satellite 6 服务器重新注册客户端。该角色确保在此过程中删除所有与 RHN(Satellite 5)相关的组件。
请查看本文件的 Dependencies
部分,以确保满足所有要求
请注意,在调用此角色时,您应该先收集事实信息
角色变量
以下变量在角色的 defaults/main.yml
文件中设置:
变量名 | 必需 | 描述 | 默认值 | 变量类型 |
---|---|---|---|---|
sat6_server | yes | "主" Satellite 6 服务器的完全合格域名(FQDN),即从红帽内容分发网络同步内容的地方。不能是一个 Capsule 服务器,因为我们需要访问 Satellite 6 API。 | "" | string |
sat6_capsule | no | 如果您需要您的客户端注册到 Capsule 服务器,这将是要注册的 Satellite 6 Capsule 服务器的 FQDN。如果未提供,将默认为 sat6_server (即客户端将注册到 sat6_server )。 |
N/A | string |
sat6_user | yes | 在 Satellite 6 中有权限创建主机的用户名,通常是管理员用户。 | "" | string |
sat6_pass | yes | 有权限创建主机的 sat6_user 的密码,通常是管理员用户。 |
"" | string |
sat6_organization | yes | 要在 Satellite 6 服务器上注册主机的组织名称。应为在 Satellite 6 中找到的组织标签。 | "" | string |
sat6_activation_key | yes | 注册主机到 Satellite 6 时使用的激活密钥。 | "" | string |
sat6_location | no | 在 Satellite 6 中注册主机时要使用的位置名称。 | "" | string |
sat6_enable_repos | no | 在 Satellite 6 注册完成后要启用的仓库列表。 | [] | list |
sat6_remote_execution | no | 在该角色的 files 目录中放置一个名为 [sat6_server]-id_rsa_foreman_proxy.pub 的文件。您可以从您的 Satellite 6 服务器获取此文件。请注意,文件名前缀应与 sat6_server 或 sat6_capsule 变量中设置的 Satellite 6 或 Capsule 服务器名称匹配。 |
False | boolean |
sat6_remote_execution_user | no | 用于安装 Satellite 6 远程执行密钥的用户账户。 | "root" | string |
sat6_remote_execution_auth_key_path | no | 如果授权密钥文件不是 /home/<user>/.ssh/authorized_keys ,则指定对此文件的路径。 |
"" | string |
sat6_puppet | no | 是否执行 Puppet 安装和配置。 | False | boolean |
sat6_puppet_environment | no | 用于配置客户端 Puppet 代理的 Puppet 环境。 | "production" | string |
sat6_force_puppet | no | 是否强制卸载和清理客户端的 Puppet 代理和配置。 | False | boolean |
sat6_update_client | no | 是否在注册过程中完全更新(打补丁)正在注册的客户端。 | False | boolean |
sat6_force_katello | no | 是否强制卸载和清理客户端的 Katello 代理组件。设为 True 以重新注册主机。 |
False | boolean |
sat6_https | no | 安装来自 Satellite 6/Capsule 服务器的 katello-ca-consumer-latest 包时是否使用 https | False | boolean |
sat6_legacy_purge | no | 在迁移过程中是否从 Satellite 5 中删除主机条目。如果在执行时 /etc/sysconfig/rhn/systemid 不存在,则将被忽略。 |
False | boolean |
sat6_legacy_user | no | 在 Satellite 5 中有权限删除主机条目的用户名。如果 sat6_legacy_purge 设置为 True ,则需要此字段。 |
"" | string |
sat6_legacy_pass | no | 在 Satellite 5 中有权限删除主机条目的用户密码。如果 sat6_legacy_purge 设置为 True ,则需要此字段。 |
"" | string |
sat6_rhsm_port | no | 强制非默认的 Satellite 6 订阅管理器端口。请参见 /etc/rhsm/rhsm.conf 中的服务器部分,端口键。 | "443" | string |
sat6_os_release | no | 配置要使用的操作系统版本。 | "" | string |
sat6_host_group | yes | 要与主机关联的主机组的标题。 | "" | string |
sat6_update_existing | no | 是否更新现有的 Satellite 6 主机(即主机已存在于 Satellite 6 中,但希望更新激活密钥、主机组或位置等参数)。 | False | boolean |
以下变量在角色的 vars/main.yml
文件中设置。除非有充分的理由,否则建议不要更改这些:
变量名 | 必需 | 描述 | 默认值 | 变量类型 |
---|---|---|---|---|
sat6_rhn_tools | no | 要从客户端删除的 Satellite 5(RHN)组件列表。 | ["rhn-setup", "rhn-client-tools", "yum-rhn-plugin", "rhnsd", "rhn-check", "rhn-lib", "spacewalk-abrt", "spacewalk-oscap", "osad", "rh--rhui-client", "candlepin-cert-consumer-"] | list |
sat6_puppet_files | no | 列出确保在设置 sat6_force_puppet 时从客户端中删除的文件。 |
["/var/lib/puppet", "/opt/puppetlabs/puppet/cache", "/opt/puppetlabs/puppet/ssl"] | list |
sat6_sub_mgr_pkgs | no | 客户端注册后需要更新的包列表,以确保订阅管理器及其相关组件的正常功能。 | ["yum", "openssl", "python", "subscription-manager", "subscription-manager-migration-*"] | list |
sat6_katello_pkgs | no | 列出确保在设置 sat6_force_katello 时从客户端中删除的包。 |
["katello-ca-consumer-*", "katello-agent", "gofer", "katello-host-tools", "katello-host-tools-fact-plugin"] | list |
依赖项
从 1.0.3 版本开始,此角色需要 ahuffman.sat6_create_hosts 角色。此依赖关系是由于添加了在迁移期间能够指定主机位置(sat6_location
)和主机组(sat6_host_group
)的功能。
要安装所需的角色,请运行 ansible-galaxy install ahuffman.sat6_create_hosts
。
在 Ansible Tower/AWX 中,可以在 requirements.yml
中指定此依赖关系,以避免预安装。
示例剧本
---
- hosts: "servers"
vars_files:
- "vars/secrets.yml"
roles:
- role: "ahuffman.satellite6_bootstrap"
sat6_server: "mysat6.foo.bar"
sat6_user: "mysat6user"
sat6_pass: "{{ sat6_user_pass_from_vault }}"
sat6_legacy_purge: True
sat6_legacy_user: "mysat5user"
sat6_legacy_pass: "{{ sat5_legacy_user_pass_from_vault }}"
sat6_activation_key: "mykey1"
sat6_organization: "myorg1"
sat6_update_existing: True #强制更新现有的 sat6 主机为我们指定的内容
sat6_update_client: True #注册后修补系统
sat6_enable_repos:
- "rhel-7-server-optional-rpms"
sat6_remote_execution: True
sat6_puppet: True
sat6_host_group: "RHEL7/RHEL7-Virtual-Prod"
sat6_location: "Raleigh"
许可证
作者
关于项目
Provides a painless method to migrate clients between Satellite5/Spacewalk and Satellite6/Capsules.
安装
ansible-galaxy install ahuffman.satellite6_bootstrap
许可证
mit
下载
2.5k