#ansible (2020-02)

ansible

Discussions related to ansible configuration management

2020-02-20

Santiago Campuzano avatar
Santiago Campuzano

Morning to everyone… !

Santiago Campuzano avatar
Santiago Campuzano

I have this simple playbook:

Santiago Campuzano avatar
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 avatar
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 avatar
Santiago Campuzano

The playbook seems to run fine against all hosts:

Santiago Campuzano avatar
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 avatar
Santiago Campuzano

But the file is not written

Santiago Campuzano avatar
Santiago Campuzano

Any idea what could be wrong with it ?

Santiago Campuzano avatar
Santiago Campuzano

I would really appreciate any help

2020-02-21

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

@scorebot help keep tabs!

scorebot avatar
scorebot
05:45:24 PM

@scorebot has joined the channel

scorebot avatar
scorebot
05:45:25 PM

Thanks for adding me emojis used in this channel are now worth points.

scorebot avatar
scorebot
05:45:26 PM

Wondering what I can do? try @scorebot help

    keyboard_arrow_up