-
Notifications
You must be signed in to change notification settings - Fork 1k
[telemetry] add telemetry certs on DUT #1716
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
6bd3715
[show] add telemetry certs on DUT
pra-moh dbc967f
[show] correct formatting
pra-moh 3df3ec7
[show] correct some differt formatting
pra-moh 864e3dd
[show] correct format at read dir_path
pra-moh 0086630
[show] replace value with dir_path
pra-moh 6bdfb65
remove extra line and resolve comments
pra-moh 35dce2a
remove clinet side certs
pra-moh 667ae8e
updated PR comment for server cert
pra-moh c21f948
remove url pattern
pra-moh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -122,6 +122,137 @@ | |
| delegate_to: localhost | ||
| when: local_minigraph is defined and local_minigraph|bool == true | ||
|
|
||
| - block: | ||
| - name: Init telemetry keys | ||
| set_fact: | ||
| server_key: "" | ||
| server_csr: "" | ||
| server_cer: "" | ||
| dsmsroot_key: "" | ||
| dsmsroot_csr: "" | ||
| dsmsroot_cer: "" | ||
| dir_path: "" | ||
|
|
||
| - name: read server key | ||
| set_fact: | ||
| server_key: "{{ telemetry_certs['server_key'] }}" | ||
| when: telemetry_certs['server_key'] is defined | ||
|
|
||
| - name: read server csr | ||
| set_fact: | ||
| server_csr: "{{ telemetry_certs['server_csr'] }}" | ||
| when: telemetry_certs['server_csr'] is defined | ||
|
|
||
| - name: read server cer | ||
| set_fact: | ||
| server_cer: "{{ telemetry_certs['server_cer'] }}" | ||
| when: telemetry_certs['server_cer'] is defined | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @pra-moh this is a typo |
||
|
|
||
| - name: read dsmsroot key | ||
| set_fact: | ||
| dsmsroot_key: "{{ telemetry_certs['dsmsroot_key'] }}" | ||
| when: telemetry_certs['dsmsroot_key'] is defined | ||
|
|
||
| - name: read dsmsroot csr | ||
| set_fact: | ||
| dsmsroot_csr: "{{ telemetry_certs['dsmsroot_csr'] }}" | ||
| when: telemetry_certs['dsmsroot_csr'] is defined | ||
|
|
||
| - name: read dsmsroot cer | ||
| set_fact: | ||
| dsmsroot_cer: "{{ telemetry_certs['dsmsroot_cer'] }}" | ||
| when: telemetry_certs['dsmsroot_cer'] is defined | ||
|
|
||
| - name: read directory path | ||
| set_fact: | ||
| dir_path: "{{ telemetry_certs['dir_path'] }}" | ||
| when: telemetry_certs['dir_path'] is defined | ||
|
|
||
| - name: Create telemetry directory | ||
| file: | ||
| path: "{{ dir_path }}" | ||
| state: directory | ||
| mode: '0755' | ||
| become: true | ||
| delegate_to: localhost | ||
|
|
||
| - name: Create telemetry server private key | ||
| openssl_privatekey: | ||
| path: "{{ server_key }}" | ||
| size: 2048 | ||
| mode: '0755' | ||
| become: true | ||
| delegate_to: localhost | ||
|
|
||
| - name: create telemetry server csr | ||
| openssl_csr: | ||
| path: "{{ telemetry_certs['server_csr'] }}" | ||
| privatekey_path: "{{ server_key }}" | ||
| become: true | ||
| delegate_to: localhost | ||
|
|
||
| - name: Generate a Self Signed OpenSSL telemetry server certificate | ||
| openssl_certificate: | ||
| path: "{{ server_cer }}" | ||
pra-moh marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| privatekey_path: "{{ server_key }}" | ||
| csr_path: "{{ server_csr }}" | ||
| subject: | ||
| commonName: ndastreamingservertest | ||
| provider: selfsigned | ||
| become: true | ||
| delegate_to: localhost | ||
|
|
||
| - name: Create telemetry dsmsroot private key | ||
| openssl_privatekey: | ||
| path: "{{ dsmsroot_key }}" | ||
| size: 2048 | ||
| mode: '0755' | ||
| become: true | ||
| delegate_to: localhost | ||
|
|
||
| - name: create telemetry dsmsroot csr | ||
| openssl_csr: | ||
| path: "{{ dsmsroot_csr }}" | ||
| privatekey_path: "{{ dsmsroot_key }}" | ||
| become: true | ||
| delegate_to: localhost | ||
|
|
||
| - name: Generate a Self Signed OpenSSL telemetry dsmsroot certificate | ||
| openssl_certificate: | ||
| path: "{{ dsmsroot_cer }}" | ||
| privatekey_path: "{{ dsmsroot_key }} " | ||
| csr_path: "{{ dsmsroot_csr }} " | ||
| subject: | ||
| commonName: ndastreamingclienttest | ||
| provider: selfsigned | ||
| become: true | ||
| delegate_to: localhost | ||
|
|
||
| - name: Creates telemetry directory | ||
| file: | ||
| path: "{{ dir_path }}" | ||
| state: directory | ||
| mode: '0755' | ||
| become: true | ||
|
|
||
| - name: copy server_key from local to remote | ||
| copy: | ||
| src: "{{ server_key }}" | ||
| dest: "{{ server_key }}" | ||
| become: yes | ||
|
|
||
| - name: copy server_cer from local to remote | ||
| copy: | ||
| src: "{{ server_cer }}" | ||
| dest: "{{ server_cer }}" | ||
| become: yes | ||
|
|
||
| - name: copy dsmsroot_key from local to remote | ||
| copy: | ||
| src: "{{ dsmsroot_key }}" | ||
| dest: "{{ dsmsroot_key }}" | ||
| become: yes | ||
|
|
||
| - block: | ||
| - name: saved original minigraph file in SONiC DUT(ignore errors when file doesnot exist) | ||
| shell: mv /etc/sonic/minigraph.xml /etc/sonic/minigraph.xml.orig | ||
|
|
@@ -140,7 +271,7 @@ | |
| delegate_to: localhost | ||
|
|
||
| - name: debug print stat_result | ||
| debug: | ||
| debug: | ||
| msg: Stat result is {{ stat_result }} | ||
|
|
||
| - name: Copy corresponding configlet files if exist | ||
|
|
||
This file contains hidden or 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 @@ | ||
| # Configure telemetry server and dsmsroot key,cer | ||
|
|
||
| telemetry_certs: | ||
| server_key: "/etc/sonic/telemetry/streamingtelemetryserver.key" | ||
| server_csr: "/etc/sonic/telemetry/streamingtelemetryserver.csr" | ||
| server_cer: "/etc/sonic/telemetry/streamingtelemetryserver.cer" | ||
| dsmsroot_key: "/etc/sonic/telemetry/dsmsroot.key" | ||
| dsmsroot_csr: "/etc/sonic/telemetry/dsmsroot.csr" | ||
| dsmsroot_cer: "/etc/sonic/telemetry/dsmsroot.cer" | ||
| dir_path: "/etc/sonic/telemetry" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.