Skip to content

Commit 6804524

Browse files
Ramchukka
Ram
authored andcommitted
[ansible] JFrog Platform 10.20.1 release
1 parent 005008a commit 6804524

File tree

26 files changed

+242
-18
lines changed

26 files changed

+242
-18
lines changed

Ansible/ansible_collections/jfrog/platform/CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
# JFrog Platform Ansible Collection Changelog
22
All changes to this collection will be documented in this file.
33

4+
## [10.20.1] - Nov 26, 2024
5+
* Postgres - Fixed auth method in pg_hba.conf file [GH-428](https://github.com/jfrog/JFrog-Cloud-Installers/pull/428)
6+
* Artifactory - Fixed issue around /etc/cron.allow does not exist [GH-420](https://github.com/jfrog/JFrog-Cloud-Installers/issues/420)
7+
* Xray - Added `centos_gpg_key` variable to override defaults [GH-420](https://github.com/jfrog/JFrog-Cloud-Installers/issues/413)
8+
* Added support for RHEL 9
9+
* Artifactory - Added AccessConfig Patch support to use mTLS [GH-392](https://github.com/jfrog/JFrog-Cloud-Installers/pull/392)
10+
* Product Updates/fixes
11+
412
## [10.20.0] - Oct 29, 2024
513
* Product Updates/fixes
614

Ansible/ansible_collections/jfrog/platform/galaxy.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace: "jfrog"
99
name: "platform"
1010

1111
# The version of the collection. Must be compatible with semantic versioning
12-
version: "10.20.0"
12+
version: "10.20.1"
1313

1414
# The path to the Markdown (.md) readme file. This path is relative to the root of the collection
1515
readme: "README.md"

Ansible/ansible_collections/jfrog/platform/roles/artifactory/defaults/main.yml

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Defaults file for artifactory
22

33
# The version of artifactory to install
4-
artifactory_version: 7.98.7
4+
artifactory_version: 7.98.9
55

66
# Set this to true when SSL is enabled (to use artifactory_nginx_ssl role), default to false (implies artifactory uses artifactory_nginx role )
77
artifactory_nginx_ssl_enabled: false
@@ -116,4 +116,12 @@ artifactory_binarystore: |-
116116
artifactory_systemyaml_override: false
117117

118118
# Allow artifactory user to create crontab rules
119-
artifactory_allow_crontab: false
119+
artifactory_allow_crontab: false
120+
121+
# Provide access config patch content
122+
artifactory_access_config_patch: |-
123+
# security:
124+
# authentication:
125+
# mtls:
126+
# enabled: true
127+
# extraction-regex: (.*)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
- name: Create the access.config.patch.yml file
2+
become: true
3+
template:
4+
src: access-config-patch.yml.j2
5+
dest: "{{ artifactory_home }}/var/etc/access/access.config.patch.yml"
6+
owner: "{{ artifactory_user }}"
7+
group: "{{ artifactory_group }}"
8+
mode: 0644
9+
notify: Restart artifactory
10+
when:
11+
- artifactory_access_config_patch is defined
12+
- artifactory_access_config_patch | length > 0

Ansible/ansible_collections/jfrog/platform/roles/artifactory/tasks/install.yml

+4
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
path: /etc/cron.allow
4848
line: "{{ artifactory_user }}"
4949
state: present
50+
create: true
5051
when: artifactory_allow_crontab
5152

5253
- name: Allow reading cron.allow
@@ -132,6 +133,9 @@
132133
- artifactory_systemyaml_override or (not systemyaml.stat.exists)
133134
notify: Restart artifactory
134135

136+
- name: Configure access config
137+
ansible.builtin.include_tasks: shared/access_configuration.yml
138+
135139
- name: Configure master key
136140
become: true
137141
ansible.builtin.copy:

Ansible/ansible_collections/jfrog/platform/roles/artifactory/tasks/upgrade.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
path: /etc/cron.allow
77
line: "{{ artifactory_user }}"
88
state: present
9+
create: true
910
when: artifactory_allow_crontab
1011

1112
- name: Allow reading cron.allow
@@ -154,6 +155,9 @@
154155
- artifactory_systemyaml_override or (not systemyaml.stat.exists)
155156
notify: Restart artifactory
156157

158+
- name: Configure access config
159+
ansible.builtin.include_tasks: shared/access_configuration.yml
160+
157161
- name: Install Service
158162
ansible.builtin.include_tasks: shared/install_service.yml
159163

@@ -179,4 +183,4 @@
179183
delay: 5
180184
when:
181185
- not ansible_check_mode
182-
- artifactory_start_service | bool
186+
- artifactory_start_service | bool
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{{ artifactory_access_config_patch }}
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# platform collection version
2-
platform_collection_version: 10.20.0
2+
platform_collection_version: 10.20.1
33

44
# indicates where this collection was downloaded from (galaxy, automation_hub, standalone)
55
ansible_marketplace: galaxy

Ansible/ansible_collections/jfrog/platform/roles/artifactory_nginx_ssl/README.md

+93-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,96 @@ The artifactory_nginx_ssl role installs and configures nginx for SSL.
1010
* _ssl_certificate_key_path_: This is the full directory path for the SSL private key, excluding _ssl_certificate_key_.
1111
* _nginx_worker_processes_: The worker_processes configuration for nginx. Defaults to 1.
1212
* _artifactory_docker_registry_subdomain_: Whether to add a redirect directive to the nginx config for the use of docker
13-
subdomains.
13+
subdomains.
14+
* _mtls_ca_certificate_install_: `false` - Enable mTLS by updating to `true`
15+
* _mtls_mtls_ca_certificate_crt_name_: This is the full name of the CA certificate
16+
* _mtls_ca_certificate_path_: This is the full directory path for the CA certificate
17+
* _mtls_mtls_ca_certificate_key_name_: This is the full name of the CA key
18+
* _mtls_ca_certificate_crt_: This is the place to add the certificate
19+
* _mtls_ca_certificate_key_: This is the place to add the key
20+
21+
22+
# Configuring mTLS in Artifactory with NGINX
23+
**To enable mTLS (Mutual TLS) authentication in Artifactory through NGINX, follow these steps:**
24+
25+
1. NGINX Changes
26+
2. Artifactory Changes
27+
28+
## Step: 1 - NGINX Changes
29+
30+
Open `main.yml` in `artifactory_nginx_ssl` from the following location:
31+
32+
`platform/products/ansible/ansible_collections/jfrog/platform/roles/artifactory_nginx_ssl/defaults/main.yml`
33+
34+
### Set Up CA Certificate
35+
36+
Modify the `mtls_ca_certificate_install` parameter from `false` to `true`.
37+
38+
**Create CA Certificates**: CA certificates in mTLS verifies the authenticity and trustworthiness of client and server certificates, ensuring secure and mutual authentication.
39+
40+
**Run the following command to create CA certificates:**
41+
42+
```
43+
openssl req -new -x509 -nodes -days 365 -subj '/CN=my-ca' -keyout ca.key -out ca.crt
44+
```
45+
46+
Add the `ca.crt` and `ca.key` files to the relevant YAML file in the same directory.
47+
Update the above generated certificates with below parameters:
48+
49+
mtls_ca_certificate_crt: |
50+
51+
mtls_ca_certificate_key: |
52+
53+
54+
## Step: 2 - Arifactory Changes
55+
56+
### Enable mTLS Configuration
57+
Under `artifactory_access_config_patch`, add the configuration in the following location to enable mTLS:
58+
`platform/products/ansible/ansible_collections/jfrog/platform/roles/artifactory/defaults/main.yml`
59+
60+
```
61+
security:
62+
authentication:
63+
mtls:
64+
enabled: true
65+
extraction-regex: (.*)
66+
```
67+
68+
In the same `main.yaml`, update the following flags to:
69+
70+
- `artifactory_nginx_ssl_enabled: true`
71+
- `artifactory_nginx_enabled: false`
72+
73+
For more information, refer to the [Artifactory Documentation](https://jfrog.com/help/r/jfrog-artifactory-documentation/set-up-mtls-verification-and-certificate-termination-on-the-reverse-proxy).
74+
75+
## Client Validation
76+
77+
**Follow the below steps to validate client:**
78+
79+
1. **Generate Server Certificate and Key for client validation**
80+
81+
Create the Server Key and Certificate:
82+
Use the CA certificates created in [Step 1](#step-1---nginx-changes) to generate the server key and certificate.
83+
84+
```
85+
openssl genrsa -out server.key 2048
86+
```
87+
88+
```
89+
openssl req -new -key server.key -subj '/CN=localhost' -out server.csr
90+
```
91+
92+
```
93+
openssl x509 -req -in server.csr -CA ca.crt -CAkey ca.key -CAcreateserial -days 365 -out server.crt
94+
```
95+
96+
2. **Verify mTLS Configuration for client testing**
97+
To test the mTLS setup, use a tool like curl:
98+
99+
```
100+
curl -u <username>:<password> "http://<artifactory-url>/artifactory/api/system/ping" --cert server.crt --key server.key -k
101+
```
102+
103+
This command should establish a connection using the configured mTLS, ensuring proper communication with Artifactory.
104+
105+

Ansible/ansible_collections/jfrog/platform/roles/artifactory_nginx_ssl/defaults/main.yml

+9
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ nginx_daemon: nginx
88
redirect_http_to_https_enabled: true
99

1010
nginx_worker_processes: 1
11+
1112
artifactory_docker_registry_subdomain: false
1213

1314
artifactory_conf_template: artifactory.conf.j2
@@ -18,3 +19,11 @@ ssl_certificate_path: /etc/pki/tls/certs
1819
ssl_certificate_key_path: /etc/pki/tls/private
1920
ssl_certificate: cert.pem
2021
ssl_certificate_key: cert.key
22+
23+
## If we want to use mTLS, set the mtls_ca_certificate_install variable to true and provide the ca certificate and key
24+
mtls_ca_certificate_install: false
25+
mtls_mtls_ca_certificate_crt_name: ca.crt
26+
mtls_ca_certificate_path: /etc/pki/tls/certs
27+
mtls_mtls_ca_certificate_key_name: ca.key
28+
mtls_ca_certificate_crt: |
29+
mtls_ca_certificate_key: |

Ansible/ansible_collections/jfrog/platform/roles/artifactory_nginx_ssl/tasks/main.yml

+34
Original file line numberDiff line numberDiff line change
@@ -92,5 +92,39 @@
9292
no_log: true
9393
when: ssl_certificate_install
9494

95+
- name: Ensure mtls_ca_certificate_key_path exists
96+
become: true
97+
ansible.builtin.file:
98+
path: "{{ mtls_ca_certificate_path }}"
99+
state: directory
100+
mode: 0755
101+
when:
102+
- mtls_ca_certificate_install
103+
- artifactory_version is version('7.77.0', '>=')
104+
105+
- name: Configure ca certificate
106+
become: true
107+
ansible.builtin.template:
108+
src: certificate.crt.j2
109+
dest: "{{ mtls_ca_certificate_path }}/{{ mtls_mtls_ca_certificate_crt_name }}"
110+
mode: 0644
111+
notify: Restart nginx
112+
no_log: true
113+
when:
114+
- mtls_ca_certificate_install
115+
- artifactory_version is version('7.77.0', '>=')
116+
117+
- name: Configure ca key
118+
become: true
119+
ansible.builtin.template:
120+
src: certificate.cakey.j2
121+
dest: "{{ mtls_ca_certificate_path }}/{{ mtls_mtls_ca_certificate_key_name }}"
122+
mode: 0600
123+
notify: Restart nginx
124+
no_log: true
125+
when:
126+
- mtls_ca_certificate_install
127+
- artifactory_version is version('7.77.0', '>=')
128+
95129
- name: Restart nginx
96130
ansible.builtin.meta: flush_handlers

Ansible/ansible_collections/jfrog/platform/roles/artifactory_nginx_ssl/templates/artifactory.conf.j2

+7
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@
2222
if ($http_x_forwarded_proto = '') {
2323
set $http_x_forwarded_proto $scheme;
2424
}
25+
##Set up mTLS Verification and Certificate Termination on the Reverse Proxy
26+
{% if mtls_ca_certificate_install %}
27+
ssl_verify_client on;
28+
ssl_verify_depth 2;
29+
ssl_client_certificate {{ mtls_ca_certificate_path }}/{{ mtls_mtls_ca_certificate_crt_name }};
30+
proxy_set_header X-JFrog-Client-Cert $ssl_client_escaped_cert;
31+
{% endif %}
2532
## Application specific logs
2633
access_log /var/log/nginx/artifactory-access.log;
2734
error_log /var/log/nginx/artifactory-error.log;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{% set cert = mtls_ca_certificate_key.split('|') %}
2+
{% for line in cert %}
3+
{{ line }}
4+
{% endfor %}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{% set cert = mtls_ca_certificate_crt.split('|') %}
2+
{% for line in cert %}
3+
{{ line }}
4+
{% endfor %}

Ansible/ansible_collections/jfrog/platform/roles/distribution/defaults/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# defaults file for distribution
22

33
# The version of distribution to install
4-
distribution_version: 2.26.1
4+
distribution_version: 2.27.2
55

66
# whether to enable HA
77
distribution_ha_enabled: false

Ansible/ansible_collections/jfrog/platform/roles/distribution/tasks/install.yml

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
path: /etc/cron.allow
2323
line: "{{ distribution_user }}"
2424
state: present
25+
create: true
2526
when: distribution_allow_crontab
2627

2728
- name: Allow reading cron.allow

Ansible/ansible_collections/jfrog/platform/roles/distribution/tasks/upgrade.yml

+1
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@
122122
path: /etc/cron.allow
123123
line: "{{ distribution_user }}"
124124
state: present
125+
create: true
125126
when: distribution_allow_crontab
126127

127128
- name: Allow reading cron.allow
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# platform collection version
2-
platform_collection_version: 10.20.0
2+
platform_collection_version: 10.20.1
33

44
# indicates were this collection was downlaoded from (galaxy, automation_hub, standalone)
55
ansible_marketplace: galaxy
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# platform collection version
2-
platform_collection_version: 10.20.0
2+
platform_collection_version: 10.20.1
33

44
# indicates were this collection was downlaoded from (galaxy, automation_hub, standalone)
55
ansible_marketplace: galaxy

Ansible/ansible_collections/jfrog/platform/roles/postgres/tasks/RedHat.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@
1313
ansible.builtin.yum:
1414
name: python3-psycopg2
1515
state: present
16-
when: ansible_distribution_major_version == '8'
16+
when: ansible_facts['distribution_major_version'] | int in [8, 9]
1717

1818
- name: Install python2-psycopg2
1919
become: true
2020
ansible.builtin.yum:
2121
name: python-psycopg2
2222
state: present
23-
when: ansible_distribution_major_version == '7'
23+
when: ansible_facts['distribution_major_version'] | int == 7
2424

2525
- name: Fixup some locale issues
2626
become: true
@@ -72,8 +72,8 @@
7272
profiles=
7373
state=disabled
7474
when:
75-
- ansible_os_family == 'RedHat'
76-
- ansible_distribution_major_version | int == 8
75+
- ansible_facts['os_family'] == 'RedHat'
76+
- ansible_facts['distribution_major_version'] | int in [8, 9]
7777

7878
- name: Install PostgreSQL packages
7979
become: true

Ansible/ansible_collections/jfrog/platform/roles/xray/defaults/main.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Defaults file for xray
22

33
# The version of xray to install
4-
xray_version: 3.104.18
4+
xray_version: 3.107.11
55

66
# Whether to enable HA
77
xray_ha_enabled: false
@@ -49,6 +49,8 @@ xray_system_yaml_template: system.yaml.j2
4949

5050
linux_distro: "{{ ansible_distribution | lower }}{{ ansible_distribution_major_version }}"
5151

52+
centos_gpg_key: "https://www.centos.org/keys/RPM-GPG-KEY-CentOS-Official"
53+
5254
xray_db_util_search_filter:
5355
ubuntu18:
5456
db5: 'db5.3-util.*ubuntu1.1.*amd64\.deb'
@@ -65,6 +67,10 @@ xray_db_util_search_filter:
6567
debian11:
6668
db5: 'TBD'
6769
db: 'db-util_([0-9]{1,3}\.?){3}.*nmu1_all\.deb'
70+
redhat7:
71+
db: 'libdb-utils-5.3.*el7.x86_64.rpm'
72+
redhat9:
73+
db: 'libdb-utils-5.3.*el9.x86_64.rpm'
6874

6975

7076
yum_python_interpreter: >-

0 commit comments

Comments
 (0)