From d0bbde6aa4248a07358b84993acdff4b1902114b Mon Sep 17 00:00:00 2001 From: kurokobo <2920259+kurokobo@users.noreply.github.com> Date: Mon, 27 Jun 2022 23:58:24 +0900 Subject: [PATCH] fix: fix syntax error in yaml for provisioning callback --- tips/troubleshooting.md | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/tips/troubleshooting.md b/tips/troubleshooting.md index 2a2ac31..dec50fe 100644 --- a/tips/troubleshooting.md +++ b/tips/troubleshooting.md @@ -367,15 +367,17 @@ Now your client's IP address can be passed correctly through `X-Forwarded-For` a The last step is modifying AWX. By default, AWX uses only `REMOTE_ADDR` and `REMOTE_HOST` headers to determine the remote host (means HTTP client). Therefore, you have to make AWX to use `X-Forwarded-For` header. -Modify your `base/awx.yaml` and add following three lines. +This can be achieved by modifying your `base/awx.yaml` and apply it, or simply configure `Remote Host Headers` via AWX UI. -```bash +If you want to use `base/awx.yaml` to achieve this, add following three lines to your `base/awx.yaml`. + +```yaml ... spec: - ... - extra_settings: 👈👈👈 + ... + extra_settings: 👈👈👈 - setting: REMOTE_HOST_HEADERS 👈👈👈 - value: "['HTTP_X_FORWARDED_FOR', 'REMOTE_ADDR', 'REMOTE_HOST']" 👈👈👈 + value: "['HTTP_X_FORWARDED_FOR', 'REMOTE_ADDR', 'REMOTE_HOST']" 👈👈👈 ``` Then apply this change and wait for your AWX will be reconfigured. @@ -390,6 +392,16 @@ You can watch its progress by following command as did when you deploy AWX at th kubectl -n awx logs -f deployments/awx-operator-controller-manager -c awx-manager ``` +Alternatively you can modify this settings via AWX UI. Move on to `Settings` > `Miscellaneous System settings` > `Edit` page, then and put following JSON strings as `Remote Host Headers`. + +```json +[ + "HTTP_X_FORWARDED_FOR", + "REMOTE_ADDR", + "REMOTE_HOST" +] +``` + Now your Provisioning Callback should work. In my environment, the name of the host in the inventory have to be defined using IP address instead of DNS hostname. ### The job failed and I got "ERROR! couldn't resolve module/action" or "Failed to import the required Python library" message