-
-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
97 additions
and
103 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
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 |
---|---|---|
@@ -1,19 +1,14 @@ | ||
--- | ||
- name: "Bash | Get private variables from Vault" | ||
ansible.builtin.command: "op read 'op://Personal/Openai/OPENAI_KEY - Project'" | ||
register: op_openai_key | ||
ansible.builtin.command: "op read '{{ secret.vault_path }}'" | ||
register: op_secret | ||
changed_when: false | ||
no_log: true | ||
|
||
- name: "Bash | Set bash_private init" | ||
ansible.builtin.set_fact: | ||
bash_private: {} | ||
no_log: true | ||
|
||
- name: "Bash | Set bash_private" | ||
ansible.builtin.set_fact: | ||
bash_private: "{{ bash_private | combine({ item.key: item.value }) }}" | ||
no_log: true | ||
with_items: | ||
- key: OPENAI_API_KEY | ||
value: "{{ op_openai_key.stdout }}" | ||
- key: "{{ secret.name }}" | ||
value: "{{ op_secret.stdout }}" |
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,27 @@ | ||
- name: "SSH | Get [{{ item.name }}] key from Vault" | ||
ansible.builtin.command: "op read '{{ item.vault_path }}/private_key?ssh-format=openssh'" | ||
register: op_private_key | ||
changed_when: false | ||
no_log: true | ||
|
||
- name: "SSH | Get [{{ item.name }}] public key from Vault" | ||
ansible.builtin.command: "op read '{{ item.vault_path }}/public_key'" | ||
register: op_public_key | ||
changed_when: false | ||
no_log: true | ||
|
||
- name: "SSH | Copy SSH keys" | ||
block: | ||
- name: "SSH | Deploy [{{ item.name }}] private key" | ||
ansible.builtin.copy: | ||
dest: "{{ ansible_user_dir }}/.ssh/{{ item.name }}" | ||
content: "{{ op_private_key.stdout }}\n" | ||
mode: "0600" | ||
no_log: true | ||
|
||
- name: "SSH | Deploy [{{ item.name }}] public key" | ||
ansible.builtin.copy: | ||
dest: "{{ ansible_user_dir }}/.ssh/{{ item.name }}.pub" | ||
content: "{{ op_public_key.stdout }}" | ||
mode: "0644" | ||
no_log: true |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,14 @@ | ||
--- | ||
- name: "ZSH | Get private variables from Vault" | ||
ansible.builtin.command: "op read '{{ op.openai.key }}'" | ||
register: op_openai_key | ||
ansible.builtin.command: "op read '{{ secret.vault_path }}'" | ||
register: op_secret | ||
changed_when: false | ||
no_log: true | ||
|
||
- name: "ZSH | Set zsh_private init" | ||
ansible.builtin.set_fact: | ||
zsh_private: {} | ||
no_log: true | ||
|
||
- name: "ZSH | Set zsh_private" | ||
ansible.builtin.set_fact: | ||
zsh_private: "{{ zsh_private | combine({ item.key: item.value }) }}" | ||
no_log: true | ||
with_items: | ||
- key: OPENAI_API_KEY | ||
value: "{{ op_openai_key.stdout }}" | ||
- key: "{{ secret.name }}" | ||
value: "{{ op_secret.stdout }}" |