-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
self-signed TLS rsyslog client and server
- Loading branch information
1 parent
5ffa9e9
commit 620dae1
Showing
12 changed files
with
314 additions
and
32 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 |
---|---|---|
@@ -1 +1,2 @@ | ||
.vscode | ||
molecule/default/files/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
--- | ||
- name: Prepare directory | ||
hosts: localhost | ||
connection: local | ||
become: false | ||
vars: | ||
out_dir: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') }}/molecule/default/files" | ||
tasks: | ||
- name: Create files directory for testing | ||
ansible.builtin.file: | ||
path: "{{ out_dir }}" | ||
state: directory | ||
mode: '0700' | ||
|
||
- name: Prepare TLS certificates | ||
hosts: loghost | ||
vars: | ||
syslog_cert: "{{ inventory_hostname }}" | ||
out_dir: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') }}/molecule/default/files" | ||
key_dir: /etc/pki/tls/private | ||
crt_dir: /etc/pki/tls/certs | ||
tasks: | ||
- name: Generate certificate | ||
ansible.builtin.command: | ||
argv: | ||
- openssl | ||
- req | ||
- -x509 | ||
- -nodes | ||
- -days | ||
- 7 | ||
- -newkey | ||
- rsa:4096 | ||
- -keyout | ||
- "{{ key_dir }}/{{ syslog_cert }}.key" | ||
- -out | ||
- "{{ crt_dir }}/{{ syslog_cert }}.crt" | ||
- -subj | ||
- "/C=US/ST=Virginia/L=Langley/O=CIA/OU=Wire Tapping/CN={{ inventory_hostname }}" | ||
creates: "{{ crt_dir }}/{{ syslog_cert }}.crt" | ||
|
||
- name: Fetch TLS certificate | ||
ansible.builtin.fetch: | ||
src: "{{ crt_dir }}/{{ syslog_cert }}.crt" | ||
flat: true | ||
dest: "{{ out_dir }}/" | ||
mode: '0644' | ||
|
||
... |
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
Oops, something went wrong.