Skip to content

Commit

Permalink
Inject dev ssh keys when a variable is set
Browse files Browse the repository at this point in the history
Currently, developers that want to connect to the CI VM to verify
what is happening with the environment need to make many "hoops"
to connect to that host.
That feature will be helpful for developers of sf-operator project to
inject pub keys just by setting:

    inject_dev_ssh_keys: true

in the zuul.d job definition.

Change-Id: I234cb597d61c87abe884ecc7826419f954ed1158
  • Loading branch information
danpawlik committed Oct 27, 2023
1 parent f5da65a commit 3747071
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
14 changes: 14 additions & 0 deletions playbooks/health-check/dev-keys.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
- hosts: all
tasks:
- name: Set dev ssh keys
when: inject_dev_ssh_keys | default(false)
block:
- name: Clone SF devs pub keys repo
ansible.builtin.git:
repo: https://softwarefactory-project.io/r/SF_devs_public_keys
dest: SF_devs_public_keys

- name: Copy content to authorized keys
ansible.builtin.shell: |
cat SF_devs_public_keys/authorized_keys >> ~/.ssh/authorized_keys
2 changes: 2 additions & 0 deletions zuul.d/jobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
parent: sf-operator-microshift
timeout: 3600
pre-run:
- playbooks/health-check/dev-keys.yaml
- playbooks/health-check/dstat-pre.yaml
post-run:
- playbooks/health-check/dstat-post.yaml
Expand Down Expand Up @@ -41,6 +42,7 @@
cloudprovider_dns:
- 199.204.44.24
- 199.204.47.54
inject_dev_ssh_keys: false

- job:
name: sf-operator-multinode
Expand Down

0 comments on commit 3747071

Please sign in to comment.