/opt/bin/rancher will be created when your particular cloud config file is executed.
Currently all custom commands are run at the same time, which is at the start of the console container. User Docker is started around the same time as the console, so I wouldn’t count on scripts happening either before or after it.
In the future our aim is to implement the cloud config runcmd and bootcmd fields. runcmd will be executed at the same time as commands are now, and bootcmd will happen sometime earlier in the boot process.