2

I want to be able to set which port to use for ssh forwarding when running up kitchen converge.

I added the forwarded_port lines to .kitchen.yml:

---                                                                                                                                                        
driver:
  name: vagrant
  network:·
    - ["forwarded_port", {guest: 22, host: 2223}]

But kitchen still uses the default port for ssh:

~/D/octopress git:source ❯❯❯ netstat -n -p tcp | grep 22                                                                                  
....
tcp4       0      0  127.0.0.1.2200         127.0.0.1.59456        ESTABLISHED
tcp4       0      0  127.0.0.1.59456        127.0.0.1.2200         ESTABLISHED

Apparently a mapping is created but kitchen is not using it. enter image description here

I have checked chef website and this page does not provide more in-depth info

How can I override the default ssh port?

Anthony Kong
  • 5,318

1 Answers1

1

You didn't give the name of your kitchen instance name, so I will make up a name to proceed with an example. If, in kitchen, in a cookbook, you created a server called 'default-centos-75', you would edit the following file in the home directory of that cookbook:

vi .kitchen/default-centos-75.yml

You would then find the line that begins port: and change the port number to your desired port. For instance, change port: 2222 to port: 2223

Andrew
  • 207