From 2a3b31915f53b478c4cc8e0235b9ea76fdf3a72e Mon Sep 17 00:00:00 2001 From: Sam Doran Date: Thu, 16 Jun 2016 16:34:49 -0400 Subject: [PATCH] Configure rhsm.conf --- defaults/main.yml | 7 ++++ tasks/main.yml | 11 ++++++ templates/rhsm.conf.j2 | 79 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 97 insertions(+) create mode 100644 templates/rhsm.conf.j2 diff --git a/defaults/main.yml b/defaults/main.yml index a740af6..63c65e7 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -7,3 +7,10 @@ rhsub_autosubscribe: True # rhsub_repos: # - name: rhel-7-server-extras-rpms # wildcard or repo name # state: enable # enable or disable + +# /etc/rhsm/rhsm.conf settings +rhsub_rhsm_port: 443 +# rhsub_rhsm_proxy_hostname: "" +# rhsub_rhsm_proxy_port: "" +# rhsub_rhsm_proxy_user: "" +# rhsub_rhsm_proxy_password: "" diff --git a/tasks/main.yml b/tasks/main.yml index c87f111..556792a 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -4,6 +4,17 @@ tags: - rhsub +- name: Configure Red Hat subscirption manager + template: + src: rhsm.conf.j2 + dest: /etc/rhsm/rhsm.conf + owner: root + group: root + mode: 0644 + tags: + - rhsub + - rhsub_rhsm + - name: Manage Red Hat subscription redhat_subscription: username: "{{ rhn_username }}" diff --git a/templates/rhsm.conf.j2 b/templates/rhsm.conf.j2 new file mode 100644 index 0000000..d1bcd20 --- /dev/null +++ b/templates/rhsm.conf.j2 @@ -0,0 +1,79 @@ +# {{ ansible_managed }} +# Red Hat Subscription Manager Configuration File: + +# Unified Entitlement Platform Configuration +[server] +# Server hostname: +hostname = subscription.rhn.redhat.com + +# Server prefix: +prefix = /subscription + +# Server port: +port = {{ rhsub_rhsm_port }} + +# Set to 1 to disable certificate validation: +insecure = 0 + +# Set the depth of certs which should be checked +# when validating a certificate +ssl_verify_depth = 3 + +# an http proxy server to use +{% if rhsub_rhsm_proxy_hostname is defined %} +proxy_hostname = {{ rhsub_rhsm_proxy_hostname }} +{% endif %} + +# port for http proxy server +{% if rhsub_rhsm_proxy_port is defined %} +proxy_port = {{ rhsub_rhsm_proxy_port }} +{% endif %} + +{% if rhsub_rhsm_proxy_user is defined %} +# user name for authenticating to an http proxy, if needed +proxy_user = {{ rhsub_rhsm_proxy_user }} +{% endif %} + +{% if rhsub_rhsm_proxy_password is defined %} +# password for basic http proxy auth, if needed +proxy_password = {{ rhsub_rhsm_proxy_password }} +{% endif %} + +[rhsm] +# Content base URL: +baseurl= https://cdn.redhat.com + +# Server CA certificate location: +ca_cert_dir = /etc/rhsm/ca/ + +# Default CA cert to use when generating yum repo configs: +repo_ca_cert = %(ca_cert_dir)sredhat-uep.pem + +# Where the certificates should be stored +productCertDir = /etc/pki/product +entitlementCertDir = /etc/pki/entitlement +consumerCertDir = /etc/pki/consumer + +# Manage generation of yum repositories for subscribed content: +manage_repos = 1 + +# Refresh repo files with server overrides on every yum command +full_refresh_on_yum = 0 + +# If set to zero, the client will not report the package profile to +# the subscription management service. +report_package_profile = 1 + +# The directory to search for subscription manager plugins +pluginDir = /usr/share/rhsm-plugins + +# The directory to search for plugin configuration files +pluginConfDir = /etc/rhsm/pluginconf.d + +[rhsmcertd] +# Interval to run cert check (in minutes): +certCheckInterval = 240 +# Interval to run auto-attach (in minutes): +autoAttachInterval = 1440 + +