You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 6, 2018. It is now read-only.
Is it possible to get the IP address of the docker container for use in a recipe with code similar to this ec2 code?
ruby_block "print out public IP" do
block do
appservernode = search(:node, "name:#{appserver_instance_name}").first
Chef::Log.info("Application can be accessed at http://#{appservernode['ec2']['public_ipv4']}:3001")
end
end
The text was updated successfully, but these errors were encountered:
Basically chef does converge docker containers same way as any other node. So, after running machine your chef server should contain node <machine_name>, and you'll be able to obtain its Ohai attributes:
ruby_block"print out public IP"doblockdocontainer=search(:node,"name:#{machine_name}").firstChef::Log.info("Application can be accessed at http://#{container['ipaddress']}:3001")Chef::Log.info("Application can be accessed at http://[#{container['ip6address']}]:3001")endend
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Is it possible to get the IP address of the docker container for use in a recipe with code similar to this ec2 code?
ruby_block "print out public IP" do
block do
appservernode = search(:node, "name:#{appserver_instance_name}").first
Chef::Log.info("Application can be accessed at http://#{appservernode['ec2']['public_ipv4']}:3001")
end
end
The text was updated successfully, but these errors were encountered: