How to set file-based setting AWX_REBUILD_SMART_MEMBERSHIP
Environment
- Ansible Automation Platform 2.x
- Ansible Automation Platform Controller 4.x
Issue
- How to set file-based setting
AWX_REBUILD_SMART_MEMBERSHIP
. - To update the memberships more frequently, you can change the file-based setting
AWX_REBUILD_SMART_MEMBERSHIP
toTrue
(default isFalse
). Automation Controller User Guide - I am unable to set
AWX_REBUILD_SMART_MEMBERSHIP
via the API.
Resolution
-
Add
AWX_REBUILD_SMART_MEMBERSHIP = True
to/etc/tower/conf.d/custom.py
:
[root@ansible ~]# cat /etc/tower/conf.d/custom.py AWX_REBUILD_SMART_MEMBERSHIP = True -
Restart the controller
automation-controller-service restart
-
Confirm the setting has been updated via the
awx-manage shell_plus
:
[root@ansible ~]# awx-manage shell_plus Python 3.8.8 (default, Aug 11 2021, 06:52:42) [GCC 8.5.0 20210514 (Red Hat 8.5.0-3)] on linux Type "help", "copyright", "credits" or "license" for more information. (InteractiveConsole) >>> settings.AWX_REBUILD_SMART_MEMBERSHIP True -
This must be updated on each automation controller and each controller restarted.
Root Cause
- The
AWX_REBUILD_SMART_MEMBERSHIP
setting is a files based setting and can't be set via the API and must be set via thecustom.py
file, its default value isFalse
.
Diagnostic Steps
-
You can confirm the current status of the
AWX_REBUILD_SMART_MEMBERSHIP
setting by running theawx-manage shell_plus
command as follows:
[root@ansible ~]# awx-manage shell_plus Python 3.8.8 (default, Aug 11 2021, 06:52:42) [GCC 8.5.0 20210514 (Red Hat 8.5.0-3)] on linux Type "help", "copyright", "credits" or "license" for more information. (InteractiveConsole) >>> settings.AWX_REBUILD_SMART_MEMBERSHIP False
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Comments