Commit Graph

25 Commits

Author SHA1 Message Date
Jeremy Stanley 016a20c0ff Document algorithm var for remove-build-sshkey
A recent hotfix added a fallback zuul_ssh_key_algorithm value for
the remove-build-sshkey role, reflect it in the role documentation.

Also remove some redundancies with default values specified in prose
for the add-build-sshkey role, when they were also indicated by the
:default: parameter.

Change-Id: If3f74256788283dedb17ad780da3ca4df4503cb4
2021-04-01 15:29:01 +00:00
Zuul 20ceaad3c8 Merge "Create a template for ssh-key and size" 2021-03-29 16:10:25 +00:00
GomathiselviS e693c19d9a Create a template for ssh-key and size
Signed-off-by: GomathiselviS <gomathiselvi@gmail.com>
Change-Id: I0d34d3a0a40ea612dc06099b74d27216630f97c9
2021-03-17 09:54:45 -04:00
Sorin Sbarnea ad3167bd56 Fixes all tasks should be named rule
This prepared for ansible-lint v5 which no longer has exceptions
for task naming, requiring all to be named.

Change-Id: I5e761d1e3836fa270d7afdcf01780320001f820d
Part-Of: #773245
2021-03-08 13:30:32 +00:00
Albin Vass 2e7b28ee86 add-build-sshkey: call cmd with command
Currently a new cmd shell is opened instead of running the command
supplied when adding the build key for ssh enabled windows nodes.

Fix this by adding a '/c' flag.

Change-Id: I582febfe91d5dc229cc6a1959477a461a237336b
2020-08-11 11:40:33 +02:00
Albin Vass a7faab5819 add-build-sshkey: Ensure .ssh exists, enable admin authorized_keys
Change-Id: I54608635711a4936ce01c3859706236627d80af9
2020-07-09 21:05:12 +02:00
Albin Vass dd59a158e8 Enforce BatchMode when setting up ssh for windows
Change-Id: I62742dc43df5276f51805e259229405ba9b19362
2020-07-09 14:09:27 +02:00
Albin Vass c4b31748cf add-build-sshkey: update include to include_tasks
Change-Id: Ie5d3688ef647d25e4446cfe648b795e6c9ba0ac0
2020-05-26 10:03:58 +02:00
Tristan de Cacqueray 1e0af6779b Add remove-zuul-sshkey
This change enables a kubectl connection job to just remove the
zuul sshkey, without using the add-build-sshkey role which doesn't
work on pod. To do that, this change moves the sshagent_remove_key
task to a new role and makes add-build-sshkey use the new role.

Change-Id: I5e7288592cad303df919220259f5a360bf522f64
2020-05-15 12:24:33 +00:00
Andreas Jaeger 2026f1825b Use main.yaml, not .yml
There are over 490 .yaml files but only a few .yml, let's rename to be
consistent.

Add a test to block .yml files.

Change-Id: I2f1354de82f231154d926b51d9812b1e9c1a6202
2020-04-20 17:44:49 +02:00
Tobias Henkel b7f14309a7
Support ssh-enabled windows hosts in add-build-sshkey
The winrm protocol is very inefficient when copying things to the node
therefore it makes sense to have working ssh connections on windows
hosts. Adding windows support to the add-build-sshkey role is the
first step towards this.

Change-Id: I5591b39b0107385fec8c6df1fbe6c316177d32e6
2020-04-07 11:12:26 +02:00
Clint Byrum a997073141 Remove argument to ssh-keygen for key size
We don't need to be explicit, ssh-keygen will pick a good size for us.
Meanwhile, 1024 bit keys are generally seen as security problems and
thus ring bells and are refused by some servers/services.

Change-Id: Iaea82e0b394a5a6b1da3b59637fc4e0f541e1978
2019-10-30 16:43:40 -07:00
Jeremy Stanley b6d2616275 Don't compare to literal True/False
With the arrival of ansible-lint 4, comparisons to literal boolean
values are now forbidden. Adjust the new violations accordingly and
remove the rule 601 exclusion.

Change-Id: I18ba2d7d41fabaff35d10d520037188c7d9d1249
2019-08-01 19:01:37 +02:00
Tristan Cacqueray fc90276349 add-build-sshkey: remove previously authorized build-sshkey
This change improves the add-build-sshkey role to be usable for
static node where we need to clean-up previously added build-sshkey.

Change-Id: Ibcb2880deea4f7e51de51d6df11afc1de3fa4571
2019-05-20 13:23:02 +00:00
Andreas Jaeger f6ac770d37 Fix noqa warning
Change Ibfbd5df21e01d5a7bd44a216ff63bc805dd5c186 added the noqa to
silence the warning - the real fix is to use a raw string for the regex
that gets passed in.

Change-Id: I986961082e0252547ca0b7e2cade3167459edf9b
2018-10-28 14:31:23 +01:00
Andreas Jaeger 93ddc0247d Fix flake8 3.6.0 errors
Flake8 3.6.0 now warns about both line break after and *before* binary
operator, you have to choose whether you use W503 or W504. Disable the
newer W504.

Also, ignore warning about invalid escape sequence in regex.

Change-Id: Ibfbd5df21e01d5a7bd44a216ff63bc805dd5c186
2018-10-25 08:09:28 +02:00
James E. Blair 46389b5187 add-build-sshkey: Remove only the master key
This implements a module to directly interact with the ssh-agent
so that the master key may be removed from the ssh-agent without
removing any per-project keys.

Change-Id: Ife91ad8afa9b41b0e779a832e298aca8d61ae98b
2018-09-05 09:26:35 -07:00
Clint Byrum 9ebb3886d1 Install build private key too
This will allow all nodes to SSH to each other, which should facilitate
some multi-node jobs that need this enabled.

We set "force" to "no" on the copies since this is in the base job's
pre.yml, meaning it should run before basically anything else.

Change-Id: If11f05f5cced71f6e9f634195e628ea68813c4cf
2017-08-22 10:52:08 -07:00
James E. Blair 912f976155 Use new sphinx roles in docs
Change-Id: I92ce6b2f137f5dcb6fdee70c101c6b9d8ad5eb11
Depends-On: I9d72d11bfdb700037a6a08f92a2dbfa95ee519ad
2017-08-11 15:10:40 -07:00
Paul Belanger 31fe71d04d Use zuul.executor.work_root for add-build-sshkey
Now that zuul.executor.work_root is live, we can stop using a relative
path for our ssh private key.

Change-Id: I7d8deab60724fb62a18dc0c5fb4eec57056552c7
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2017-08-04 12:28:56 -04:00
Jenkins 51f2ed4036 Merge "Only run once our delegate_to locahost commands" 2017-07-21 20:46:15 +00:00
Paul Belanger 8c820956d1
Fix stat check for add-build-sshkey
We incorrectly include create-key-and-replace.yaml based on the ssh
key existing.

Change-Id: Ia7b0c1338e7d746818bda579a82fdb6d74f81c31
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2017-07-21 16:38:38 -04:00
Paul Belanger bbc4c5b920
Only run once our delegate_to locahost commands
In a multi node setup, we only want this logic to be run one across
all hosts.

Change-Id: I4ebb62f76d4ff7363635bee7073c2d7e8f0ad70e
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2017-07-21 16:21:13 -04:00
Tobias Henkel 68ee0780be Rename uuid to build
In change If9ebdc783dcef4f8dea9fa491b40ae49416e5cf1 in zuul uuid was
renamed to build. This must be also reflected here.

Change-Id: I46101d7a9ecc1513647f19d1d377480d5afa9a5d
2017-07-21 09:46:04 +02:00
James E. Blair cfffd4431b Move some base job roles from openstack-zuul-roles
Change-Id: I7ac8d2335518c06808461f2fb30ea896709f09ed
2017-07-13 15:13:41 -07:00