1

I have a chef environment "dev", We are switching our continuous integration build environment from jenkins to bamboo. So we have a bunch of nodes names "jenkins_slave_??" and "bamboo_slave_??

I want to execute yum update -y on all of the jenkins_slave systems in the dev environment. To test that knife only hits my desired servers, the following will execute the commands on all the hosts in the dev env.

knife ssh '*:dev' 'hostname; cat /etc/redhat-release '  -a cloud.public_ipv4 -x ec2-user -i ~/.ssh/dev.pem

The following will execute my command(s) on a specific host.

knife ssh '*:jenkins_slave_01' 'hostname; cat /etc/redhat-release '  -a cloud.public_ipv4 -x ec2-user -i ~/.ssh/dev.pem

I can't get

knife ssh '*:jenkins_slave_*' 'hostname; cat /etc/redhat-release '  -a cloud.public_ipv4 -x ec2-user -i ~/.ssh/dev.pem

or

knife ssh 'jenkins_slave_*:*' 'hostname; cat /etc/redhat-release '  -a cloud.public_ipv4 -x ec2-user -i ~/.ssh/dev.pem

to work. How do I get knife to issue ssh commands to all hosts of a similar node name?

peter cooke
  • 223
  • 1
  • 8

1 Answers1

1

hand face plant sorry see my mistake dash not underscore

ssh '*:jenkins-slave*' 'hostname; cat /etc/redhat-release '  -a cloud.public_ipv4 -x ec2-user -i ~/.ssh/dev.pem
peter cooke
  • 223
  • 1
  • 8