Hi All,
I am a newbie to ansible.
I am following this blog to install OpenShift Origin V3 on OpenStack using ansible. But I am getting error as below:
“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/facts.d’
The target system is Centos and I can do passwordless sudo on the target systems. I even added in /etc/sudoers
centos All=(ALL) NOPASSWD:ALL
to all the nodes and also on the system from which I am running ansible.
From the system I run ansible, I tried executing as sudo, as root but same results.
I am not sure where it faces permission denied, I mean on the host or the target systems.
Ansible vars:
[OSEv3:vars]
ansible_ssh_user=centos
ansible_sudo=true
Ansible.cfg
[defaults]
hostfile = ansible_hosts
remote_user = centos
host_key_checking = False
Below is the full log:
root@ubuntu:/home/suryaveer# ansible all -m ping
192.168.144.129 | success >> {
“changed”: false,
“ping”: “pong”
}
192.168.144.128 | success >> {
“changed”: false,
“ping”: “pong”
}
192.168.144.132 | success >> {
“changed”: false,
“ping”: “pong”
}
root@ubuntu:/home/suryaveer# ansible-playbook openshift-ansible/playbooks/byo/config.yml
PLAY [Populate config host groups] ********************************************
TASK: [fail ] *****************************************************************
skipping: [localhost]
TASK: [fail ] *****************************************************************
skipping: [localhost]
TASK: [fail ] *****************************************************************
skipping: [localhost]
TASK: [fail ] *****************************************************************
skipping: [localhost]
TASK: [Evaluate oo_etcd_to_config] ********************************************
skipping: [localhost]
TASK: [Evaluate oo_masters_to_config] *****************************************
ok: [localhost] => (item=192.168.144.132)
TASK: [set_fact ] *************************************************************
ok: [localhost]
TASK: [Evaluate oo_nodes_to_config] *******************************************
ok: [localhost] => (item=192.168.144.128)
ok: [localhost] => (item=192.168.144.129)
TASK: [Evaluate oo_nodes_to_config] *******************************************
skipping: [localhost] => (item=192.168.144.132)
TASK: [Evaluate oo_first_etcd] ************************************************
skipping: [localhost]
TASK: [Evaluate oo_first_master] **********************************************
ok: [localhost]
TASK: [Evaluate oo_lb_to_config] **********************************************
skipping: [localhost]
PLAY [Set etcd facts needed for generating certs] *****************************
skipping: no hosts matched
PLAY [Create temp directory for syncing certs] ********************************
TASK: [Create local temp directory for syncing certs] *************************
ok: [localhost → 127.0.0.1]
PLAY [Configure etcd certificates] ********************************************
skipping: no hosts matched
PLAY [Configure etcd hosts] ***************************************************
skipping: no hosts matched
PLAY [Delete temporary directory on localhost] ********************************
TASK: [file name={{ g_etcd_mktemp.stdout }} state=absent] *********************
ok: [localhost]
PLAY [Set master facts and determine if external etcd certs need to be generated] ***
GATHERING FACTS ***************************************************************
ok: [192.168.144.132]
TASK: [Check for RPM generated config marker file .config_managed] ************
ok: [192.168.144.132]
TASK: [Remove RPM generated config files if present] **************************
skipping: [192.168.144.132] => (item=master)
skipping: [192.168.144.132] => (item=node)
skipping: [192.168.144.132] => (item=.config_managed)
TASK: [set_fact ] *************************************************************
ok: [192.168.144.132]
TASK: [openshift_facts | Verify Ansible version is greater than 1.8.0 and not 1.9.0 and not 1.9.0.1] ***
ok: [192.168.144.132]
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
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
I have no prior experience with ansible, therefore I am unable to debug more.
Thanks