Re: [ansible-project] custom facts - "msg": "[Errno 8] Exec format error: b'/etc/ansible/facts.d/custom.fact'", "rc": 8}},

2020-04-06 Thread Rajesh Bandar
Thanks Dennis for your help. Once I changed the mode to "644" as suggested by Jean-Yves, the playbook worked fine. On Sun, Apr 5, 2020 at 6:02 PM Dennis McCarthy wrote: > try deleting: /etc/ansible/facts.d > > and let ansible recreate it. If you still get the same issue (delete > /etc/ansible/f

Re: [ansible-project] custom facts - "msg": "[Errno 8] Exec format error: b'/etc/ansible/facts.d/custom.fact'", "rc": 8}},

2020-04-06 Thread Rajesh Bandar
Thanks a lot Jean-Yves. I have changed the mode to 0644 and ran the playbook. It worked fine without any issues. I can't find good documentation on custom facts. Thanks for your help. - name: Create a custom facts file hosts: database become: true become_user: root gather_facts: true tas

Re: [ansible-project] custom facts - "msg": "[Errno 8] Exec format error: b'/etc/ansible/facts.d/custom.fact'", "rc": 8}},

2020-04-05 Thread Jean-Yves LENHOF
Hi, Your fact is simple INI file, not a script which give json output. Try removing the execution bit on your fact (644 for example) Info provided here with some 2 mn googling : https://groups.google.com/forum/#!topic/ansible-project/2JRR8a-K9_8 Regards, Le 05/04/2020 à 08:22, Rajesh a écri

Re: [ansible-project] custom facts - "msg": "[Errno 8] Exec format error: b'/etc/ansible/facts.d/custom.fact'", "rc": 8}},

2020-04-05 Thread Dennis McCarthy
try deleting: /etc/ansible/facts.d and let ansible recreate it. If you still get the same issue (delete /etc/ansible/facts.d again) and try running ansible either as root or with sudo just to rule out permissions. On Sun, 5 Apr 2020 at 07:22, Rajesh wrote: > Tried that but still not working.

Re: [ansible-project] custom facts - "msg": "[Errno 8] Exec format error: b'/etc/ansible/facts.d/custom.fact'", "rc": 8}},

2020-04-04 Thread Rajesh
Tried that but still not working. Thanks for your help. On Saturday, April 4, 2020 at 7:35:12 PM UTC+11, Jean-Yves LENHOF wrote: > > The first time you run it, files are not yet in place, so you probably > need to regather fact, no ? You can do it with setup: > > Regards, > > > Le 04/04/2020 à 10

Re: [ansible-project] custom facts - "msg": "[Errno 8] Exec format error: b'/etc/ansible/facts.d/custom.fact'", "rc": 8}},

2020-04-04 Thread Rajesh
Thanks Dennis. I have modified my playbook as you suggested. But I am still getting the below error. - name: Create a custom facts file hosts: database become: true become_user: root gather_facts: true tasks: - name: Create a custom facts directory file: path: /etc/ans

Re: [ansible-project] custom facts - "msg": "[Errno 8] Exec format error: b'/etc/ansible/facts.d/custom.fact'", "rc": 8}},

2020-04-04 Thread Dennis McCarthy
I've written a GitHub repo to demo using local_facts here: https://github.com/dmccuk/ansible_local_facts The bit you need to do is this (which is also part of the demo): - name: local facts debug: var=ansible_local notify: - reload facts - name: reload facts setup: filter=ansible_local

Re: [ansible-project] custom facts - "msg": "[Errno 8] Exec format error: b'/etc/ansible/facts.d/custom.fact'", "rc": 8}},

2020-04-04 Thread Jean-Yves LENHOF
The first time you run it, files are not yet in place, so you probably need to regather fact, no ? You can do it with setup: Regards, Le 04/04/2020 à 10:18, Rajesh a écrit : Could someone help why I am still getting the below error? Thanks, Rajesh On Thursday, April 2, 2020 at 5:38:27 PM UT

Re: [ansible-project] custom facts - "msg": "[Errno 8] Exec format error: b'/etc/ansible/facts.d/custom.fact'", "rc": 8}},

2020-04-04 Thread Rajesh
Could someone help why I am still getting the below error? Thanks, Rajesh On Thursday, April 2, 2020 at 5:38:27 PM UTC+11, Rajesh wrote: > > Thanks for that. I have modified the playbook as you suggested. The > playbook creates the custom file, but still giving the below error. > > [automation@w

Re: [ansible-project] custom facts - "msg": "[Errno 8] Exec format error: b'/etc/ansible/facts.d/custom.fact'", "rc": 8}},

2020-04-01 Thread Rajesh
Thanks for that. I have modified the playbook as you suggested. The playbook creates the custom file, but still giving the below error. [automation@workstation plays]$ cat facts.yml - name: Create a custom facts file hosts: database become: true become_user: root gather_facts: true tas

Re: [ansible-project] custom facts - "msg": "[Errno 8] Exec format error: b'/etc/ansible/facts.d/custom.fact'", "rc": 8}},

2020-04-01 Thread Stefan Hornburg (Racke)
On 4/2/20 4:16 AM, Rajesh wrote: > Hi All, > > I created a custom facts playbook. But I am getting an error when I run. I > could not figure out why? Hello Rajesh, if /etc/ansible/facts.d/custom.fact is supposed to be a script it needs executable permissions: - name: Create a custom facts t

[ansible-project] custom facts - "msg": "[Errno 8] Exec format error: b'/etc/ansible/facts.d/custom.fact'", "rc": 8}},

2020-04-01 Thread Rajesh
Hi All, I created a custom facts playbook. But I am getting an error when I run. I could not figure out why? *Playbook* - name: Create a custom facts file hosts: database become: true become_user: root gather_facts: true tasks: - name: Create a custom facts directory file: