【发布时间】:2016-02-01 14:16:06
【问题描述】:
我有一个类似的清单:
# Create an OSEv3 group that contains the masters and nodes groups
[OSEv3:children]
masters
nodes
# Set variables common for all OSEv3 hosts
[OSEv3:vars]
# SSH user, this user should allow ssh based auth without requiring a password
ansible_ssh_user=centos
# If ansible_ssh_user is not root, ansible_sudo must be set to true
ansible_sudo=true
product_type=openshift
deployment_type=enterprise
# uncomment the following to enable htpasswd authentication; defaults to DenyAllPasswordIdentityProvider
#openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true', 'challenge': 'true', 'kind': 'HTPasswdPasswordIdentityProvider', 'filename': '/etc/openshift/openshift-passwd'}]
# host group for masters
[masters]
master.example.com
# host group for nodes, includes region info
[nodes]
master.example.com openshift_node_labels="{'region': 'infra', 'zone': 'default'}"
node1.example.com openshift_node_labels="{'region': 'primary', 'zone': 'east'}"
node2.example.com openshift_node_labels="{'region': 'primary', 'zone': 'west'}"
现在我需要密钥来使主机可以访问 ansible。 我有 2 把钥匙。一个给我的主人,一个给我的节点。如何更改此脚本以告知 ansible 它必须使用哪个键?
脚本将在我的主人身上执行。我的主人包含/root/.ssh/中的2个键
目前我现在只能在/etc/ansible/ansible.cfg 中使用private_key_file,但这只能为 Ansible 配置一个标准密钥。
【问题讨论】: