RedHatGov.content
内容
该角色安装和配置 RHEL 本地内容服务器(仓库、注册表、NFS)。
要求
- 需要一个基本的 RHEL 系统作为目标
- 拥有一个 Red Hat Network 帐户,并且需要可用的 RHEL 订阅(以便同步所有内容)
角色变量
变量 | 必需 | 默认值 | 描述 |
---|---|---|---|
versions |
:x: | 见 defaults/main.yml |
Red Hat 产品版本的字典 |
disconnected |
:x: | false | 该环境是否在断开连接的状态下运行 |
domain |
:x: | hattrick.lab |
环境的域名 |
dns_server_public |
:x: | 1.1.1.1 |
默认的上游 DNS 服务器 |
content_hostname |
:heavy_check_mark: | 短主机名 | |
content_ssh_user |
:x: | root |
访问 SSH 的默认用户 |
content_ssh_pwd |
:x: | p@ssw0rd |
访问 SSH 的默认密码。显然,你应该更改这个 :) |
content_public_ip |
:heavy_check_mark: | 可访问的公共 IP | |
content_base_img |
:heavy_check_mark: | KVM 虚拟机监控器中 /var/lib/libvirt/images 目录下的基础镜像名称 | |
content_vcpus |
:x: | 1 |
所需的 vCPU 数量 |
content_ram |
:x: | 1024 |
所需的内存量(以兆字节为单位) |
content_os_disk_name |
:x: | {{ idm_hostname }} |
/var/lib/libvirt/images 目录中 OS 磁盘的名称 |
content_os_disk_size |
:x: | 110G |
OS 磁盘的大小 |
content_nics |
:heavy_check_mark: | 见示例剧本 |
要创建的 NIC 的字典 |
content_ht_git_repo |
:x: | https://github.com/redhat-kejones/ht.git |
Project Hat Trick 代码库的位置 |
content_sync_repos |
:x: | true | 是否同步 Red Hat 仓库的布尔值 |
content_repos |
:x: | 见 defaults/main.yml |
要启用的仓库的字典 |
content_packages |
:x: | 见 defaults/main.yml |
软件包的字典 |
content_sync_satellite |
:x: | false | 是否同步 Satellite 仓库的布尔值(需要 Satellite 订阅) |
content_sync_registry |
:x: | true | 是否将容器映像同步到本地注册表的布尔值 |
content_ocp_tag |
:x: | v3.11.43 |
要获取的 OCP 映像的版本标签 |
content_rh_registry_username |
:heavy_check_mark: | 来自 https://access.redhat.com/terms-based-registry 的服务帐户用户名 | |
content_rh_registry_token |
:heavy_check_mark: | 来自 https://access.redhat.com/terms-based-registry 的服务帐户令牌 | |
content_ocp_images |
:x: | 见 defaults/main.yml |
OCP 容器图像的字典 |
依赖关系
- RedHatGov.rhsm
示例剧本
---
- hosts: content
vars:
domain: "example.com"
dns_server_public: 1.1.1.1
content_hostname: content # 短主机名
content_ssh_user: root
content_ssh_pwd: p@ssw0rd
content_public_ip: "192.168.122.8"
content_base_img: rhel-guest-image-7.qcow2
content_vcpus: 1
content_ram: 1024
content_os_disk_name: "{{ content_hostname }}"
content_os_disk_size: 110G
content_nics:
- name: eth0
bootproto: static
onboot: yes
ip: "{{ content_public_ip }}"
prefix: "24"
gateway: "192.168.122.1"
dns_server: "{{ dns_server_public }}"
config: "--type network --source default --model virtio"
#注意:请从 https://access.redhat.com/terms-based-registry/ 创建/获取用户名/令牌
content_rh_registry_username: "1234567|rhnserviceaccount"
content_rh_registry_token: "..."
tasks:
- name: 安装内容服务器
include_role:
name: RedHatGov.content
许可证
GPLv3