This repository has been archived by the owner on Jan 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #361 from mdellweg/install_token_keys
Import or generate key for token authentication
- Loading branch information
Showing
10 changed files
with
90 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
A key for token authentication is installed from either a specified file or a newly generated one. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
- name: Look for token authentication key | ||
stat: | ||
path: "{{ __pulp_common_pulp_pki_dir }}/token_private_key.pem" | ||
get_attributes: false | ||
get_checksum: false | ||
get_mime: false | ||
become: true | ||
become_user: "{{ pulp_user }}" | ||
register: __pulp_token_auth_key | ||
|
||
- name: Generate token authentication private key | ||
openssl_privatekey: | ||
path: "{{ __pulp_common_pulp_pki_dir }}/token_private_key.pem" | ||
type: ECC | ||
curve: secp256r1 | ||
owner: "{{ pulp_user }}" | ||
group: "{{ pulp_group }}" | ||
become: true | ||
become_user: "{{ pulp_user }}" | ||
when: not __pulp_token_auth_key.stat.exists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
- name: Import specified token authentication key | ||
copy: | ||
src: "{{ pulp_token_auth_key }}" | ||
dest: "{{ __pulp_common_pulp_pki_dir }}/token_private_key.pem" | ||
owner: "{{ pulp_user }}" | ||
group: "{{ pulp_group }}" | ||
mode: 0600 | ||
become: true | ||
become_user: "{{ pulp_user }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters