0

ansible を使用して OpenStack に OpenShift Origin V3 をインストールするために、このブログをフォローしています。しかし、私はエラーが発生しています

"Could not create fact file: %s, error: %s" % (filename, ex) main .OpenShiftFactsFileWriteError: Could not create fact file: /etc/ansible/facts.d/openshift.fact, error: [Errno 13]許可が拒否されました: '/etc/ansible/facts.d'

ターゲット システムは CentOS であり、ターゲット システムでパスワードなしの sudo を実行できます。私も追加しました/etc/sudoers

centos All=(ALL) NOPASSWD:ALL

すべてのノードに、また私が ansible を実行しているシステムにも。

ansible を実行するシステムから、root として sudo として実行しようとしましたが、結果は同じでした。

アクセス許可が拒否された場所、つまりホスト システムまたはターゲット システムのどこに直面しているのかわかりません。

可能なホスト:

[OSEv3:children"]
masters
nodes

[OSEv3:vars]
ansible_ssh_user=centos
ansible_sudo=true
#ansible_ssh_user=root

product_type=openshift
deployment_type=origin

[masters]
192.168.144.132 openshift_public_hostname=master.novalocal openshift_ip=10.0.1.163 openshift_public_ip=192.168.144.132

[nodes]
192.168.144.128 openshift_public_hostname=node1.novalocal openshift_ip=10.0.1.164 openshift_public_ip=192.168.144.128 openshift_node_labels="{'region': 'primary', 'zone': 'east'}" 
192.168.144.129 openshift_public_hostname=node2.novalocal openshift_ip=10.0.1.165 openshift_public_ip=192.168.144.129 openshift_node_labels="{'region': 'primary', 'zone': 'west'}"

Ansible.cfg

[defaults]
hostfile = ansible_hosts
remote_user = centos
host_key_checking = False

以下はログです:

TASK: [openshift_facts | Ensure PyYaml is installed] ************************** 
ok: [192.168.144.132] => (item=PyYAML)

TASK: [openshift_facts | Gather Cluster facts] ******************************** 
failed: [192.168.144.132] => {"failed": true, "parsed": false}
Traceback (most recent call last):
  File "/home/centos/.ansible/tmp/ansible-tmp-1449035570.03-273189812167365/openshift_facts", line 6355, in <module>
    main()
  File "/home/centos/.ansible/tmp/ansible-tmp-1449035570.03-273189812167365/openshift_facts", line 1222, in main
    openshift_facts = OpenShiftFacts(role, fact_file, local_facts, additive_facts_to_overwrite)
  File "/home/centos/.ansible/tmp/ansible-tmp-1449035570.03-273189812167365/openshift_facts", line 999, in __init__
    self.facts = self.generate_facts(local_facts, additive_facts_to_overwrite)
  File "/home/centos/.ansible/tmp/ansible-tmp-1449035570.03-273189812167365/openshift_facts", line 1013, in generate_facts
    local_facts = self.init_local_facts(local_facts, additive_facts_to_overwrite)
  File "/home/centos/.ansible/tmp/ansible-tmp-1449035570.03-273189812167365/openshift_facts", line 1194, in init_local_facts
    save_local_facts(self.filename, new_local_facts)
  File "/home/centos/.ansible/tmp/ansible-tmp-1449035570.03-273189812167365/openshift_facts", line 924, in save_local_facts
    "Could not create fact file: %s, error: %s" % (filename, ex)
__main__.OpenShiftFactsFileWriteError: Could not create fact file: /etc/ansible/facts.d/openshift.fact, error: [Errno 13] Permission denied: '/etc/ansible'
OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: auto-mux: Trying existing master
debug1: mux_client_request_session: master session id: 2
Shared connection to 192.168.144.132 closed.


FATAL: all hosts have already failed -- aborting

PLAY RECAP ******************************************************************** 
           to retry, use: --limit @/root/config.retry

192.168.144.132            : ok=6    changed=0    unreachable=0    failed=1   
localhost                  : ok=7    changed=0    unreachable=0    failed=0   

ansible の使用経験がないため、これ以上デバッグすることはできません。

4

1 に答える 1

4

これに対する解決策は非常に簡単に思えます。ansibleのGoogleグループで見つけました。

追加するだけでいい

sudo = true 
sudo_user = root

ansible.cfg ファイルで。

少なくともこのエラーはなくなりましたが、新しいエラーが発生しました。

EDIT 以下のコメントで示唆されているように、sudo_user は root でなければならないため、それに応じて anser を変更しました。

于 2015-12-03T05:46:43.737 に答える