22.7. Managing auto updates of Red Hat Lightspeed rules by using the rhc RHEL system role
You can enable or disable the automatic collection rule updates for Red Hat Lightspeed by using the rhc RHEL system role. By default, when you connect your system to Red Hat Lightspeed, this option is enabled. You can disable it by using rhc.
If you disable this feature, you risk using outdated rule definition files and not getting the most recent validation updates.
Prerequisites
- You have prepared the control node and the managed nodes.
- You are logged in to the control node as a user who can run playbooks on the managed nodes.
-
The account you use to connect to the managed nodes has
sudopermissions for these nodes. - You have registered the system.
Procedure
Store your sensitive variables in an encrypted file:
Create the vault:
$ ansible-vault create ~/vault.yml New Vault password: <password> Confirm New Vault password: <vault_password>After the
ansible-vault createcommand opens an editor, enter the sensitive data in the<key>: <value>format:username: <username> password: <password>- Save the changes, and close the editor. Ansible encrypts the data in the vault.
Create a playbook file, for example,
~/playbook.yml, with the following content:--- - name: Managing systems with the rhc RHEL system role hosts: managed-node-01.example.com vars_files: - ~/vault.yml tasks: - name: Enable Red Hat Lightspeed autoupdates ansible.builtin.include_role: name: redhat.rhel_system_roles.rhc vars: rhc_auth: login: username: "{{ username }}" password: "{{ password }}" rhc_insights: autoupdate: true state: presentThe settings specified in the example playbook include the following:
autoupdate: true|falseEnables or disables the automatic collection rule updates for Red Hat Lightspeed.
For details about all variables used in the playbook, see the
/usr/share/ansible/roles/rhel-system-roles.rhc/README.mdfile on the control node.
Validate the playbook syntax:
$ ansible-playbook --syntax-check --ask-vault-pass ~/playbook.ymlNote that this command only validates the syntax and does not protect against a wrong but valid configuration.
Run the playbook:
$ ansible-playbook --ask-vault-pass ~/playbook.yml