RedHatQE / teflo

Teflo is a standalone orchestration software that controls the flow of a set of testing scenarios, allowing users to provision machines, deploy software, execute tests against them and manage generated artifacts and report results.
https://teflo.readthedocs.io/en/latest/
GNU General Public License v3.0
14 stars 16 forks source link

beaker provisioner: append to authorized_keys rather than overwrite it #229

Closed jbpratt closed 2 years ago

jbpratt commented 2 years ago

https://github.com/RedHatQE/teflo/blob/1d0f54f2f6f0d3810ccbca72420c3258f25a9418/teflo/provisioners/ext/bkr_client_plugin/beaker_client_plugin.py#L486

This overrides any thing that beaker may have set up during the provision. Ideally the file would be appended to.

dno-github commented 2 years ago

Jira ticket CCITCARBON-454 has been created for this issue. Url : https://issues.redhat.com/browse/CCITCARBON-454

rujutashinde commented 2 years ago

Hi @jbpratt , are you seeing that the line https://github.com/RedHatQE/teflo/blob/1d0f54f2f6f0d3810ccbca72420c3258f25a9418/teflo/provisioners/ext/bkr_client_plugin/beaker_client_plugin.py#L486

is causing the public_key at public_key = os.path.join(self.workspace, ssh_key + ".pub")to be copied to folder "/root/.ssh/authorized_keys"directory and overwriting if this dir already had something in it?

jbpratt commented 2 years ago

Hi @rujutashinde , yes that is correct, beaker machines are brought up with anaconda that writes the authorized_keys already; once teflo finishes provisioning the machine, this file is overwritten rather than appended to.

rujutashinde commented 2 years ago

Hi @jbpratt , could you please provide me with a SDF i can test with or would be willing to test out the fix?

jbpratt commented 2 years ago

Hi @rujutashinde , sorry for the delay, I can try to test it out next week. Looks like the fix is accurate :+1: thanks!