Repository: ansible/awx

Issue:
Genrated certificate in install bundle for Execution node is valid only for 10 days
### Please confirm the following

- [X] I agree to follow this project's [code of conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html).
- [X] I have checked the [current issues](https://github.com/ansible/awx/issues) for duplicates.
- [X] I understand that AWX is open source software provided for free and that I might not receive a timely response.

### Bug Summary

The certificate for receptor in install bundle (`*.tar.gz`) for execution node that generated by AWX is valid only for 10 days.

In my understanding currently there is no automated certificate renewal feature in both AWX and Receptor, so I guess the execution environment will be invalidated after 10 days. 

Therefore frequently renewal (generating bundle and invoke playbook again) by hand might be required.

```bash
$ ls -l
total 24
-rw-rw-r--. 1 kuro kuro 11278 Oct  7 05:12 ansible.log
drwxrwxr-x. 2 kuro kuro    21 Oct  7 05:09 group_vars
-rw-r--r--. 1 kuro kuro   406 Jan  1  1970 install_receptor.yml
-rw-r--r--. 1 kuro kuro   159 Oct  7 05:10 inventory.yml
drwxrwxr-x. 3 kuro kuro    44 Oct  7 05:09 receptor
-rw-r--r--. 1 kuro kuro   137 Jan  1  1970 requirements.yml

$ openssl x509 -text -in receptor/tls/receptor.crt -noout | grep Not
            Not Before: Oct  6 20:09:21 2022 GMT
            Not After : Oct 16 20:09:21 2022 GMT     👈👈👈
```

Installer (playbook) just place certificate on execution node without any modification, so deployed execution node uses certificate that included in the install bandle as is. 

I have no idea if this is a _bug_ or _designed behavior_, but just in case I'm creating this issue.

### AWX version

21.7.0

### Select the relevant components

- [ ] UI
- [X] API
- [ ] Docs
- [ ] Collection
- [ ] CLI
- [ ] Other

### Installation method

kubernetes

### Modifications

no

### Ansible version

N/A

### Operating system

CentOS 8 Stream

### Web browser

Chrome

### Steps to reproduce

1. Deploy AWX 21.7.0 on any platform
2. Add new instance and generate install bundle for the instance
3. Extract install bundle and ensure `Not After` in the `receptor.crt` by `openssl x509 -text -in receptor/tls/receptor.crt -noout`

### Expected results

Certificate and execution environment are valid for enough life time.

### Actual results

Not tested enough, I guess my execution environment will be expired in 10 days if I won't make any manual renewal for the certs.

### Additional information

@TheRealHaoLiu @jbradberry 
Thanks for excellent feature; execution node! It works as expected in my environment in this few days :)
Sorry for annoying you by this mention, but I want to confirm that this is designed or not.

I found that there is hard-coded `days=10` in your commit.
https://github.com/ansible/awx/blob/150c55c72a4d1d896474c9d3aaaceeb1b69ee253/awx/api/views/instance_install_bundle.py#L181

According to your comment on `awx-operator` repository, it seems that you've designed it as _10 years_ instead of _10 days_ I guess...?; https://github.com/ansible/awx-operator/pull/1012#issuecomment-1208423340

Please let me know it's not recommended that trying to use generated certs in the long term, or if you have an easier way to renew certs.


Discussion:
You are amazing

Resolving patch:
diff --git a/awx/api/views/instance_install_bundle.py b/awx/api/views/instance_install_bundle.py
--- a/awx/api/views/instance_install_bundle.py
+++ b/awx/api/views/instance_install_bundle.py
@@ -178,7 +178,7 @@ def generate_receptor_tls(instance_obj):
         .public_key(csr.public_key())
         .serial_number(x509.random_serial_number())
         .not_valid_before(datetime.datetime.utcnow())
-        .not_valid_after(datetime.datetime.utcnow() + datetime.timedelta(days=10))
+        .not_valid_after(datetime.datetime.utcnow() + datetime.timedelta(days=3650))
         .add_extension(
             csr.extensions.get_extension_for_class(x509.SubjectAlternativeName).value,
             critical=csr.extensions.get_extension_for_class(x509.SubjectAlternativeName).critical,


Test patch: