Skip to content

Commit 3609def

Browse files
committed
Add pulp_content_guard role
This role currently supports adding x509 cert guard content guards.
1 parent 2168c81 commit 3609def

File tree

4 files changed

+61
-0
lines changed

4 files changed

+61
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Tested with the current Ansible 2.9-2.10 releases.
1111

1212
## Included content
1313

14+
pulp_contentguard role
1415
pulp_repository role
1516

1617
## Using this collection

roles/pulp_content_guard/README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
pulp_content_guard
2+
==================
3+
4+
This role manages Pulp content guards.
5+
6+
Role variables
7+
--------------
8+
9+
* `pulp_url`: URL of Pulp server. Default is `https://localhost:8080`
10+
* `pulp_username`: Username used to access Pulp server. Default is `admin`
11+
* `pulp_password`: Password used to access Pulp server. Default is unset
12+
* `pulp_validate_certs`: Whether to validate Pulp server certificate. Default is `true`
13+
* `pulp_content_guard_x509_cert_guards`: List of x509 cert guards. Each item is
14+
a dict with the following keys: `name`, `description`, `ca_certificate`,
15+
`state`.
16+
17+
18+
Example playbook
19+
----------------
20+
21+
```
22+
---
23+
- name: Create Pulp content guards
24+
any_errors_fatal: True
25+
gather_facts: True
26+
hosts: all
27+
roles:
28+
- role: stackhpc.pulp.pulp_contentguard
29+
pulp_username: admin
30+
pulp_password: "{{ secrets_pulp_admin_password }}"
31+
pulp_content_guard_x509_cert_guards:
32+
- name: test_cert_guard
33+
description: For testing
34+
ca_certificate: |-
35+
-----BEGIN CERTIFICATE-----
36+
...
37+
-----END CERTIFICATE-----
38+
state: present
39+
```
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
pulp_url: https://localhost:8080
3+
pulp_username: admin
4+
pulp_password:
5+
pulp_validate_certs: true
6+
7+
pulp_content_guard_x509_cert_guards: []
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
- name: Ensure x509 cert guards exist
3+
pulp.squeezer.x509_cert_guard:
4+
pulp_url: "{{ pulp_url }}"
5+
username: "{{ pulp_username }}"
6+
password: "{{ pulp_password }}"
7+
validate_certs: "{{ pulp_validate_certs | bool }}"
8+
name: "{{ item.name }}"
9+
description: "{{ item.description | default(omit) }}"
10+
ca_certificate: "{{ item.ca_certificate | default(omit) }}"
11+
state: "{{ item.state }}"
12+
with_items: "{{ pulp_content_guard_x509_cert_guards }}"
13+
loop_control:
14+
label: "{{ item.name }}"

0 commit comments

Comments
 (0)