We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please describe your feature request. i want get host ipaddress from hostname
Note:
Describe the solution you'd like If we have config.yml like: (please keep to around 10 lines )
hosts: - {name: node1, address: 172.16.0.2, port: 22, user: ubuntu, password: "Ubuntu@123"} - {name: node2, address: 172.16.0.3, port: 22, user: ubuntu, password: "Ubuntu@123"} - {name: node3, address: 172.16.0.4, port: 22, user: ubuntu, password: "Ubuntu@123"} - {name: node4, address: 172.16.0.5, port: 22, user: ubuntu, password: "Ubuntu@123"} - {name: node5, address: 172.16.0.6, port: 22, user: ubuntu, password: "Ubuntu@123"} - {name: node6, address: 172.16.0.7, port: 22, user: ubuntu, password: "Ubuntu@123"} roleGroups: etcd: - node1 - node2 - node3 ceph: - node1 - node2 - node3 master: - node1 - node2 - node3 worker: - node1 - node2 - node3
And we run a command:
masters_hostname=$(yq .roleGroups.master.[] config.yaml)
it could output
node1 node2 node3
Describe alternatives you've considered i want get node1 node2 node3 ip address, any suggestion
masters_ipaddress=$(yq .hosts.env(.roleGroups.master).address config.yaml) ?
i want get output like this, but i don't know i can i do this
172.16.0.2 172.16.0.3 172.16.0.4
Additional context Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered:
yq eval '.roleGroups.master[] as $server | .hosts[] | select(.name == $server)| .address' config.yaml
Sorry, something went wrong.
No branches or pull requests
Please describe your feature request.
i want get host ipaddress from hostname
Note:
Describe the solution you'd like
If we have config.yml like:
(please keep to around 10 lines )
And we run a command:
masters_hostname=$(yq .roleGroups.master.[] config.yaml)
it could output
Describe alternatives you've considered
i want get node1 node2 node3 ip address, any suggestion
i want get output like this, but i don't know i can i do this
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: