#ansible (2020-02)
Discussions related to ansible configuration management
2020-02-20
Santiago Campuzano
Morning to everyone… !
Santiago Campuzano
I have this simple playbook:
Santiago Campuzano
---
- hosts: all
vars:
dest: /tmp/distro.csv
tasks:
- copy:
content: ''
dest: "{{ dest }}"
run_once: yes
delegate_to: localhost
- lineinfile:
dest: "{{ dest }}"
line: '{{ inventory_hostname }},{{ ansible_distribution }},{{ ansible_distribution_major_version }},{{ ansible_distribution_version }},{{ ansible_distribution_release }}'
delegate_to: localhost
run_once: true
Santiago Campuzano
Which is intended to get OS and platform info about every single node on the inventory, and write the /tmp/distro.csv
Santiago Campuzano
The playbook seems to run fine against all hosts:
Santiago Campuzano
ok: [172.30.104.180]
ok: [172.30.104.176]
ok: [172.30.32.241]
ok: [172.30.33.129]
ok: [172.30.34.236]
ok: [172.30.35.212]
ok: [172.30.35.194]
ok: [172.30.33.97
Santiago Campuzano
But the file is not written
Santiago Campuzano
Any idea what could be wrong with it ?
Santiago Campuzano
I would really appreciate any help
2020-02-21
Erik Osterman (Cloud Posse)
@scorebot help keep tabs!
scorebot
05:45:24 PM
@scorebot has joined the channel
scorebot
05:45:25 PM
Thanks for adding me emojis used in this channel are now worth points.
scorebot
05:45:26 PM
Wondering what I can do? try @scorebot help