Debian Codegraph @

ansible_collections/theforeman/foreman/roles/content_rhel/README.md

raw symbols SCIP
1 theforeman.foreman.content_rhel
2 ===============================
3
4 This role is an opinionated reuse of other roles in the collection, which creates a basic configuration for everything needed to register and patch existing RHEL clients.
5
6 That includes uploading a subscription manifest to an organization; enabling base RHEL7 and RHEL8 repositories (x86_64 architecture), syncing them immediately, and creating a sync plan for future syncs; and creating an activation key `base_rhel_key` to use when registering RHEL clients.
7
8 The subscription manifest will be retrieved from the specified path on the Ansible target host; optionally, it can be fetched first from the RHSM portal using the provided login credentials and manifest UUID. It will be uploaded to the specified organization.
9
10 By default, the role enables the rhel-7-server-rpms repository with the 7Server release and x86_64 architecture, as well as rhel-8-for-x86_64-baseos-rpms and rhel-8-for-x86_64-appstream-rpms. The manifest must provide access to all enabled content for the role to work properly.
11
12 The role creates a sync plan using any of the sync plan intervals supported by the basic [Sync Plan Role](https://github.com/theforeman/foreman-ansible-modules/blob/develop/roles/sync_plans/README.md).
13
14 The role creates an activation key with the provided name. This activation key will register client systems in the "Library" lifecycle environment and "Default Organization View" content view, using the subscription auto-attach feature.
15
16 Role Variables
17 --------------
18
19 This role supports the [Common Role Variables](https://github.com/theforeman/foreman-ansible-modules/blob/develop/README.md#common-role-variables).
20
21 This role supports the same variables used in the [Manifest Role](https://github.com/theforeman/foreman-ansible-modules/blob/develop/roles/manifest/README.md#role-variables).
22
23 It also supports customizing the included roles with:
24
25 `foreman_sync_plan_name`: Name of the sync plan to create. Default 'RHEL Sync Plan'
26
27 `foreman_sync_plan_interval`: 'hourly', 'daily', 'weekly', or 'custom cron'. See the [Sync Plan Role Documentation](https://github.com/theforeman/foreman-ansible-modules/blob/develop/roles/manifest/README.md#role-variables) for more information. Default 'daily'
28
29 `foreman_sync_plan_cron_expression`: Required when using the 'custom cron' `sync_plan_interval`.
30
31 `foreman_sync_plan_sync_date`: Initial sync date for the sync plan, formatted as 'YYYY-MM-DD HH:MM:SS UTC'.
32
33 `foreman_activation_key_name`: Name of the activation key to create. Default 'base_rhel_key'
34
35 Repository behavior is controlled via the variables:
36
37 `foreman_content_rhel_enable_rhel7`: Enable rhel-7-server-rpms repository (x86 architecture and 7Server release). Default true.
38
39 `foreman_content_rhel_enable_rhel8`: Enable rhel-8-for-x86_64-baseos-rpms and rhel-8-for-x86_64-appstream-rpms (x86 architecture). Default true.
40
41 `foreman_content_rhel_rhel8_releasever`: Version of RHEL 8 repositories. Default `8`.
42
43 `foreman_content_rhel_sync_now`: Sync repositories immediately after enabling. Default true.
44
45 `foreman_content_rhel_wait_for_syncs`: Monitor status of sync tasks. When false, the sync tasks will continue running in the background after the playbook has finished running. This option is most useful when other automation (for example, registering and patching a client) requires the repository syncs to have completed. Default true.
46
47 Example Playbooks
48 -----------------
49
50 This minimal example assumes the manifest has already been downloaded to ~/manifest.zip on localhost (the Ansible control node) and uploads that manifest to the ACME organization. It enables RHEL7 and RHEL8 repositories, creates the role default sync plan for them, and also syncs the repositories immediately. It creates an activation key with the role default name `base_rhel_key`.
51
52 ```yaml
53 - hosts: localhost
54 roles:
55 - role: theforeman.foreman.content_rhel
56 vars:
57 foreman_server_url: https://foreman.example.com
58 foreman_username: "admin"
59 foreman_password: "changeme"
60 foreman_organization: "ACME"
61 foreman_manifest_download: false
62 foreman_manifest_path: "~/manifest.zip"
63 ```
64
65 This example is identical to the above example, except instead of assuming the manifest is already downloaded at ~/manifest.zip, we first use the provided rhsm_{username,password} and manifest_uuid to download it from the Red Hat Customer Portal.
66
67 ```yaml
68 - hosts: localhost
69 roles:
70 - role: theforeman.foreman.content_rhel
71 vars:
72 foreman_server_url: https://foreman.example.com
73 foreman_username: "admin"
74 foreman_password: "changeme"
75 foreman_organization: "ACME"
76 foreman_manifest_download: true
77 foreman_rhsm_username: "happycustomer"
78 foreman_rhsm_password: "$ecur3p4$$w0rd"
79 foreman_manifest_uuid: "01234567-89ab-cdef-0123-456789abcdef"
80 foreman_manifest_path: "~/manifest.zip"
81 ```
82
83 This example downloads a manifest with the provided UUID from the RHSM portal using the provided credentials and copies it to ~/manifest.zip before uploading it to "Default Organization". It then enables the RHEL7 and RHEL8 repositories without syncing them immediately, but creates a sync_plan which syncs the repositories at midnight each day. It creates an activation key "RHEL_Key" to register existing RHEL content hosts.
84
85 ```yaml
86 - hosts: localhost
87 roles:
88 - role: theforeman.foreman.content_rhel
89 vars:
90 foreman_server_url: https://foreman.example.com
91 foreman_username: "admin"
92 foreman_password: "changeme"
93 foreman_organization: "Default Organization"
94 foreman_manifest_download: true
95 foreman_rhsm_username: "happycustomer"
96 foreman_rhsm_password: "$ecur3p4$$w0rd"
97 foreman_manifest_uuid: "01234567-89ab-cdef-0123-456789abcdef"
98 foreman_manifest_path: "~/manifest.zip"
99 foreman_content_rhel_sync_now: false
100 foreman_sync_plan_name: "Daily RHEL Sync"
101 foreman_sync_plan_interval: daily
102 foreman_sync_plan_sync_date: 2021-02-02 00:00:00 UTC
103 foreman_activation_key_name: "RHEL_Key"
104 foreman_content_rhel_rhel8_releasever: 8.4
105 ```
106
107 This example assumes the manifest has already been downloaded to ~/my_subscription_manifesst.zip on localhost and uploads that manifest to the ACME organization. It enables the rhel-7-server-rpms repository only, syncs it immediately, and also creates a custom cron sync plan for it. It creates an activation key "RHEL_Key" to register existing RHEL content hosts.
108
109 ```yaml
110 - hosts: localhost
111 roles:
112 - role: theforeman.foreman.content_rhel
113 vars:
114 foreman_server_url: https://foreman.example.com
115 foreman_username: "admin"
116 foreman_password: "changeme"
117 foreman_organization: "ACME"
118 foreman_manifest_download: false
119 foreman_manifest_path: "~/my_subscription_manifest.zip"
120 foreman_content_rhel_enable_rhel8: false
121 foreman_sync_plan_name: "RHEL Sync Plan"
122 foreman_sync_plan_interval: custom cron
123 foreman_sync_plan_cron_expression: 0 6 8 * *
124 foreman_sync_plan_sync_date: 2021-02-02 00:00:00 UTC
125 foreman_activation_key_name: "RHEL_Key"
126 ```